diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/BotCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/InraidCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/10ScopesAndTypes/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/IChatCommand.d.ts similarity index 71% rename from TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts rename to TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/IChatCommand.d.ts index cca1fb3..ade0adc 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -1,6 +1,10 @@ import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { getCommandPrefix(): string; getCommandHelp(command: string): string; getCommands(): Set; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HttpServerHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/AmmoTypes.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/WeaponTypes.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts b/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts +++ b/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts b/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/10ScopesAndTypes/types/services/ItemBaseClassService.d.ts b/TypeScript/10ScopesAndTypes/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/10ScopesAndTypes/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts b/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/10ScopesAndTypes/types/services/ProfileActivityService.d.ts b/TypeScript/10ScopesAndTypes/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts b/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/10ScopesAndTypes/types/utils/App.d.ts b/TypeScript/10ScopesAndTypes/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/App.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/10ScopesAndTypes/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/10ScopesAndTypes/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/BotCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/InraidCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/11BundleLoadingSample/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/IChatCommand.d.ts similarity index 71% rename from TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts rename to TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/IChatCommand.d.ts index cca1fb3..ade0adc 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -1,6 +1,10 @@ import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { getCommandPrefix(): string; getCommandHelp(command: string): string; getCommands(): Set; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/11BundleLoadingSample/types/helpers/HttpServerHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/AmmoTypes.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/WeaponTypes.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts b/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts +++ b/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts b/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts b/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/11BundleLoadingSample/types/services/ItemBaseClassService.d.ts b/TypeScript/11BundleLoadingSample/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/11BundleLoadingSample/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/11BundleLoadingSample/types/services/PaymentService.d.ts b/TypeScript/11BundleLoadingSample/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/11BundleLoadingSample/types/services/PaymentService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/11BundleLoadingSample/types/services/ProfileActivityService.d.ts b/TypeScript/11BundleLoadingSample/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts b/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts b/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/11BundleLoadingSample/types/utils/App.d.ts b/TypeScript/11BundleLoadingSample/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/App.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/11BundleLoadingSample/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/11BundleLoadingSample/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/BotCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/InraidCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/12ClassExtensionOverride/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/IChatCommand.d.ts similarity index 71% rename from TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts rename to TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/IChatCommand.d.ts index cca1fb3..ade0adc 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -1,6 +1,10 @@ import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { getCommandPrefix(): string; getCommandHelp(command: string): string; getCommands(): Set; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/HttpServerHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/AmmoTypes.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/WeaponTypes.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts b/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/12ClassExtensionOverride/types/services/ItemBaseClassService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/12ClassExtensionOverride/types/services/PaymentService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/PaymentService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/12ClassExtensionOverride/types/services/ProfileActivityService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/12ClassExtensionOverride/types/utils/App.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/App.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/12ClassExtensionOverride/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/13AddTrader/types/callbacks/BotCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/13AddTrader/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/13AddTrader/types/callbacks/InraidCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/13AddTrader/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/13AddTrader/types/controllers/BotController.d.ts b/TypeScript/13AddTrader/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/13AddTrader/types/controllers/BotController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/13AddTrader/types/controllers/BuildController.d.ts b/TypeScript/13AddTrader/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/13AddTrader/types/controllers/BuildController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/13AddTrader/types/controllers/GameController.d.ts b/TypeScript/13AddTrader/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/13AddTrader/types/controllers/GameController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts b/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts b/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/13AddTrader/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/13AddTrader/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/13AddTrader/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts b/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/IChatCommand.d.ts similarity index 71% rename from TypeScript/13AddTrader/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts rename to TypeScript/13AddTrader/types/helpers/Dialogue/Commando/IChatCommand.d.ts index cca1fb3..ade0adc 100644 --- a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -1,6 +1,10 @@ import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { getCommandPrefix(): string; getCommandHelp(command: string): string; getCommands(): Set; diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/13AddTrader/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts b/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/13AddTrader/types/helpers/HttpServerHelper.d.ts b/TypeScript/13AddTrader/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/13AddTrader/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts b/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/13AddTrader/types/models/enums/AmmoTypes.d.ts b/TypeScript/13AddTrader/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/13AddTrader/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/13AddTrader/types/models/enums/WeaponTypes.d.ts b/TypeScript/13AddTrader/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/13AddTrader/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/13AddTrader/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/13AddTrader/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/13AddTrader/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/13AddTrader/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/13AddTrader/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/13AddTrader/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/13AddTrader/types/servers/HttpServer.d.ts b/TypeScript/13AddTrader/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/13AddTrader/types/servers/HttpServer.d.ts +++ b/TypeScript/13AddTrader/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts b/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts +++ b/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/13AddTrader/types/services/FenceService.d.ts b/TypeScript/13AddTrader/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/13AddTrader/types/services/FenceService.d.ts +++ b/TypeScript/13AddTrader/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/13AddTrader/types/services/ItemBaseClassService.d.ts b/TypeScript/13AddTrader/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/13AddTrader/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/13AddTrader/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/13AddTrader/types/services/PaymentService.d.ts b/TypeScript/13AddTrader/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/13AddTrader/types/services/PaymentService.d.ts +++ b/TypeScript/13AddTrader/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/13AddTrader/types/services/ProfileActivityService.d.ts b/TypeScript/13AddTrader/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/13AddTrader/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts b/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts +++ b/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts b/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts +++ b/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/13AddTrader/types/utils/App.d.ts b/TypeScript/13AddTrader/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/13AddTrader/types/utils/App.d.ts +++ b/TypeScript/13AddTrader/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/13AddTrader/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/13AddTrader/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/13AddTrader/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/13AddTrader/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/BotCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/InraidCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/14AfterDBLoadHook/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/HttpServerHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/AmmoTypes.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/WeaponTypes.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts b/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/14AfterDBLoadHook/types/services/ItemBaseClassService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/14AfterDBLoadHook/types/services/PaymentService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/PaymentService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/14AfterDBLoadHook/types/services/ProfileActivityService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/14AfterDBLoadHook/types/utils/App.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/App.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/14AfterDBLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/15HttpListenerExample/types/callbacks/BotCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/15HttpListenerExample/types/callbacks/InraidCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/15HttpListenerExample/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/15HttpListenerExample/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/15HttpListenerExample/types/helpers/HttpServerHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/15HttpListenerExample/types/models/enums/AmmoTypes.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/15HttpListenerExample/types/models/enums/WeaponTypes.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/15HttpListenerExample/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts b/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts +++ b/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts b/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts b/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/15HttpListenerExample/types/services/ItemBaseClassService.d.ts b/TypeScript/15HttpListenerExample/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/15HttpListenerExample/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/15HttpListenerExample/types/services/PaymentService.d.ts b/TypeScript/15HttpListenerExample/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/15HttpListenerExample/types/services/PaymentService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/15HttpListenerExample/types/services/ProfileActivityService.d.ts b/TypeScript/15HttpListenerExample/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts b/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts b/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/15HttpListenerExample/types/utils/App.d.ts b/TypeScript/15HttpListenerExample/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/15HttpListenerExample/types/utils/App.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/15HttpListenerExample/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/15HttpListenerExample/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/15HttpListenerExample/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/16ImporterUtil/types/callbacks/BotCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/16ImporterUtil/types/callbacks/InraidCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts b/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts b/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts b/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts b/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts b/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/16ImporterUtil/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/16ImporterUtil/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/16ImporterUtil/types/generators/LootGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/16ImporterUtil/types/generators/LootGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/16ImporterUtil/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/16ImporterUtil/types/helpers/HttpServerHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/16ImporterUtil/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/16ImporterUtil/types/models/enums/AmmoTypes.d.ts b/TypeScript/16ImporterUtil/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/16ImporterUtil/types/models/enums/WeaponTypes.d.ts b/TypeScript/16ImporterUtil/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/16ImporterUtil/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/16ImporterUtil/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/16ImporterUtil/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/16ImporterUtil/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts b/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts +++ b/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts b/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/16ImporterUtil/types/services/FenceService.d.ts b/TypeScript/16ImporterUtil/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/16ImporterUtil/types/services/FenceService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/16ImporterUtil/types/services/ItemBaseClassService.d.ts b/TypeScript/16ImporterUtil/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/16ImporterUtil/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/16ImporterUtil/types/services/PaymentService.d.ts b/TypeScript/16ImporterUtil/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/16ImporterUtil/types/services/PaymentService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/16ImporterUtil/types/services/ProfileActivityService.d.ts b/TypeScript/16ImporterUtil/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts b/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts b/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/16ImporterUtil/types/utils/App.d.ts b/TypeScript/16ImporterUtil/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/16ImporterUtil/types/utils/App.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/16ImporterUtil/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/16ImporterUtil/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/16ImporterUtil/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BotCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InraidCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/LootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/LootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HttpServerHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/AmmoTypes.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WeaponTypes.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/ItemBaseClassService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/PaymentService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/PaymentService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileActivityService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/App.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/App.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BotCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InraidCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/LootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/LootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HttpServerHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/AmmoTypes.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WeaponTypes.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/ItemBaseClassService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/PaymentService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/PaymentService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileActivityService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/App.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/App.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/18CustomItemService/types/callbacks/BotCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/18CustomItemService/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/18CustomItemService/types/callbacks/InraidCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/18CustomItemService/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/18CustomItemService/types/controllers/BotController.d.ts b/TypeScript/18CustomItemService/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/18CustomItemService/types/controllers/BotController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts b/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/18CustomItemService/types/controllers/GameController.d.ts b/TypeScript/18CustomItemService/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/18CustomItemService/types/controllers/GameController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts b/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts b/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/18CustomItemService/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/18CustomItemService/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/18CustomItemService/types/generators/LootGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/18CustomItemService/types/generators/LootGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/18CustomItemService/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/18CustomItemService/types/helpers/HttpServerHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/18CustomItemService/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/18CustomItemService/types/models/enums/AmmoTypes.d.ts b/TypeScript/18CustomItemService/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/18CustomItemService/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/18CustomItemService/types/models/enums/WeaponTypes.d.ts b/TypeScript/18CustomItemService/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/18CustomItemService/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/18CustomItemService/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/18CustomItemService/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/18CustomItemService/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/18CustomItemService/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/18CustomItemService/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/18CustomItemService/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts b/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts +++ b/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts b/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts +++ b/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/18CustomItemService/types/services/FenceService.d.ts b/TypeScript/18CustomItemService/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/18CustomItemService/types/services/FenceService.d.ts +++ b/TypeScript/18CustomItemService/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/18CustomItemService/types/services/ItemBaseClassService.d.ts b/TypeScript/18CustomItemService/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/18CustomItemService/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/18CustomItemService/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/18CustomItemService/types/services/PaymentService.d.ts b/TypeScript/18CustomItemService/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/18CustomItemService/types/services/PaymentService.d.ts +++ b/TypeScript/18CustomItemService/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/18CustomItemService/types/services/ProfileActivityService.d.ts b/TypeScript/18CustomItemService/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/18CustomItemService/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts b/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts +++ b/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts b/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts +++ b/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/18CustomItemService/types/utils/App.d.ts b/TypeScript/18CustomItemService/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/18CustomItemService/types/utils/App.d.ts +++ b/TypeScript/18CustomItemService/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/18CustomItemService/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/18CustomItemService/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/18CustomItemService/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/18CustomItemService/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/BotCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/InraidCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/19UseExternalLibraries/types/controllers/HideoutController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/HideoutController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/19UseExternalLibraries/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/19UseExternalLibraries/types/generators/LootGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/LootGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/19UseExternalLibraries/types/helpers/HttpServerHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/19UseExternalLibraries/types/helpers/PresetHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/PresetHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/19UseExternalLibraries/types/models/enums/AmmoTypes.d.ts b/TypeScript/19UseExternalLibraries/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/19UseExternalLibraries/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/19UseExternalLibraries/types/models/enums/WeaponTypes.d.ts b/TypeScript/19UseExternalLibraries/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/19UseExternalLibraries/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts b/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts +++ b/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts b/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts b/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/19UseExternalLibraries/types/services/ItemBaseClassService.d.ts b/TypeScript/19UseExternalLibraries/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/19UseExternalLibraries/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/19UseExternalLibraries/types/services/PaymentService.d.ts b/TypeScript/19UseExternalLibraries/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/19UseExternalLibraries/types/services/PaymentService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/19UseExternalLibraries/types/services/ProfileActivityService.d.ts b/TypeScript/19UseExternalLibraries/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts b/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts b/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/19UseExternalLibraries/types/utils/App.d.ts b/TypeScript/19UseExternalLibraries/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/App.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/19UseExternalLibraries/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/19UseExternalLibraries/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/1LogToConsole/types/callbacks/BotCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/1LogToConsole/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/1LogToConsole/types/callbacks/InraidCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/1LogToConsole/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/1LogToConsole/types/controllers/BotController.d.ts b/TypeScript/1LogToConsole/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/1LogToConsole/types/controllers/BotController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts b/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts b/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts b/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/1LogToConsole/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/1LogToConsole/types/helpers/HttpServerHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/1LogToConsole/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/1LogToConsole/types/models/enums/AmmoTypes.d.ts b/TypeScript/1LogToConsole/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/1LogToConsole/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/1LogToConsole/types/models/enums/WeaponTypes.d.ts b/TypeScript/1LogToConsole/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/1LogToConsole/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/1LogToConsole/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/1LogToConsole/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/1LogToConsole/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/1LogToConsole/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/1LogToConsole/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts b/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts +++ b/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts b/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts +++ b/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/1LogToConsole/types/services/FenceService.d.ts b/TypeScript/1LogToConsole/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/1LogToConsole/types/services/FenceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/1LogToConsole/types/services/ItemBaseClassService.d.ts b/TypeScript/1LogToConsole/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/1LogToConsole/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/1LogToConsole/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/1LogToConsole/types/services/PaymentService.d.ts b/TypeScript/1LogToConsole/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/1LogToConsole/types/services/PaymentService.d.ts +++ b/TypeScript/1LogToConsole/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/1LogToConsole/types/services/ProfileActivityService.d.ts b/TypeScript/1LogToConsole/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/1LogToConsole/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts b/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts +++ b/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts b/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/1LogToConsole/types/utils/App.d.ts b/TypeScript/1LogToConsole/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/1LogToConsole/types/utils/App.d.ts +++ b/TypeScript/1LogToConsole/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/1LogToConsole/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/1LogToConsole/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/1LogToConsole/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/1LogToConsole/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/20CustomChatBot/types/callbacks/BotCallbacks.d.ts b/TypeScript/20CustomChatBot/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/20CustomChatBot/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/20CustomChatBot/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/20CustomChatBot/types/callbacks/InraidCallbacks.d.ts b/TypeScript/20CustomChatBot/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/20CustomChatBot/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/20CustomChatBot/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts b/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts b/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/20CustomChatBot/types/controllers/GameController.d.ts b/TypeScript/20CustomChatBot/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/20CustomChatBot/types/controllers/GameController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/20CustomChatBot/types/controllers/HideoutController.d.ts b/TypeScript/20CustomChatBot/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/20CustomChatBot/types/controllers/HideoutController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts b/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/20CustomChatBot/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/20CustomChatBot/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/20CustomChatBot/types/generators/LootGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/20CustomChatBot/types/generators/LootGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/20CustomChatBot/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/20CustomChatBot/types/helpers/HideoutHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/20CustomChatBot/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/20CustomChatBot/types/helpers/HttpServerHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/20CustomChatBot/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/20CustomChatBot/types/helpers/PresetHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/20CustomChatBot/types/helpers/PresetHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/20CustomChatBot/types/models/enums/AmmoTypes.d.ts b/TypeScript/20CustomChatBot/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/20CustomChatBot/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/20CustomChatBot/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/20CustomChatBot/types/models/enums/WeaponTypes.d.ts b/TypeScript/20CustomChatBot/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/20CustomChatBot/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/20CustomChatBot/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/20CustomChatBot/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/20CustomChatBot/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/20CustomChatBot/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/20CustomChatBot/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/20CustomChatBot/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts b/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts +++ b/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts b/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/20CustomChatBot/types/services/FenceService.d.ts b/TypeScript/20CustomChatBot/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/20CustomChatBot/types/services/FenceService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/20CustomChatBot/types/services/ItemBaseClassService.d.ts b/TypeScript/20CustomChatBot/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/20CustomChatBot/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/20CustomChatBot/types/services/PaymentService.d.ts b/TypeScript/20CustomChatBot/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/20CustomChatBot/types/services/PaymentService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/20CustomChatBot/types/services/ProfileActivityService.d.ts b/TypeScript/20CustomChatBot/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/20CustomChatBot/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/20CustomChatBot/types/services/ProfileFixerService.d.ts b/TypeScript/20CustomChatBot/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/20CustomChatBot/types/services/ProfileFixerService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts b/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/20CustomChatBot/types/utils/App.d.ts b/TypeScript/20CustomChatBot/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/20CustomChatBot/types/utils/App.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/20CustomChatBot/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/20CustomChatBot/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/20CustomChatBot/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/21CustomCommandoCommand/types/callbacks/BotCallbacks.d.ts b/TypeScript/21CustomCommandoCommand/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/21CustomCommandoCommand/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/21CustomCommandoCommand/types/callbacks/InraidCallbacks.d.ts b/TypeScript/21CustomCommandoCommand/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/21CustomCommandoCommand/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/GameController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/GameController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/HideoutController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/HideoutController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/21CustomCommandoCommand/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/21CustomCommandoCommand/types/generators/LootGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/LootGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/HideoutHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/HttpServerHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/PresetHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/PresetHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/21CustomCommandoCommand/types/models/enums/AmmoTypes.d.ts b/TypeScript/21CustomCommandoCommand/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/21CustomCommandoCommand/types/models/enums/WeaponTypes.d.ts b/TypeScript/21CustomCommandoCommand/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts b/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/21CustomCommandoCommand/types/services/ItemBaseClassService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/21CustomCommandoCommand/types/services/PaymentService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/PaymentService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/21CustomCommandoCommand/types/services/ProfileActivityService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/21CustomCommandoCommand/types/services/ProfileFixerService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/ProfileFixerService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/21CustomCommandoCommand/types/utils/App.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/App.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/21CustomCommandoCommand/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/22CustomAkiCommand/types/callbacks/BotCallbacks.d.ts b/TypeScript/22CustomAkiCommand/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/22CustomAkiCommand/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/22CustomAkiCommand/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/22CustomAkiCommand/types/callbacks/InraidCallbacks.d.ts b/TypeScript/22CustomAkiCommand/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/22CustomAkiCommand/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/22CustomAkiCommand/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/22CustomAkiCommand/types/controllers/GameController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/GameController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/22CustomAkiCommand/types/controllers/HideoutController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/HideoutController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/22CustomAkiCommand/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/22CustomAkiCommand/types/generators/LootGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/LootGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/22CustomAkiCommand/types/helpers/HideoutHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/22CustomAkiCommand/types/helpers/HttpServerHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/22CustomAkiCommand/types/helpers/PresetHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/PresetHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/22CustomAkiCommand/types/models/enums/AmmoTypes.d.ts b/TypeScript/22CustomAkiCommand/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/22CustomAkiCommand/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/22CustomAkiCommand/types/models/enums/WeaponTypes.d.ts b/TypeScript/22CustomAkiCommand/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/22CustomAkiCommand/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts b/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts +++ b/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts b/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts b/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/22CustomAkiCommand/types/services/ItemBaseClassService.d.ts b/TypeScript/22CustomAkiCommand/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/22CustomAkiCommand/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/22CustomAkiCommand/types/services/PaymentService.d.ts b/TypeScript/22CustomAkiCommand/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/22CustomAkiCommand/types/services/PaymentService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/22CustomAkiCommand/types/services/ProfileActivityService.d.ts b/TypeScript/22CustomAkiCommand/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/22CustomAkiCommand/types/services/ProfileFixerService.d.ts b/TypeScript/22CustomAkiCommand/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/22CustomAkiCommand/types/services/ProfileFixerService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts b/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/22CustomAkiCommand/types/utils/App.d.ts b/TypeScript/22CustomAkiCommand/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/App.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/22CustomAkiCommand/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/22CustomAkiCommand/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/2EditDatabase/types/callbacks/BotCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/2EditDatabase/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/2EditDatabase/types/callbacks/InraidCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/2EditDatabase/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/2EditDatabase/types/controllers/BotController.d.ts b/TypeScript/2EditDatabase/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/2EditDatabase/types/controllers/BotController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts b/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/2EditDatabase/types/controllers/GameController.d.ts b/TypeScript/2EditDatabase/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/2EditDatabase/types/controllers/GameController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts b/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts b/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/2EditDatabase/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/2EditDatabase/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/2EditDatabase/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/2EditDatabase/types/helpers/HttpServerHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/2EditDatabase/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/2EditDatabase/types/models/enums/AmmoTypes.d.ts b/TypeScript/2EditDatabase/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/2EditDatabase/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/2EditDatabase/types/models/enums/WeaponTypes.d.ts b/TypeScript/2EditDatabase/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/2EditDatabase/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/2EditDatabase/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/2EditDatabase/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/2EditDatabase/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/2EditDatabase/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/2EditDatabase/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts b/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts +++ b/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts b/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts +++ b/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/2EditDatabase/types/services/FenceService.d.ts b/TypeScript/2EditDatabase/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/2EditDatabase/types/services/FenceService.d.ts +++ b/TypeScript/2EditDatabase/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/2EditDatabase/types/services/ItemBaseClassService.d.ts b/TypeScript/2EditDatabase/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/2EditDatabase/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/2EditDatabase/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/2EditDatabase/types/services/PaymentService.d.ts b/TypeScript/2EditDatabase/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/2EditDatabase/types/services/PaymentService.d.ts +++ b/TypeScript/2EditDatabase/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/2EditDatabase/types/services/ProfileActivityService.d.ts b/TypeScript/2EditDatabase/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/2EditDatabase/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts b/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts +++ b/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts b/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts +++ b/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/2EditDatabase/types/utils/App.d.ts b/TypeScript/2EditDatabase/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/2EditDatabase/types/utils/App.d.ts +++ b/TypeScript/2EditDatabase/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/2EditDatabase/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/2EditDatabase/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/2EditDatabase/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/2EditDatabase/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/BotCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/InraidCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/3GetSptConfigFile/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/3GetSptConfigFile/types/helpers/HttpServerHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/AmmoTypes.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/WeaponTypes.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts b/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts +++ b/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts b/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts b/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/3GetSptConfigFile/types/services/ItemBaseClassService.d.ts b/TypeScript/3GetSptConfigFile/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/3GetSptConfigFile/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/3GetSptConfigFile/types/services/PaymentService.d.ts b/TypeScript/3GetSptConfigFile/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/3GetSptConfigFile/types/services/PaymentService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/3GetSptConfigFile/types/services/ProfileActivityService.d.ts b/TypeScript/3GetSptConfigFile/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts b/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/3GetSptConfigFile/types/utils/App.d.ts b/TypeScript/3GetSptConfigFile/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/App.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/3GetSptConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/3GetSptConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BotCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InraidCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HideoutController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HideoutController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LootGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LootGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} 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 62fb63e..8626984 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HttpServerHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/PresetHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/PresetHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/AmmoTypes.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/WeaponTypes.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } 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 d326b38..8edc3df 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemBaseClassService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PaymentService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PaymentService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileActivityService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileFixerService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileFixerService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/App.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/App.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/BotCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/InraidCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/4UseACustomConfigFile/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/HttpServerHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/AmmoTypes.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/WeaponTypes.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts b/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/4UseACustomConfigFile/types/services/ItemBaseClassService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/4UseACustomConfigFile/types/services/PaymentService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/PaymentService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/4UseACustomConfigFile/types/services/ProfileActivityService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/4UseACustomConfigFile/types/utils/App.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/App.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/4UseACustomConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/5ReplaceMethod/types/callbacks/BotCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/5ReplaceMethod/types/callbacks/InraidCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/5ReplaceMethod/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/5ReplaceMethod/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/5ReplaceMethod/types/helpers/HttpServerHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/5ReplaceMethod/types/models/enums/AmmoTypes.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/5ReplaceMethod/types/models/enums/WeaponTypes.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/5ReplaceMethod/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts b/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts +++ b/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts b/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts b/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/5ReplaceMethod/types/services/ItemBaseClassService.d.ts b/TypeScript/5ReplaceMethod/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/5ReplaceMethod/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/5ReplaceMethod/types/services/PaymentService.d.ts b/TypeScript/5ReplaceMethod/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/5ReplaceMethod/types/services/PaymentService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/5ReplaceMethod/types/services/ProfileActivityService.d.ts b/TypeScript/5ReplaceMethod/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts b/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts b/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/5ReplaceMethod/types/utils/App.d.ts b/TypeScript/5ReplaceMethod/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/5ReplaceMethod/types/utils/App.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/5ReplaceMethod/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/5ReplaceMethod/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/5ReplaceMethod/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/BotCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/InraidCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/HttpServerHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/AmmoTypes.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/WeaponTypes.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts b/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/6ReferenceAnotherClass/types/services/ItemBaseClassService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/6ReferenceAnotherClass/types/services/PaymentService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/PaymentService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/6ReferenceAnotherClass/types/services/ProfileActivityService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/App.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/App.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/7OnLoadHook/types/callbacks/BotCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/7OnLoadHook/types/callbacks/InraidCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts b/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts b/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts b/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts b/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts b/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/7OnLoadHook/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/7OnLoadHook/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/7OnLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/7OnLoadHook/types/helpers/HttpServerHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/7OnLoadHook/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/7OnLoadHook/types/models/enums/AmmoTypes.d.ts b/TypeScript/7OnLoadHook/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/7OnLoadHook/types/models/enums/WeaponTypes.d.ts b/TypeScript/7OnLoadHook/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/7OnLoadHook/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/7OnLoadHook/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/7OnLoadHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/7OnLoadHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts b/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts +++ b/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts b/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/7OnLoadHook/types/services/FenceService.d.ts b/TypeScript/7OnLoadHook/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/7OnLoadHook/types/services/FenceService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/7OnLoadHook/types/services/ItemBaseClassService.d.ts b/TypeScript/7OnLoadHook/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/7OnLoadHook/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/7OnLoadHook/types/services/PaymentService.d.ts b/TypeScript/7OnLoadHook/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/7OnLoadHook/types/services/PaymentService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/7OnLoadHook/types/services/ProfileActivityService.d.ts b/TypeScript/7OnLoadHook/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts b/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts b/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/7OnLoadHook/types/utils/App.d.ts b/TypeScript/7OnLoadHook/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/7OnLoadHook/types/utils/App.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/7OnLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/7OnLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/7OnLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/8OnUpdateHook/types/callbacks/BotCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/8OnUpdateHook/types/callbacks/InraidCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/8OnUpdateHook/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/8OnUpdateHook/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/8OnUpdateHook/types/helpers/HttpServerHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/8OnUpdateHook/types/models/enums/AmmoTypes.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/8OnUpdateHook/types/models/enums/WeaponTypes.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/8OnUpdateHook/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts b/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts +++ b/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts b/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts b/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/8OnUpdateHook/types/services/ItemBaseClassService.d.ts b/TypeScript/8OnUpdateHook/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/8OnUpdateHook/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/8OnUpdateHook/types/services/PaymentService.d.ts b/TypeScript/8OnUpdateHook/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/8OnUpdateHook/types/services/PaymentService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/8OnUpdateHook/types/services/ProfileActivityService.d.ts b/TypeScript/8OnUpdateHook/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts b/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts b/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/8OnUpdateHook/types/utils/App.d.ts b/TypeScript/8OnUpdateHook/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/8OnUpdateHook/types/utils/App.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/8OnUpdateHook/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/8OnUpdateHook/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/8OnUpdateHook/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/9RouterHooks/types/callbacks/BotCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/9RouterHooks/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/9RouterHooks/types/callbacks/InraidCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/9RouterHooks/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/9RouterHooks/types/controllers/BotController.d.ts b/TypeScript/9RouterHooks/types/controllers/BotController.d.ts index d148abc..3ec1aac 100644 --- a/TypeScript/9RouterHooks/types/controllers/BotController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/BotController.d.ts @@ -51,12 +51,13 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for * @returns Difficulty object */ getBotDifficulty(type: string, diffLevel: string): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts b/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/9RouterHooks/types/controllers/GameController.d.ts b/TypeScript/9RouterHooks/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/9RouterHooks/types/controllers/GameController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts b/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts b/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/9RouterHooks/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..6d8ac49 100644 --- a/TypeScript/9RouterHooks/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/FenceBaseAssortGenerator.d.ts @@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator { * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * 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 + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; protected getItemPrice(itemTpl: string, items: Item[]): number; protected getAmmoBoxPrice(items: Item[]): number; /** diff --git a/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts index 33d05de..8a85114 100644 --- a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -1,9 +1,12 @@ import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand { protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en español" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/9RouterHooks/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/9RouterHooks/types/helpers/HttpServerHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/9RouterHooks/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts index db6e56e..185fab9 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,8 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/9RouterHooks/types/models/enums/AmmoTypes.d.ts b/TypeScript/9RouterHooks/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/9RouterHooks/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/9RouterHooks/types/models/enums/WeaponTypes.d.ts b/TypeScript/9RouterHooks/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/9RouterHooks/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/9RouterHooks/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/9RouterHooks/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..29355e5 100644 --- a/TypeScript/9RouterHooks/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,8 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +22,7 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems" } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/9RouterHooks/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/9RouterHooks/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts b/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts index 8574cdd..ac356b2 100644 --- a/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts +++ b/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts @@ -19,6 +19,7 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event @@ -26,4 +27,5 @@ export declare class HttpServer { load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts b/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts index b013e5e..83097b6 100644 --- a/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts +++ b/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts @@ -69,6 +69,8 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/9RouterHooks/types/services/FenceService.d.ts b/TypeScript/9RouterHooks/types/services/FenceService.d.ts index bb1d035..8967026 100644 --- a/TypeScript/9RouterHooks/types/services/FenceService.d.ts +++ b/TypeScript/9RouterHooks/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,7 +38,7 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** @@ -93,17 +94,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -132,6 +139,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +160,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +169,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +178,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +189,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +211,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/9RouterHooks/types/services/ItemBaseClassService.d.ts b/TypeScript/9RouterHooks/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/9RouterHooks/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/9RouterHooks/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/9RouterHooks/types/services/PaymentService.d.ts b/TypeScript/9RouterHooks/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/9RouterHooks/types/services/PaymentService.d.ts +++ b/TypeScript/9RouterHooks/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/9RouterHooks/types/services/ProfileActivityService.d.ts b/TypeScript/9RouterHooks/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/9RouterHooks/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts b/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts index 804b3bf..806a8d9 100644 --- a/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts +++ b/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** * Attempt to fix common item issues that corrupt profiles * @param pmcProfile Profile to check items of @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to add missing IDs to */ addMissingIdsToBonuses(pmcProfile: IPmcData): void; + /** + * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found + */ + fixBitcoinProductionTime(pmcProfile: IPmcData): void; /** * At some point the property name was changed,migrate data across to new name * @param pmcProfile Profile to migrate improvements in diff --git a/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts b/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts index 5649751..eb01a16 100644 --- a/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts +++ b/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook diff --git a/TypeScript/9RouterHooks/types/utils/App.d.ts b/TypeScript/9RouterHooks/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/9RouterHooks/types/utils/App.d.ts +++ b/TypeScript/9RouterHooks/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/9RouterHooks/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/9RouterHooks/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/9RouterHooks/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/9RouterHooks/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise;