Update types to match server changes
This commit is contained in:
parent
f200c11869
commit
10072a9c04
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an
|
|||||||
|
|
||||||
## **NodeJS Setup**
|
## **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.
|
After installation, it's advised to reboot your system.
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,12 @@ export declare class HttpServer {
|
|||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): 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<string, string>;
|
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||||
isStarted(): boolean;
|
isStarted(): boolean;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ export declare class BotLootCacheService {
|
|||||||
protected isGrenade(props: Props): boolean;
|
protected isGrenade(props: Props): boolean;
|
||||||
protected isFood(tpl: string): boolean;
|
protected isFood(tpl: string): boolean;
|
||||||
protected isDrink(tpl: string): boolean;
|
protected isDrink(tpl: string): boolean;
|
||||||
|
protected isCurrency(tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Check if a bot type exists inside the loot cache
|
* Check if a bot type exists inside the loot cache
|
||||||
* @param botRole role to check for
|
* @param botRole role to check for
|
||||||
|
@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad {
|
|||||||
/**
|
/**
|
||||||
* Create a dictionary and store prices from prices.json in it
|
* 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.
|
* Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||||
* if no static value, return 1
|
* if no static value, return 1
|
||||||
|
@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
|||||||
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
import { PaymentService } from "@spt-aki/services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
@ -38,10 +39,11 @@ export declare class InsuranceController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected mailSendService: MailSendService;
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
protected roubleTpl: string;
|
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.
|
* 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<string>): void;
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): 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.
|
* @param attachments The array of attachments items.
|
||||||
* @returns An array of items enriched with their max price and common locale-name.
|
* @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 {
|
interface EnrichedItem extends Item {
|
||||||
name: string;
|
name: string;
|
||||||
maxPrice: number;
|
dynamicPrice: number;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
@ -111,6 +111,7 @@ export interface GenerationWeightingItems {
|
|||||||
drugs: GenerationData;
|
drugs: GenerationData;
|
||||||
food: GenerationData;
|
food: GenerationData;
|
||||||
drink: GenerationData;
|
drink: GenerationData;
|
||||||
|
currency: GenerationData;
|
||||||
stims: GenerationData;
|
stims: GenerationData;
|
||||||
backpackLoot: GenerationData;
|
backpackLoot: GenerationData;
|
||||||
pocketLoot: GenerationData;
|
pocketLoot: GenerationData;
|
||||||
|
@ -9,6 +9,7 @@ export interface IBotLootCache {
|
|||||||
drugItems: Record<string, number>;
|
drugItems: Record<string, number>;
|
||||||
foodItems: Record<string, number>;
|
foodItems: Record<string, number>;
|
||||||
drinkItems: Record<string, number>;
|
drinkItems: Record<string, number>;
|
||||||
|
currencyItems: Record<string, number>;
|
||||||
stimItems: Record<string, number>;
|
stimItems: Record<string, number>;
|
||||||
grenadeItems: Record<string, number>;
|
grenadeItems: Record<string, number>;
|
||||||
}
|
}
|
||||||
@ -24,5 +25,6 @@ export declare enum LootCacheType {
|
|||||||
STIM_ITEMS = "StimItems",
|
STIM_ITEMS = "StimItems",
|
||||||
GRENADE_ITEMS = "GrenadeItems",
|
GRENADE_ITEMS = "GrenadeItems",
|
||||||
FOOD_ITEMS = "FoodItems",
|
FOOD_ITEMS = "FoodItems",
|
||||||
DRINK_ITEMS = "DrinkItems"
|
DRINK_ITEMS = "DrinkItems",
|
||||||
|
CURRENCY_ITEMS = "CurrencyItems"
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user