From 80bf789157f0b49aba1c6c248f12eccefb9f8dd2 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Sun, 7 Aug 2022 16:58:09 +0100 Subject: [PATCH] 320 types update --- .../controllers/InsuranceController.d.ts | 1 - .../types/models/spt/config/IBotConfig.d.ts | 9 +++--- .../services/BotEquipmentFilterService.d.ts | 31 ++++++++++++------- .../types/services/InsuranceService.d.ts | 9 ++++-- .../controllers/InsuranceController.d.ts | 1 - .../types/models/spt/config/IBotConfig.d.ts | 9 +++--- .../services/BotEquipmentFilterService.d.ts | 31 ++++++++++++------- .../types/services/InsuranceService.d.ts | 9 ++++-- .../controllers/InsuranceController.d.ts | 1 - .../types/models/spt/config/IBotConfig.d.ts | 9 +++--- .../services/BotEquipmentFilterService.d.ts | 31 ++++++++++++------- .../types/services/InsuranceService.d.ts | 9 ++++-- .../controllers/InsuranceController.d.ts | 1 - .../types/models/spt/config/IBotConfig.d.ts | 9 +++--- .../services/BotEquipmentFilterService.d.ts | 31 ++++++++++++------- .../types/services/InsuranceService.d.ts | 9 ++++-- .../controllers/InsuranceController.d.ts | 1 - .../types/models/spt/config/IBotConfig.d.ts | 9 +++--- .../services/BotEquipmentFilterService.d.ts | 31 ++++++++++++------- .../types/services/InsuranceService.d.ts | 9 ++++-- .../controllers/InsuranceController.d.ts | 1 - .../types/models/spt/config/IBotConfig.d.ts | 9 +++--- .../services/BotEquipmentFilterService.d.ts | 31 ++++++++++++------- .../types/services/InsuranceService.d.ts | 9 ++++-- .../controllers/InsuranceController.d.ts | 1 - .../types/models/spt/config/IBotConfig.d.ts | 9 +++--- .../services/BotEquipmentFilterService.d.ts | 31 ++++++++++++------- .../types/services/InsuranceService.d.ts | 9 ++++-- .../controllers/InsuranceController.d.ts | 1 - .../types/models/spt/config/IBotConfig.d.ts | 9 +++--- .../services/BotEquipmentFilterService.d.ts | 31 ++++++++++++------- .../types/services/InsuranceService.d.ts | 9 ++++-- .../controllers/InsuranceController.d.ts | 1 - .../types/models/spt/config/IBotConfig.d.ts | 9 +++--- .../services/BotEquipmentFilterService.d.ts | 31 ++++++++++++------- .../types/services/InsuranceService.d.ts | 9 ++++-- .../controllers/InsuranceController.d.ts | 1 - .../types/models/spt/config/IBotConfig.d.ts | 9 +++--- .../services/BotEquipmentFilterService.d.ts | 31 ++++++++++++------- .../types/services/InsuranceService.d.ts | 9 ++++-- .../controllers/InsuranceController.d.ts | 1 - .../types/models/spt/config/IBotConfig.d.ts | 9 +++--- .../services/BotEquipmentFilterService.d.ts | 31 ++++++++++++------- .../types/services/InsuranceService.d.ts | 9 ++++-- .../controllers/InsuranceController.d.ts | 1 - .../types/models/spt/config/IBotConfig.d.ts | 9 +++--- .../services/BotEquipmentFilterService.d.ts | 31 ++++++++++++------- .../types/services/InsuranceService.d.ts | 9 ++++-- .../controllers/InsuranceController.d.ts | 1 - .../types/models/spt/config/IBotConfig.d.ts | 9 +++--- .../services/BotEquipmentFilterService.d.ts | 31 ++++++++++++------- .../types/services/InsuranceService.d.ts | 9 ++++-- .../controllers/InsuranceController.d.ts | 1 - .../types/models/spt/config/IBotConfig.d.ts | 9 +++--- .../services/BotEquipmentFilterService.d.ts | 31 ++++++++++++------- .../types/services/InsuranceService.d.ts | 9 ++++-- 56 files changed, 434 insertions(+), 266 deletions(-) diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts index af45442..6895383 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts @@ -41,5 +41,4 @@ export declare class InsuranceController { * @returns response object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; - doAbsolutelyNothing(): void; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts index dff1b9b..e171087 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts @@ -114,10 +114,11 @@ export interface PmcDynamicLoot { moneyStackLimits: Record; } export interface Equipment { - blacklist: EquipmentBlacklistDetails[]; + blacklist: EquipmentFilterDetails[]; + whitelist: EquipmentFilterDetails[]; } -export interface EquipmentBlacklistDetails { +export interface EquipmentFilterDetails { levelRange: MinMax; - equipment: string[]; - cartridge: string[]; + equipment: Record; + cartridge: Record; } diff --git a/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts b/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts index 3123e46..e49645b 100644 --- a/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts @@ -1,12 +1,12 @@ import { IBotType } from "../models/eft/common/tables/IBotType"; -import { Equipment, EquipmentBlacklistDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected botEquipmentBlacklists: Record; + protected botEquipmentFilterlists: Record; constructor(logger: ILogger, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig @@ -18,24 +18,33 @@ export declare class BotEquipmentFilterService { filterBotEquipment(baseBotNode: IBotType, playerLevel: number, isPmc: boolean, role: string): void; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type - * @param isPmc Is the bot we want the blacklist for a PMC - * @param role Role of the bot we want the blacklist for + * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - protected getBotEquipmentBlacklist(isPmc: boolean, role: string, playerLevel: number): EquipmentBlacklistDetails; + protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Filter bot equipment based on blacklist from config/bot.json + * Get the whitelist for a specific bot type that's within the players level + * @param botRole Bot type + * @param playerLevel Players level + * @returns EquipmentFilterDetails object + */ + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Filter bot equipment based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** - * Filter bot cartridges based on blacklist from config/bot.json + * Filter bot cartridges based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment on this list should be excluded from the bot + * @param whitelist equipment on this list should be used exclusivly * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; } diff --git a/TypeScript/10ScopesAndTypes/types/services/InsuranceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/InsuranceService.d.ts index 472a322..171bf10 100644 --- a/TypeScript/10ScopesAndTypes/types/services/InsuranceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/InsuranceService.d.ts @@ -22,7 +22,6 @@ export declare class InsuranceService { protected dialogueHelper: DialogueHelper; protected configServer: ConfigServer; protected insured: Record>; - protected templatesById: {}; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; @@ -32,8 +31,12 @@ export declare class InsuranceService { resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - getItemPrice(_tpl: string): number; - generateTemplatesById(): void; + /** + * Get the rouble price for an item by templateId + * @param itemTpl item tpl to get handbook price for + * @returns handbook price in roubles, Return 0 if not found + */ + getItemPrice(itemTpl: string): number; /** * Sends stored insured items as message to player * @param pmcData profile to modify diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts index af45442..6895383 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts @@ -41,5 +41,4 @@ export declare class InsuranceController { * @returns response object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; - doAbsolutelyNothing(): void; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts index dff1b9b..e171087 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts @@ -114,10 +114,11 @@ export interface PmcDynamicLoot { moneyStackLimits: Record; } export interface Equipment { - blacklist: EquipmentBlacklistDetails[]; + blacklist: EquipmentFilterDetails[]; + whitelist: EquipmentFilterDetails[]; } -export interface EquipmentBlacklistDetails { +export interface EquipmentFilterDetails { levelRange: MinMax; - equipment: string[]; - cartridge: string[]; + equipment: Record; + cartridge: Record; } diff --git a/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts b/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts index 3123e46..e49645b 100644 --- a/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts @@ -1,12 +1,12 @@ import { IBotType } from "../models/eft/common/tables/IBotType"; -import { Equipment, EquipmentBlacklistDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected botEquipmentBlacklists: Record; + protected botEquipmentFilterlists: Record; constructor(logger: ILogger, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig @@ -18,24 +18,33 @@ export declare class BotEquipmentFilterService { filterBotEquipment(baseBotNode: IBotType, playerLevel: number, isPmc: boolean, role: string): void; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type - * @param isPmc Is the bot we want the blacklist for a PMC - * @param role Role of the bot we want the blacklist for + * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - protected getBotEquipmentBlacklist(isPmc: boolean, role: string, playerLevel: number): EquipmentBlacklistDetails; + protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Filter bot equipment based on blacklist from config/bot.json + * Get the whitelist for a specific bot type that's within the players level + * @param botRole Bot type + * @param playerLevel Players level + * @returns EquipmentFilterDetails object + */ + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Filter bot equipment based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** - * Filter bot cartridges based on blacklist from config/bot.json + * Filter bot cartridges based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment on this list should be excluded from the bot + * @param whitelist equipment on this list should be used exclusivly * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; } diff --git a/TypeScript/11BundleLoadingSample/types/services/InsuranceService.d.ts b/TypeScript/11BundleLoadingSample/types/services/InsuranceService.d.ts index 472a322..171bf10 100644 --- a/TypeScript/11BundleLoadingSample/types/services/InsuranceService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/InsuranceService.d.ts @@ -22,7 +22,6 @@ export declare class InsuranceService { protected dialogueHelper: DialogueHelper; protected configServer: ConfigServer; protected insured: Record>; - protected templatesById: {}; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; @@ -32,8 +31,12 @@ export declare class InsuranceService { resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - getItemPrice(_tpl: string): number; - generateTemplatesById(): void; + /** + * Get the rouble price for an item by templateId + * @param itemTpl item tpl to get handbook price for + * @returns handbook price in roubles, Return 0 if not found + */ + getItemPrice(itemTpl: string): number; /** * Sends stored insured items as message to player * @param pmcData profile to modify diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts index af45442..6895383 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts @@ -41,5 +41,4 @@ export declare class InsuranceController { * @returns response object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; - doAbsolutelyNothing(): void; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts index dff1b9b..e171087 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts @@ -114,10 +114,11 @@ export interface PmcDynamicLoot { moneyStackLimits: Record; } export interface Equipment { - blacklist: EquipmentBlacklistDetails[]; + blacklist: EquipmentFilterDetails[]; + whitelist: EquipmentFilterDetails[]; } -export interface EquipmentBlacklistDetails { +export interface EquipmentFilterDetails { levelRange: MinMax; - equipment: string[]; - cartridge: string[]; + equipment: Record; + cartridge: Record; } diff --git a/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts index 3123e46..e49645b 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts @@ -1,12 +1,12 @@ import { IBotType } from "../models/eft/common/tables/IBotType"; -import { Equipment, EquipmentBlacklistDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected botEquipmentBlacklists: Record; + protected botEquipmentFilterlists: Record; constructor(logger: ILogger, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig @@ -18,24 +18,33 @@ export declare class BotEquipmentFilterService { filterBotEquipment(baseBotNode: IBotType, playerLevel: number, isPmc: boolean, role: string): void; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type - * @param isPmc Is the bot we want the blacklist for a PMC - * @param role Role of the bot we want the blacklist for + * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - protected getBotEquipmentBlacklist(isPmc: boolean, role: string, playerLevel: number): EquipmentBlacklistDetails; + protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Filter bot equipment based on blacklist from config/bot.json + * Get the whitelist for a specific bot type that's within the players level + * @param botRole Bot type + * @param playerLevel Players level + * @returns EquipmentFilterDetails object + */ + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Filter bot equipment based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** - * Filter bot cartridges based on blacklist from config/bot.json + * Filter bot cartridges based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment on this list should be excluded from the bot + * @param whitelist equipment on this list should be used exclusivly * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; } diff --git a/TypeScript/12ClassExtensionOverride/types/services/InsuranceService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/InsuranceService.d.ts index 472a322..171bf10 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/InsuranceService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/InsuranceService.d.ts @@ -22,7 +22,6 @@ export declare class InsuranceService { protected dialogueHelper: DialogueHelper; protected configServer: ConfigServer; protected insured: Record>; - protected templatesById: {}; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; @@ -32,8 +31,12 @@ export declare class InsuranceService { resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - getItemPrice(_tpl: string): number; - generateTemplatesById(): void; + /** + * Get the rouble price for an item by templateId + * @param itemTpl item tpl to get handbook price for + * @returns handbook price in roubles, Return 0 if not found + */ + getItemPrice(itemTpl: string): number; /** * Sends stored insured items as message to player * @param pmcData profile to modify diff --git a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts index af45442..6895383 100644 --- a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts @@ -41,5 +41,4 @@ export declare class InsuranceController { * @returns response object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; - doAbsolutelyNothing(): void; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts index dff1b9b..e171087 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts @@ -114,10 +114,11 @@ export interface PmcDynamicLoot { moneyStackLimits: Record; } export interface Equipment { - blacklist: EquipmentBlacklistDetails[]; + blacklist: EquipmentFilterDetails[]; + whitelist: EquipmentFilterDetails[]; } -export interface EquipmentBlacklistDetails { +export interface EquipmentFilterDetails { levelRange: MinMax; - equipment: string[]; - cartridge: string[]; + equipment: Record; + cartridge: Record; } diff --git a/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts b/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts index 3123e46..e49645b 100644 --- a/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts @@ -1,12 +1,12 @@ import { IBotType } from "../models/eft/common/tables/IBotType"; -import { Equipment, EquipmentBlacklistDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected botEquipmentBlacklists: Record; + protected botEquipmentFilterlists: Record; constructor(logger: ILogger, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig @@ -18,24 +18,33 @@ export declare class BotEquipmentFilterService { filterBotEquipment(baseBotNode: IBotType, playerLevel: number, isPmc: boolean, role: string): void; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type - * @param isPmc Is the bot we want the blacklist for a PMC - * @param role Role of the bot we want the blacklist for + * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - protected getBotEquipmentBlacklist(isPmc: boolean, role: string, playerLevel: number): EquipmentBlacklistDetails; + protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Filter bot equipment based on blacklist from config/bot.json + * Get the whitelist for a specific bot type that's within the players level + * @param botRole Bot type + * @param playerLevel Players level + * @returns EquipmentFilterDetails object + */ + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Filter bot equipment based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** - * Filter bot cartridges based on blacklist from config/bot.json + * Filter bot cartridges based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment on this list should be excluded from the bot + * @param whitelist equipment on this list should be used exclusivly * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; } diff --git a/TypeScript/13AddTrader/types/services/InsuranceService.d.ts b/TypeScript/13AddTrader/types/services/InsuranceService.d.ts index 472a322..171bf10 100644 --- a/TypeScript/13AddTrader/types/services/InsuranceService.d.ts +++ b/TypeScript/13AddTrader/types/services/InsuranceService.d.ts @@ -22,7 +22,6 @@ export declare class InsuranceService { protected dialogueHelper: DialogueHelper; protected configServer: ConfigServer; protected insured: Record>; - protected templatesById: {}; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; @@ -32,8 +31,12 @@ export declare class InsuranceService { resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - getItemPrice(_tpl: string): number; - generateTemplatesById(): void; + /** + * Get the rouble price for an item by templateId + * @param itemTpl item tpl to get handbook price for + * @returns handbook price in roubles, Return 0 if not found + */ + getItemPrice(itemTpl: string): number; /** * Sends stored insured items as message to player * @param pmcData profile to modify diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts index af45442..6895383 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts @@ -41,5 +41,4 @@ export declare class InsuranceController { * @returns response object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; - doAbsolutelyNothing(): void; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts index dff1b9b..e171087 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -114,10 +114,11 @@ export interface PmcDynamicLoot { moneyStackLimits: Record; } export interface Equipment { - blacklist: EquipmentBlacklistDetails[]; + blacklist: EquipmentFilterDetails[]; + whitelist: EquipmentFilterDetails[]; } -export interface EquipmentBlacklistDetails { +export interface EquipmentFilterDetails { levelRange: MinMax; - equipment: string[]; - cartridge: string[]; + equipment: Record; + cartridge: Record; } diff --git a/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts index 3123e46..e49645b 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts @@ -1,12 +1,12 @@ import { IBotType } from "../models/eft/common/tables/IBotType"; -import { Equipment, EquipmentBlacklistDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected botEquipmentBlacklists: Record; + protected botEquipmentFilterlists: Record; constructor(logger: ILogger, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig @@ -18,24 +18,33 @@ export declare class BotEquipmentFilterService { filterBotEquipment(baseBotNode: IBotType, playerLevel: number, isPmc: boolean, role: string): void; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type - * @param isPmc Is the bot we want the blacklist for a PMC - * @param role Role of the bot we want the blacklist for + * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - protected getBotEquipmentBlacklist(isPmc: boolean, role: string, playerLevel: number): EquipmentBlacklistDetails; + protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Filter bot equipment based on blacklist from config/bot.json + * Get the whitelist for a specific bot type that's within the players level + * @param botRole Bot type + * @param playerLevel Players level + * @returns EquipmentFilterDetails object + */ + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Filter bot equipment based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** - * Filter bot cartridges based on blacklist from config/bot.json + * Filter bot cartridges based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment on this list should be excluded from the bot + * @param whitelist equipment on this list should be used exclusivly * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; } diff --git a/TypeScript/14AfterDBLoadHook/types/services/InsuranceService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/InsuranceService.d.ts index 472a322..171bf10 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/InsuranceService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/InsuranceService.d.ts @@ -22,7 +22,6 @@ export declare class InsuranceService { protected dialogueHelper: DialogueHelper; protected configServer: ConfigServer; protected insured: Record>; - protected templatesById: {}; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; @@ -32,8 +31,12 @@ export declare class InsuranceService { resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - getItemPrice(_tpl: string): number; - generateTemplatesById(): void; + /** + * Get the rouble price for an item by templateId + * @param itemTpl item tpl to get handbook price for + * @returns handbook price in roubles, Return 0 if not found + */ + getItemPrice(itemTpl: string): number; /** * Sends stored insured items as message to player * @param pmcData profile to modify diff --git a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts index af45442..6895383 100644 --- a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts @@ -41,5 +41,4 @@ export declare class InsuranceController { * @returns response object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; - doAbsolutelyNothing(): void; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts index dff1b9b..e171087 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts @@ -114,10 +114,11 @@ export interface PmcDynamicLoot { moneyStackLimits: Record; } export interface Equipment { - blacklist: EquipmentBlacklistDetails[]; + blacklist: EquipmentFilterDetails[]; + whitelist: EquipmentFilterDetails[]; } -export interface EquipmentBlacklistDetails { +export interface EquipmentFilterDetails { levelRange: MinMax; - equipment: string[]; - cartridge: string[]; + equipment: Record; + cartridge: Record; } diff --git a/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts b/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts index 3123e46..e49645b 100644 --- a/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts @@ -1,12 +1,12 @@ import { IBotType } from "../models/eft/common/tables/IBotType"; -import { Equipment, EquipmentBlacklistDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected botEquipmentBlacklists: Record; + protected botEquipmentFilterlists: Record; constructor(logger: ILogger, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig @@ -18,24 +18,33 @@ export declare class BotEquipmentFilterService { filterBotEquipment(baseBotNode: IBotType, playerLevel: number, isPmc: boolean, role: string): void; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type - * @param isPmc Is the bot we want the blacklist for a PMC - * @param role Role of the bot we want the blacklist for + * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - protected getBotEquipmentBlacklist(isPmc: boolean, role: string, playerLevel: number): EquipmentBlacklistDetails; + protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Filter bot equipment based on blacklist from config/bot.json + * Get the whitelist for a specific bot type that's within the players level + * @param botRole Bot type + * @param playerLevel Players level + * @returns EquipmentFilterDetails object + */ + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Filter bot equipment based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** - * Filter bot cartridges based on blacklist from config/bot.json + * Filter bot cartridges based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment on this list should be excluded from the bot + * @param whitelist equipment on this list should be used exclusivly * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; } diff --git a/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts b/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts index 472a322..171bf10 100644 --- a/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts @@ -22,7 +22,6 @@ export declare class InsuranceService { protected dialogueHelper: DialogueHelper; protected configServer: ConfigServer; protected insured: Record>; - protected templatesById: {}; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; @@ -32,8 +31,12 @@ export declare class InsuranceService { resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - getItemPrice(_tpl: string): number; - generateTemplatesById(): void; + /** + * Get the rouble price for an item by templateId + * @param itemTpl item tpl to get handbook price for + * @returns handbook price in roubles, Return 0 if not found + */ + getItemPrice(itemTpl: string): number; /** * Sends stored insured items as message to player * @param pmcData profile to modify diff --git a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts index af45442..6895383 100644 --- a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts @@ -41,5 +41,4 @@ export declare class InsuranceController { * @returns response object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; - doAbsolutelyNothing(): void; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts index dff1b9b..e171087 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts @@ -114,10 +114,11 @@ export interface PmcDynamicLoot { moneyStackLimits: Record; } export interface Equipment { - blacklist: EquipmentBlacklistDetails[]; + blacklist: EquipmentFilterDetails[]; + whitelist: EquipmentFilterDetails[]; } -export interface EquipmentBlacklistDetails { +export interface EquipmentFilterDetails { levelRange: MinMax; - equipment: string[]; - cartridge: string[]; + equipment: Record; + cartridge: Record; } diff --git a/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts b/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts index 3123e46..e49645b 100644 --- a/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts @@ -1,12 +1,12 @@ import { IBotType } from "../models/eft/common/tables/IBotType"; -import { Equipment, EquipmentBlacklistDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected botEquipmentBlacklists: Record; + protected botEquipmentFilterlists: Record; constructor(logger: ILogger, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig @@ -18,24 +18,33 @@ export declare class BotEquipmentFilterService { filterBotEquipment(baseBotNode: IBotType, playerLevel: number, isPmc: boolean, role: string): void; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type - * @param isPmc Is the bot we want the blacklist for a PMC - * @param role Role of the bot we want the blacklist for + * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - protected getBotEquipmentBlacklist(isPmc: boolean, role: string, playerLevel: number): EquipmentBlacklistDetails; + protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Filter bot equipment based on blacklist from config/bot.json + * Get the whitelist for a specific bot type that's within the players level + * @param botRole Bot type + * @param playerLevel Players level + * @returns EquipmentFilterDetails object + */ + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Filter bot equipment based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** - * Filter bot cartridges based on blacklist from config/bot.json + * Filter bot cartridges based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment on this list should be excluded from the bot + * @param whitelist equipment on this list should be used exclusivly * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; } diff --git a/TypeScript/2EditDatabase/types/services/InsuranceService.d.ts b/TypeScript/2EditDatabase/types/services/InsuranceService.d.ts index 472a322..171bf10 100644 --- a/TypeScript/2EditDatabase/types/services/InsuranceService.d.ts +++ b/TypeScript/2EditDatabase/types/services/InsuranceService.d.ts @@ -22,7 +22,6 @@ export declare class InsuranceService { protected dialogueHelper: DialogueHelper; protected configServer: ConfigServer; protected insured: Record>; - protected templatesById: {}; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; @@ -32,8 +31,12 @@ export declare class InsuranceService { resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - getItemPrice(_tpl: string): number; - generateTemplatesById(): void; + /** + * Get the rouble price for an item by templateId + * @param itemTpl item tpl to get handbook price for + * @returns handbook price in roubles, Return 0 if not found + */ + getItemPrice(itemTpl: string): number; /** * Sends stored insured items as message to player * @param pmcData profile to modify diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts index af45442..6895383 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts @@ -41,5 +41,4 @@ export declare class InsuranceController { * @returns response object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; - doAbsolutelyNothing(): void; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts index dff1b9b..e171087 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -114,10 +114,11 @@ export interface PmcDynamicLoot { moneyStackLimits: Record; } export interface Equipment { - blacklist: EquipmentBlacklistDetails[]; + blacklist: EquipmentFilterDetails[]; + whitelist: EquipmentFilterDetails[]; } -export interface EquipmentBlacklistDetails { +export interface EquipmentFilterDetails { levelRange: MinMax; - equipment: string[]; - cartridge: string[]; + equipment: Record; + cartridge: Record; } diff --git a/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts b/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts index 3123e46..e49645b 100644 --- a/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts @@ -1,12 +1,12 @@ import { IBotType } from "../models/eft/common/tables/IBotType"; -import { Equipment, EquipmentBlacklistDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected botEquipmentBlacklists: Record; + protected botEquipmentFilterlists: Record; constructor(logger: ILogger, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig @@ -18,24 +18,33 @@ export declare class BotEquipmentFilterService { filterBotEquipment(baseBotNode: IBotType, playerLevel: number, isPmc: boolean, role: string): void; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type - * @param isPmc Is the bot we want the blacklist for a PMC - * @param role Role of the bot we want the blacklist for + * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - protected getBotEquipmentBlacklist(isPmc: boolean, role: string, playerLevel: number): EquipmentBlacklistDetails; + protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Filter bot equipment based on blacklist from config/bot.json + * Get the whitelist for a specific bot type that's within the players level + * @param botRole Bot type + * @param playerLevel Players level + * @returns EquipmentFilterDetails object + */ + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Filter bot equipment based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** - * Filter bot cartridges based on blacklist from config/bot.json + * Filter bot cartridges based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment on this list should be excluded from the bot + * @param whitelist equipment on this list should be used exclusivly * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; } diff --git a/TypeScript/3GetSptConfigFile/types/services/InsuranceService.d.ts b/TypeScript/3GetSptConfigFile/types/services/InsuranceService.d.ts index 472a322..171bf10 100644 --- a/TypeScript/3GetSptConfigFile/types/services/InsuranceService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/InsuranceService.d.ts @@ -22,7 +22,6 @@ export declare class InsuranceService { protected dialogueHelper: DialogueHelper; protected configServer: ConfigServer; protected insured: Record>; - protected templatesById: {}; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; @@ -32,8 +31,12 @@ export declare class InsuranceService { resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - getItemPrice(_tpl: string): number; - generateTemplatesById(): void; + /** + * Get the rouble price for an item by templateId + * @param itemTpl item tpl to get handbook price for + * @returns handbook price in roubles, Return 0 if not found + */ + getItemPrice(itemTpl: string): number; /** * Sends stored insured items as message to player * @param pmcData profile to modify diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts index af45442..6895383 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts @@ -41,5 +41,4 @@ export declare class InsuranceController { * @returns response object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; - doAbsolutelyNothing(): void; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts index dff1b9b..e171087 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -114,10 +114,11 @@ export interface PmcDynamicLoot { moneyStackLimits: Record; } export interface Equipment { - blacklist: EquipmentBlacklistDetails[]; + blacklist: EquipmentFilterDetails[]; + whitelist: EquipmentFilterDetails[]; } -export interface EquipmentBlacklistDetails { +export interface EquipmentFilterDetails { levelRange: MinMax; - equipment: string[]; - cartridge: string[]; + equipment: Record; + cartridge: Record; } diff --git a/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts index 3123e46..e49645b 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts @@ -1,12 +1,12 @@ import { IBotType } from "../models/eft/common/tables/IBotType"; -import { Equipment, EquipmentBlacklistDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected botEquipmentBlacklists: Record; + protected botEquipmentFilterlists: Record; constructor(logger: ILogger, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig @@ -18,24 +18,33 @@ export declare class BotEquipmentFilterService { filterBotEquipment(baseBotNode: IBotType, playerLevel: number, isPmc: boolean, role: string): void; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type - * @param isPmc Is the bot we want the blacklist for a PMC - * @param role Role of the bot we want the blacklist for + * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - protected getBotEquipmentBlacklist(isPmc: boolean, role: string, playerLevel: number): EquipmentBlacklistDetails; + protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Filter bot equipment based on blacklist from config/bot.json + * Get the whitelist for a specific bot type that's within the players level + * @param botRole Bot type + * @param playerLevel Players level + * @returns EquipmentFilterDetails object + */ + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Filter bot equipment based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** - * Filter bot cartridges based on blacklist from config/bot.json + * Filter bot cartridges based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment on this list should be excluded from the bot + * @param whitelist equipment on this list should be used exclusivly * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; } diff --git a/TypeScript/4UseACustomConfigFile/types/services/InsuranceService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/InsuranceService.d.ts index 472a322..171bf10 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/InsuranceService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/InsuranceService.d.ts @@ -22,7 +22,6 @@ export declare class InsuranceService { protected dialogueHelper: DialogueHelper; protected configServer: ConfigServer; protected insured: Record>; - protected templatesById: {}; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; @@ -32,8 +31,12 @@ export declare class InsuranceService { resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - getItemPrice(_tpl: string): number; - generateTemplatesById(): void; + /** + * Get the rouble price for an item by templateId + * @param itemTpl item tpl to get handbook price for + * @returns handbook price in roubles, Return 0 if not found + */ + getItemPrice(itemTpl: string): number; /** * Sends stored insured items as message to player * @param pmcData profile to modify diff --git a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts index af45442..6895383 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts @@ -41,5 +41,4 @@ export declare class InsuranceController { * @returns response object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; - doAbsolutelyNothing(): void; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts index dff1b9b..e171087 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts @@ -114,10 +114,11 @@ export interface PmcDynamicLoot { moneyStackLimits: Record; } export interface Equipment { - blacklist: EquipmentBlacklistDetails[]; + blacklist: EquipmentFilterDetails[]; + whitelist: EquipmentFilterDetails[]; } -export interface EquipmentBlacklistDetails { +export interface EquipmentFilterDetails { levelRange: MinMax; - equipment: string[]; - cartridge: string[]; + equipment: Record; + cartridge: Record; } diff --git a/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts b/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts index 3123e46..e49645b 100644 --- a/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts @@ -1,12 +1,12 @@ import { IBotType } from "../models/eft/common/tables/IBotType"; -import { Equipment, EquipmentBlacklistDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected botEquipmentBlacklists: Record; + protected botEquipmentFilterlists: Record; constructor(logger: ILogger, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig @@ -18,24 +18,33 @@ export declare class BotEquipmentFilterService { filterBotEquipment(baseBotNode: IBotType, playerLevel: number, isPmc: boolean, role: string): void; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type - * @param isPmc Is the bot we want the blacklist for a PMC - * @param role Role of the bot we want the blacklist for + * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - protected getBotEquipmentBlacklist(isPmc: boolean, role: string, playerLevel: number): EquipmentBlacklistDetails; + protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Filter bot equipment based on blacklist from config/bot.json + * Get the whitelist for a specific bot type that's within the players level + * @param botRole Bot type + * @param playerLevel Players level + * @returns EquipmentFilterDetails object + */ + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Filter bot equipment based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** - * Filter bot cartridges based on blacklist from config/bot.json + * Filter bot cartridges based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment on this list should be excluded from the bot + * @param whitelist equipment on this list should be used exclusivly * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; } diff --git a/TypeScript/5ReplaceMethod/types/services/InsuranceService.d.ts b/TypeScript/5ReplaceMethod/types/services/InsuranceService.d.ts index 472a322..171bf10 100644 --- a/TypeScript/5ReplaceMethod/types/services/InsuranceService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/InsuranceService.d.ts @@ -22,7 +22,6 @@ export declare class InsuranceService { protected dialogueHelper: DialogueHelper; protected configServer: ConfigServer; protected insured: Record>; - protected templatesById: {}; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; @@ -32,8 +31,12 @@ export declare class InsuranceService { resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - getItemPrice(_tpl: string): number; - generateTemplatesById(): void; + /** + * Get the rouble price for an item by templateId + * @param itemTpl item tpl to get handbook price for + * @returns handbook price in roubles, Return 0 if not found + */ + getItemPrice(itemTpl: string): number; /** * Sends stored insured items as message to player * @param pmcData profile to modify diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts index af45442..6895383 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts @@ -41,5 +41,4 @@ export declare class InsuranceController { * @returns response object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; - doAbsolutelyNothing(): void; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts index dff1b9b..e171087 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts @@ -114,10 +114,11 @@ export interface PmcDynamicLoot { moneyStackLimits: Record; } export interface Equipment { - blacklist: EquipmentBlacklistDetails[]; + blacklist: EquipmentFilterDetails[]; + whitelist: EquipmentFilterDetails[]; } -export interface EquipmentBlacklistDetails { +export interface EquipmentFilterDetails { levelRange: MinMax; - equipment: string[]; - cartridge: string[]; + equipment: Record; + cartridge: Record; } diff --git a/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts index 3123e46..e49645b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts @@ -1,12 +1,12 @@ import { IBotType } from "../models/eft/common/tables/IBotType"; -import { Equipment, EquipmentBlacklistDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected botEquipmentBlacklists: Record; + protected botEquipmentFilterlists: Record; constructor(logger: ILogger, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig @@ -18,24 +18,33 @@ export declare class BotEquipmentFilterService { filterBotEquipment(baseBotNode: IBotType, playerLevel: number, isPmc: boolean, role: string): void; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type - * @param isPmc Is the bot we want the blacklist for a PMC - * @param role Role of the bot we want the blacklist for + * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - protected getBotEquipmentBlacklist(isPmc: boolean, role: string, playerLevel: number): EquipmentBlacklistDetails; + protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Filter bot equipment based on blacklist from config/bot.json + * Get the whitelist for a specific bot type that's within the players level + * @param botRole Bot type + * @param playerLevel Players level + * @returns EquipmentFilterDetails object + */ + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Filter bot equipment based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** - * Filter bot cartridges based on blacklist from config/bot.json + * Filter bot cartridges based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment on this list should be excluded from the bot + * @param whitelist equipment on this list should be used exclusivly * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; } diff --git a/TypeScript/6ReferenceAnotherClass/types/services/InsuranceService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/InsuranceService.d.ts index 472a322..171bf10 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/InsuranceService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/InsuranceService.d.ts @@ -22,7 +22,6 @@ export declare class InsuranceService { protected dialogueHelper: DialogueHelper; protected configServer: ConfigServer; protected insured: Record>; - protected templatesById: {}; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; @@ -32,8 +31,12 @@ export declare class InsuranceService { resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - getItemPrice(_tpl: string): number; - generateTemplatesById(): void; + /** + * Get the rouble price for an item by templateId + * @param itemTpl item tpl to get handbook price for + * @returns handbook price in roubles, Return 0 if not found + */ + getItemPrice(itemTpl: string): number; /** * Sends stored insured items as message to player * @param pmcData profile to modify diff --git a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts index af45442..6895383 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts @@ -41,5 +41,4 @@ export declare class InsuranceController { * @returns response object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; - doAbsolutelyNothing(): void; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts index dff1b9b..e171087 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -114,10 +114,11 @@ export interface PmcDynamicLoot { moneyStackLimits: Record; } export interface Equipment { - blacklist: EquipmentBlacklistDetails[]; + blacklist: EquipmentFilterDetails[]; + whitelist: EquipmentFilterDetails[]; } -export interface EquipmentBlacklistDetails { +export interface EquipmentFilterDetails { levelRange: MinMax; - equipment: string[]; - cartridge: string[]; + equipment: Record; + cartridge: Record; } diff --git a/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts b/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts index 3123e46..e49645b 100644 --- a/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts @@ -1,12 +1,12 @@ import { IBotType } from "../models/eft/common/tables/IBotType"; -import { Equipment, EquipmentBlacklistDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected botEquipmentBlacklists: Record; + protected botEquipmentFilterlists: Record; constructor(logger: ILogger, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig @@ -18,24 +18,33 @@ export declare class BotEquipmentFilterService { filterBotEquipment(baseBotNode: IBotType, playerLevel: number, isPmc: boolean, role: string): void; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type - * @param isPmc Is the bot we want the blacklist for a PMC - * @param role Role of the bot we want the blacklist for + * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - protected getBotEquipmentBlacklist(isPmc: boolean, role: string, playerLevel: number): EquipmentBlacklistDetails; + protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Filter bot equipment based on blacklist from config/bot.json + * Get the whitelist for a specific bot type that's within the players level + * @param botRole Bot type + * @param playerLevel Players level + * @returns EquipmentFilterDetails object + */ + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Filter bot equipment based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** - * Filter bot cartridges based on blacklist from config/bot.json + * Filter bot cartridges based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment on this list should be excluded from the bot + * @param whitelist equipment on this list should be used exclusivly * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; } diff --git a/TypeScript/7OnLoadHook/types/services/InsuranceService.d.ts b/TypeScript/7OnLoadHook/types/services/InsuranceService.d.ts index 472a322..171bf10 100644 --- a/TypeScript/7OnLoadHook/types/services/InsuranceService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/InsuranceService.d.ts @@ -22,7 +22,6 @@ export declare class InsuranceService { protected dialogueHelper: DialogueHelper; protected configServer: ConfigServer; protected insured: Record>; - protected templatesById: {}; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; @@ -32,8 +31,12 @@ export declare class InsuranceService { resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - getItemPrice(_tpl: string): number; - generateTemplatesById(): void; + /** + * Get the rouble price for an item by templateId + * @param itemTpl item tpl to get handbook price for + * @returns handbook price in roubles, Return 0 if not found + */ + getItemPrice(itemTpl: string): number; /** * Sends stored insured items as message to player * @param pmcData profile to modify diff --git a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts index af45442..6895383 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts @@ -41,5 +41,4 @@ export declare class InsuranceController { * @returns response object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; - doAbsolutelyNothing(): void; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts index dff1b9b..e171087 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts @@ -114,10 +114,11 @@ export interface PmcDynamicLoot { moneyStackLimits: Record; } export interface Equipment { - blacklist: EquipmentBlacklistDetails[]; + blacklist: EquipmentFilterDetails[]; + whitelist: EquipmentFilterDetails[]; } -export interface EquipmentBlacklistDetails { +export interface EquipmentFilterDetails { levelRange: MinMax; - equipment: string[]; - cartridge: string[]; + equipment: Record; + cartridge: Record; } diff --git a/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts b/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts index 3123e46..e49645b 100644 --- a/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts @@ -1,12 +1,12 @@ import { IBotType } from "../models/eft/common/tables/IBotType"; -import { Equipment, EquipmentBlacklistDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected botEquipmentBlacklists: Record; + protected botEquipmentFilterlists: Record; constructor(logger: ILogger, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig @@ -18,24 +18,33 @@ export declare class BotEquipmentFilterService { filterBotEquipment(baseBotNode: IBotType, playerLevel: number, isPmc: boolean, role: string): void; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type - * @param isPmc Is the bot we want the blacklist for a PMC - * @param role Role of the bot we want the blacklist for + * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - protected getBotEquipmentBlacklist(isPmc: boolean, role: string, playerLevel: number): EquipmentBlacklistDetails; + protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Filter bot equipment based on blacklist from config/bot.json + * Get the whitelist for a specific bot type that's within the players level + * @param botRole Bot type + * @param playerLevel Players level + * @returns EquipmentFilterDetails object + */ + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Filter bot equipment based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** - * Filter bot cartridges based on blacklist from config/bot.json + * Filter bot cartridges based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment on this list should be excluded from the bot + * @param whitelist equipment on this list should be used exclusivly * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; } diff --git a/TypeScript/8OnUpdateHook/types/services/InsuranceService.d.ts b/TypeScript/8OnUpdateHook/types/services/InsuranceService.d.ts index 472a322..171bf10 100644 --- a/TypeScript/8OnUpdateHook/types/services/InsuranceService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/InsuranceService.d.ts @@ -22,7 +22,6 @@ export declare class InsuranceService { protected dialogueHelper: DialogueHelper; protected configServer: ConfigServer; protected insured: Record>; - protected templatesById: {}; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; @@ -32,8 +31,12 @@ export declare class InsuranceService { resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - getItemPrice(_tpl: string): number; - generateTemplatesById(): void; + /** + * Get the rouble price for an item by templateId + * @param itemTpl item tpl to get handbook price for + * @returns handbook price in roubles, Return 0 if not found + */ + getItemPrice(itemTpl: string): number; /** * Sends stored insured items as message to player * @param pmcData profile to modify diff --git a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts index af45442..6895383 100644 --- a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts @@ -41,5 +41,4 @@ export declare class InsuranceController { * @returns response object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; - doAbsolutelyNothing(): void; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts index dff1b9b..e171087 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts @@ -114,10 +114,11 @@ export interface PmcDynamicLoot { moneyStackLimits: Record; } export interface Equipment { - blacklist: EquipmentBlacklistDetails[]; + blacklist: EquipmentFilterDetails[]; + whitelist: EquipmentFilterDetails[]; } -export interface EquipmentBlacklistDetails { +export interface EquipmentFilterDetails { levelRange: MinMax; - equipment: string[]; - cartridge: string[]; + equipment: Record; + cartridge: Record; } diff --git a/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts b/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts index 3123e46..e49645b 100644 --- a/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts @@ -1,12 +1,12 @@ import { IBotType } from "../models/eft/common/tables/IBotType"; -import { Equipment, EquipmentBlacklistDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected botEquipmentBlacklists: Record; + protected botEquipmentFilterlists: Record; constructor(logger: ILogger, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig @@ -18,24 +18,33 @@ export declare class BotEquipmentFilterService { filterBotEquipment(baseBotNode: IBotType, playerLevel: number, isPmc: boolean, role: string): void; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type - * @param isPmc Is the bot we want the blacklist for a PMC - * @param role Role of the bot we want the blacklist for + * @param botRole Role of the bot we want the blacklist for * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - protected getBotEquipmentBlacklist(isPmc: boolean, role: string, playerLevel: number): EquipmentBlacklistDetails; + protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Filter bot equipment based on blacklist from config/bot.json + * Get the whitelist for a specific bot type that's within the players level + * @param botRole Bot type + * @param playerLevel Players level + * @returns EquipmentFilterDetails object + */ + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Filter bot equipment based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** - * Filter bot cartridges based on blacklist from config/bot.json + * Filter bot cartridges based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update - * @param equipmentBlacklist equipment blacklist + * @param blacklist equipment on this list should be excluded from the bot + * @param whitelist equipment on this list should be used exclusivly * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, equipmentBlacklist: EquipmentBlacklistDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; } diff --git a/TypeScript/9RouterHooks/types/services/InsuranceService.d.ts b/TypeScript/9RouterHooks/types/services/InsuranceService.d.ts index 472a322..171bf10 100644 --- a/TypeScript/9RouterHooks/types/services/InsuranceService.d.ts +++ b/TypeScript/9RouterHooks/types/services/InsuranceService.d.ts @@ -22,7 +22,6 @@ export declare class InsuranceService { protected dialogueHelper: DialogueHelper; protected configServer: ConfigServer; protected insured: Record>; - protected templatesById: {}; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; @@ -32,8 +31,12 @@ export declare class InsuranceService { resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - getItemPrice(_tpl: string): number; - generateTemplatesById(): void; + /** + * Get the rouble price for an item by templateId + * @param itemTpl item tpl to get handbook price for + * @returns handbook price in roubles, Return 0 if not found + */ + getItemPrice(itemTpl: string): number; /** * Sends stored insured items as message to player * @param pmcData profile to modify -- 2.47.1