diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts b/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts +++ b/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts b/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts b/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts +++ b/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts b/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts b/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts b/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/13AddTrader/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/13AddTrader/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/13AddTrader/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/13AddTrader/types/servers/HttpServer.d.ts b/TypeScript/13AddTrader/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/13AddTrader/types/servers/HttpServer.d.ts +++ b/TypeScript/13AddTrader/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts b/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts +++ b/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts b/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts +++ b/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts b/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts b/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts +++ b/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts b/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts b/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts b/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/16ImporterUtil/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/16ImporterUtil/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts b/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts +++ b/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts b/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts b/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts b/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/18CustomItemService/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/18CustomItemService/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/18CustomItemService/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts b/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts +++ b/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts b/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts +++ b/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts b/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts +++ b/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts b/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts +++ b/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts b/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts b/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/1LogToConsole/README.md b/TypeScript/1LogToConsole/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/1LogToConsole/README.md +++ b/TypeScript/1LogToConsole/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/1LogToConsole/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/1LogToConsole/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/1LogToConsole/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts b/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts +++ b/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts b/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts +++ b/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts b/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts b/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/20CustomChatBot/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/20CustomChatBot/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts b/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts +++ b/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts b/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts b/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts b/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts b/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts +++ b/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts b/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts b/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/2EditDatabase/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/2EditDatabase/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/2EditDatabase/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts b/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts +++ b/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts b/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts +++ b/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts b/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts +++ b/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts b/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts +++ b/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts b/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts b/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts b/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts +++ b/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts b/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts b/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts b/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/7OnLoadHook/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/7OnLoadHook/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts b/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts +++ b/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts b/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts b/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts b/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts +++ b/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts b/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts b/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 diff --git a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts index 185fab9..2a00af9 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts @@ -111,6 +111,7 @@ export interface GenerationWeightingItems { drugs: GenerationData; food: GenerationData; drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/9RouterHooks/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/9RouterHooks/types/models/spt/bots/IBotLootCache.d.ts index 29355e5..529c2cd 100644 --- a/TypeScript/9RouterHooks/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/bots/IBotLootCache.d.ts @@ -9,6 +9,7 @@ export interface IBotLootCache { drugItems: Record; foodItems: Record; drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -24,5 +25,6 @@ export declare enum LootCacheType { STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", FOOD_ITEMS = "FoodItems", - DRINK_ITEMS = "DrinkItems" + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts b/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts index ac356b2..bcd740f 100644 --- a/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts +++ b/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts @@ -26,6 +26,12 @@ export declare class HttpServer { */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; isStarted(): boolean; } diff --git a/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts b/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts index 83097b6..7f79bfe 100644 --- a/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts +++ b/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts @@ -71,6 +71,7 @@ export declare class BotLootCacheService { protected isGrenade(props: Props): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts b/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts index eb01a16..0fefdd8 100644 --- a/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts +++ b/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1