Update example types for 3.4.0

This commit is contained in:
Chomp 2022-12-18 12:22:32 +00:00
parent 2457e0794d
commit b6d46dd62a
41 changed files with 294 additions and 80 deletions

View File

@ -1,6 +1,7 @@
import { DialogueController } from "../controllers/DialogueController"; import { DialogueController } from "../controllers/DialogueController";
import { OnUpdate } from "../di/OnUpdate"; import { OnUpdate } from "../di/OnUpdate";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IChatServer } from "../models/eft/dialog/IChatServer";
import { IFriendRequestData } from "../models/eft/dialog/IFriendRequestData"; import { IFriendRequestData } from "../models/eft/dialog/IFriendRequestData";
import { IGetAllAttachmentsRequestData } from "../models/eft/dialog/IGetAllAttachmentsRequestData"; import { IGetAllAttachmentsRequestData } from "../models/eft/dialog/IGetAllAttachmentsRequestData";
import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse";
@ -35,7 +36,7 @@ export declare class DialogueCallbacks extends OnUpdate {
* Handles client/chatServer/list * Handles client/chatServer/list
* @returns * @returns
*/ */
getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData<any[]>; getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData<IChatServer[]>;
getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo[]>; getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo[]>;
getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData<IGetMailDialogViewResponseData>; getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData<IGetMailDialogViewResponseData>;
getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo>; getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo>;

View File

@ -27,6 +27,7 @@ export declare class DialogueController {
*/ */
getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo; getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo;
/** /**
* Handle player clicking 'messenger' and seeing all the messages they've recieved
* Set the content of the dialogue on the details panel, showing all the messages * Set the content of the dialogue on the details panel, showing all the messages
* for the specified dialogue. * for the specified dialogue.
* @param dialogueID Dialog id * @param dialogueID Dialog id

View File

@ -1,7 +1,9 @@
import { ApplicationContext } from "../context/ApplicationContext"; import { ApplicationContext } from "../context/ApplicationContext";
import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { HttpServerHelper } from "../helpers/HttpServerHelper";
import { ProfileHelper } from "../helpers/ProfileHelper"; import { ProfileHelper } from "../helpers/ProfileHelper";
import { PreAkiModLoader } from "../loaders/PreAkiModLoader";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IPmcData } from "../models/eft/common/IPmcData";
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IServerDetails } from "../models/eft/game/IServerDetails";
@ -17,6 +19,7 @@ import { SeasonalEventService } from "../services/SeasonalEventService";
export declare class GameController { export declare class GameController {
protected logger: ILogger; protected logger: ILogger;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected preAkiModLoader: PreAkiModLoader;
protected httpServerHelper: HttpServerHelper; protected httpServerHelper: HttpServerHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected profileFixerService: ProfileFixerService; protected profileFixerService: ProfileFixerService;
@ -26,8 +29,18 @@ export declare class GameController {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected httpConfig: IHttpConfig; protected httpConfig: IHttpConfig;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer);
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
/**
* Get a list of installed mods and save their details to the profile being used
* @param fullProfile Profile to add mod details to
*/
protected saveActiveModsToProfile(fullProfile: IAkiProfile): void;
/**
* Add the logged in players name to PMC name pool
* @param pmcProfile
*/
protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
/** /**
* Blank out the "test" mail message from prapor * Blank out the "test" mail message from prapor
*/ */

View File

@ -18,10 +18,12 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { LocaleService } from "../services/LocaleService"; import { LocaleService } from "../services/LocaleService";
import { LocalisationService } from "../services/LocalisationService"; import { LocalisationService } from "../services/LocalisationService";
import { PlayerService } from "../services/PlayerService"; import { PlayerService } from "../services/PlayerService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class QuestController { export declare class QuestController {
protected logger: ILogger; protected logger: ILogger;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected httpResponseUtil: HttpResponseUtil;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
@ -34,7 +36,7 @@ export declare class QuestController {
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer);
/** /**
* Get all quests visible to player * Get all quests visible to player
* Exclude quests with incomplete preconditions (level/loyalty) * Exclude quests with incomplete preconditions (level/loyalty)
@ -58,6 +60,22 @@ export declare class QuestController {
* @returns client response * @returns client response
*/ */
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead
* @param startedMessageTextId startedMessageText property from IQuest
* @param questDescriptionId description property from IQuest
* @returns message id
*/
protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string;
/**
* Handle the client accepting a repeatable quest and starting it
* Send starting rewards if any to player and
* Send start notification if any to player
* @param pmcData Profile to update with new quest
* @param acceptedQuest Quest being accepted
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Look for an accepted quest inside player profile, return matching * Look for an accepted quest inside player profile, return matching

View File

@ -100,8 +100,9 @@ export declare class RagfairController {
/** /**
* Update a trader flea offer with buy restrictions stored in the traders assort * Update a trader flea offer with buy restrictions stored in the traders assort
* @param offer flea offer to update * @param offer flea offer to update
* @param profile full profile of player
*/ */
protected setTraderOfferPurchaseLimits(offer: IRagfairOffer): void; protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, profile: IAkiProfile): void;
protected isLinkedSearch(info: ISearchRequestData): boolean; protected isLinkedSearch(info: ISearchRequestData): boolean;
protected isRequiredSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean;
update(): void; update(): void;

View File

@ -20,6 +20,7 @@ import { ItemFilterService } from "../services/ItemFilterService";
import { LocalisationService } from "../services/LocalisationService"; import { LocalisationService } from "../services/LocalisationService";
import { PaymentService } from "../services/PaymentService"; import { PaymentService } from "../services/PaymentService";
import { ProfileFixerService } from "../services/ProfileFixerService"; import { ProfileFixerService } from "../services/ProfileFixerService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil"; import { MathUtil } from "../utils/MathUtil";
import { ObjectId } from "../utils/ObjectId"; import { ObjectId } from "../utils/ObjectId";
@ -56,6 +57,7 @@ export declare class RepeatableQuestController {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected httpResponse: HttpResponseUtil;
protected mathUtil: MathUtil; protected mathUtil: MathUtil;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
@ -71,7 +73,7 @@ export declare class RepeatableQuestController {
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer);
/** /**
* This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint
* Returns an array of objects in the format of repeatable quests to the client. * Returns an array of objects in the format of repeatable quests to the client.
@ -153,6 +155,12 @@ export declare class RepeatableQuestController {
* @returns {object} object of quest type format for "Elimination" (see assets/database/templates/repeatableQuests.json) * @returns {object} object of quest type format for "Elimination" (see assets/database/templates/repeatableQuests.json)
*/ */
generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination;
/**
* Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567)
* @param locationKey e.g factory4_day
* @returns guid
*/
protected getQuestLocationByMapId(locationKey: string): string;
/** /**
* Exploration repeatable quests can specify a required extraction point. * Exploration repeatable quests can specify a required extraction point.
* This method creates the according object which will be appended to the conditions array * This method creates the according object which will be appended to the conditions array

View File

@ -8,13 +8,15 @@ import { Upd } from "../models/eft/common/tables/IItem";
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
import { EventOutputHolder } from "../routers/EventOutputHolder"; import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
declare class TradeController { declare class TradeController {
protected logger: ILogger; protected logger: ILogger;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected tradeHelper: TradeHelper; protected tradeHelper: TradeHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected ragfairServer: RagfairServer; protected ragfairServer: RagfairServer;
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); protected httpResponse: HttpResponseUtil;
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil);
confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse;
confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
} }

View File

@ -7,6 +7,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { FenceService } from "../services/FenceService"; import { FenceService } from "../services/FenceService";
import { TraderAssortService } from "../services/TraderAssortService"; import { TraderAssortService } from "../services/TraderAssortService";
import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class TraderController { export declare class TraderController {
@ -17,10 +18,11 @@ export declare class TraderController {
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected traderAssortService: TraderAssortService; protected traderAssortService: TraderAssortService;
protected traderPurchasePersisterService: TraderPurchasePersisterService;
protected fenceService: FenceService; protected fenceService: FenceService;
protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil);
/** /**
* Runs when onLoad event is fired * Runs when onLoad event is fired
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService

View File

@ -57,7 +57,7 @@ export declare class BotEquipmentModGenerator {
* @param weapon Weapon to add mods to * @param weapon Weapon to add mods to
* @param modPool Pool of compatible mods to attach to weapon * @param modPool Pool of compatible mods to attach to weapon
* @param weaponParentId parentId of weapon * @param weaponParentId parentId of weapon
* @param parentWeaponTemplate Weapon which mods will be generated on * @param parentTemplate Weapon which mods will be generated on
* @param modSpawnChances Mod spawn chances * @param modSpawnChances Mod spawn chances
* @param ammoTpl Ammo tpl to use when generating magazines/cartridges * @param ammoTpl Ammo tpl to use when generating magazines/cartridges
* @param botRole Role of bot weapon is generated for * @param botRole Role of bot weapon is generated for
@ -66,7 +66,26 @@ export declare class BotEquipmentModGenerator {
* @param botEquipmentRole role of bot when accessing bot.json equipment config settings * @param botEquipmentRole role of bot when accessing bot.json equipment config settings
* @returns Weapon + mods array * @returns Weapon + mods array
*/ */
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentWeaponTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[]; generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[];
/**
* Is this modslot a front or rear sight
* @param modSlot Slot to check
* @returns true if it's a front/rear sight
*/
protected modIsFrontOrRearSight(modSlot: string): boolean;
/**
* Does the provided mod details show the mod can hold a scope
* @param modSlot e.g. mod_scope, mod_mount
* @param modsParentId Parent id of mod item
* @returns true if it can hold a scope
*/
protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean;
/**
* Set all scope mod chances to 100%
* @param modSpawnChances Chances objet to update
*/
protected setScopeSpawnChancesToFull(modSpawnChances: ModsChances): void;
protected sortModKeys(unsortedKeys: string[]): string[];
/** /**
* Get a Slot property for an item (chamber/cartridge/slot) * Get a Slot property for an item (chamber/cartridge/slot)
* @param modSlot e.g patron_in_weapon * @param modSlot e.g patron_in_weapon

View File

@ -119,7 +119,7 @@ export declare class RagfairOfferGenerator {
*/ */
protected createBarterRequirement(offerItems: Item[]): IBarterScheme[]; protected createBarterRequirement(offerItems: Item[]): IBarterScheme[];
/** /**
* Get an array of flea prices + item tpl, cached in generator class * Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter`
* @returns array with tpl/price values * @returns array with tpl/price values
*/ */
protected getFleaPricesAsArray(): { protected getFleaPricesAsArray(): {

View File

@ -37,12 +37,6 @@ export declare class ScavCaseRewardGenerator {
* @returns filtered array of db items * @returns filtered array of db items
*/ */
protected getDbItems(): ITemplateItem[]; protected getDbItems(): ITemplateItem[];
/**
* Check if a template id has a blacklisted parent id
* @param tplid template id to check
* @returns true if item is blacklisted
*/
protected itemHasBlacklistedParent(tplid: string): boolean;
/** /**
* Pick a number of items to be rewards, the count is defined by the values in * Pick a number of items to be rewards, the count is defined by the values in
* @param items item pool to pick rewards from * @param items item pool to pick rewards from

View File

@ -1,7 +1,7 @@
import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper";
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IBotConfig } from "../models/spt/config/IBotConfig"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
@ -30,17 +30,13 @@ export declare class BotGeneratorHelper {
upd?: Upd; upd?: Upd;
}; };
/** /**
* Get the chance for the light or laser to be set as active on weapon, default to 50% if no bot/equip settings found * Get the chance for the weapon attachment or helmet equipment to be set as activated
* @param botRole role of bot with weapon * @param botRole role of bot with weapon/helmet
* @param setting the setting of the weapon attachment/helmet equipment to be activated
* @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null
* @returns Percent chance to be active * @returns Percent chance to be active
*/ */
protected getLightLaserActiveChance(botRole: string): number; protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number;
/**
* Get the chance for the faceshield to be set as enabled, default to 75% if no bot/equip settings found
* @param botRole role of bot with faceshield
* @returns Percent chance to be active
*/
protected getFaceShieldActiveChance(botRole: string): number;
/** /**
* Create a repairable object for a weapon that containers durability + max durability properties * Create a repairable object for a weapon that containers durability + max durability properties
* @param itemTemplate weapon object being generated for * @param itemTemplate weapon object being generated for

View File

@ -36,18 +36,18 @@ export declare class HandbookHelper {
isCategory(category: string): boolean; isCategory(category: string): boolean;
childrenCategories(x: string): string[]; childrenCategories(x: string): string[];
/** /**
* Convert currency into roubles * Convert non-roubles into roubles
* @param {number} value * @param nonRoubleCurrencyCount Currency count to convert
* @param {string} currencyFrom * @param currencyTypeFrom What current currency is
* @returns get rouble value of inputted currency * @returns Count in roubles
*/
inRUB(value: number, currencyFrom: string): number;
/**
* Gets Ruble to Currency conversion Value
* @param {number} value
* @param {string} currencyTo
* @returns number
*/ */
fromRUB(value: number, currencyTo: string): number; inRUB(nonRoubleCurrencyCount: number, currencyTypeFrom: string): number;
/**
* Convert roubles into another currency
* @param roubleCurrencyCount roubles to convert
* @param currencyTypeTo Currency to convert roubles into
* @returns currency count in desired type
*/
fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number;
} }
export {}; export {};

View File

@ -1,4 +1,5 @@
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Effect } from "../models/eft/health/Effect";
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IHealthConfig } from "../models/spt/config/IHealthConfig"; import { IHealthConfig } from "../models/spt/config/IHealthConfig";
@ -46,6 +47,6 @@ export declare class HealthHelper {
* @param effectBodyPart body part to edit * @param effectBodyPart body part to edit
* @param effectType Effect to add to body part * @param effectType Effect to add to body part
*/ */
protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: Effect): void;
protected isEmpty(map: any): boolean; protected isEmpty(map: any): boolean;
} }

View File

@ -192,7 +192,7 @@ declare class ItemHelper {
*/ */
replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[];
/** /**
* Recursivly loop down through an items hierarchy to see if any of the ids match the supplied list, return true if any do * WARNING, SLOW. Recursivly loop down through an items hierarchy to see if any of the ids match the supplied list, return true if any do
* @param {string} tpl * @param {string} tpl
* @param {Array} tplsToCheck * @param {Array} tplsToCheck
* @returns boolean * @returns boolean

View File

@ -5,7 +5,6 @@ import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNic
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { FenceService } from "../services/FenceService";
import { ProfileSnapshotService } from "../services/ProfileSnapshotService"; import { ProfileSnapshotService } from "../services/ProfileSnapshotService";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
@ -20,9 +19,13 @@ export declare class ProfileHelper {
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected profileSnapshotService: ProfileSnapshotService; protected profileSnapshotService: ProfileSnapshotService;
protected fenceService: FenceService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService);
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService);
resetProfileQuestCondition(sessionID: string, conditionId: string): void; resetProfileQuestCondition(sessionID: string, conditionId: string): void;
/**
* Get all profiles from server
* @returns Dictionary of profiles
*/
getProfiles(): Record<string, IAkiProfile>;
getCompleteProfile(sessionID: string): IPmcData[]; getCompleteProfile(sessionID: string): IPmcData[];
/** /**
* Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen

View File

@ -68,12 +68,12 @@ export declare class QuestHelper {
* @param progressAmount Amount of skill points to add to skill * @param progressAmount Amount of skill points to add to skill
*/ */
rewardSkillPoints(sessionID: string, pmcData: IPmcData, output: IItemEventRouterResponse, skillName: string, progressAmount: number): void; rewardSkillPoints(sessionID: string, pmcData: IPmcData, output: IItemEventRouterResponse, skillName: string, progressAmount: number): void;
getQuestLocale(questId: string): any;
/** /**
* Debug Routine for showing some information on the * Get quest name by quest id
* quest list in question. * @param questId id to get
* @returns
*/ */
dumpQuests(quests: any): void; getQuestNameFromLocale(questId: string): string;
/** /**
* Check if trader has sufficient loyalty to fullfill quest requirement * Check if trader has sufficient loyalty to fullfill quest requirement
* @param questProperties Quest props * @param questProperties Quest props

View File

@ -11,7 +11,21 @@ export declare class RagfairSellHelper {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
calculateSellChance(baseChancePercent: number, offerPriceRub: number, playerListedPriceRub: number): number; /**
* Get the percent chance to sell an item based on its average listed price vs player chosen listing price
* @param baseChancePercent Base chance to sell item
* @param averageOfferPriceRub Price of average offer in roubles
* @param playerListedPriceRub Price player listed item for in roubles
* @returns percent value
*/
calculateSellChance(baseChancePercent: number, averageOfferPriceRub: number, playerListedPriceRub: number): number;
/**
* Get percent chance to sell an item when price is below items average listing price
* @param playerListedPriceRub Price player listed item for in roubles
* @param averageOfferPriceRub Price of average offer in roubles
* @returns percent value
*/
protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number;
/** /**
* Determine if the offer being listed will be sold * Determine if the offer being listed will be sold
* @param sellChancePercent chance item will sell * @param sellChancePercent chance item will sell

View File

@ -42,7 +42,7 @@ export declare class RagfairServerHelper {
protected isItemBlacklisted(itemTemplateId: string): boolean; protected isItemBlacklisted(itemTemplateId: string): boolean;
isTrader(userID: string): boolean; isTrader(userID: string): boolean;
isPlayer(userID: string): boolean; isPlayer(userID: string): boolean;
returnItems(sessionID: string, items: any[]): void; returnItems(sessionID: string, items: Item[]): void;
calculateDynamicStackCount(tplId: string, isWeaponPreset: boolean): number; calculateDynamicStackCount(tplId: string, isWeaponPreset: boolean): number;
/** /**
* Choose a currency at random with bias * Choose a currency at random with bias

View File

@ -15,7 +15,7 @@ export declare class RepairHelper {
protected repairConfig: IRepairConfig; protected repairConfig: IRepairConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, configServer: ConfigServer);
/** /**
* * Alter an items durability after a repair by trader/repair kit
* @param itemToRepair item to update durability details * @param itemToRepair item to update durability details
* @param itemToRepairDetails db details of item to repair * @param itemToRepairDetails db details of item to repair
* @param isArmor Is item being repaired a piece of armor * @param isArmor Is item being repaired a piece of armor

View File

@ -6,8 +6,10 @@ import { Item, Upd } from "../models/eft/common/tables/IItem";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData";
import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData";
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder"; import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer"; import { RagfairServer } from "../servers/RagfairServer";
import { FenceService } from "../services/FenceService"; import { FenceService } from "../services/FenceService";
import { PaymentService } from "../services/PaymentService"; import { PaymentService } from "../services/PaymentService";
@ -20,7 +22,9 @@ export declare class TradeHelper {
protected fenceService: FenceService; protected fenceService: FenceService;
protected inventoryHelper: InventoryHelper; protected inventoryHelper: InventoryHelper;
protected ragfairServer: RagfairServer; protected ragfairServer: RagfairServer;
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); protected configServer: ConfigServer;
protected traderConfig: ITraderConfig;
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer, configServer: ConfigServer);
/** /**
* Buy item from flea or trader * Buy item from flea or trader
* @param pmcData * @param pmcData

View File

@ -9,6 +9,7 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { FenceService } from "../services/FenceService"; import { FenceService } from "../services/FenceService";
import { LocalisationService } from "../services/LocalisationService"; import { LocalisationService } from "../services/LocalisationService";
import { TraderAssortService } from "../services/TraderAssortService"; import { TraderAssortService } from "../services/TraderAssortService";
import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil"; import { MathUtil } from "../utils/MathUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
@ -29,11 +30,12 @@ export declare class TraderAssortHelper {
protected ragfairOfferGenerator: RagfairOfferGenerator; protected ragfairOfferGenerator: RagfairOfferGenerator;
protected traderAssortService: TraderAssortService; protected traderAssortService: TraderAssortService;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected traderPurchasePersisterService: TraderPurchasePersisterService;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected fenceService: FenceService; protected fenceService: FenceService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected traderConfig: ITraderConfig; protected traderConfig: ITraderConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, localisationService: LocalisationService, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, localisationService: LocalisationService, traderPurchasePersisterService: TraderPurchasePersisterService, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer);
/** /**
* Get a traders assorts * Get a traders assorts
* Can be used for returning ragfair / fence assorts * Can be used for returning ragfair / fence assorts

View File

@ -53,19 +53,26 @@ export declare class TraderHelper {
getPurchasesData(traderID: string, sessionID: string): Record<string, IBarterScheme[][]>; getPurchasesData(traderID: string, sessionID: string): Record<string, IBarterScheme[][]>;
/** /**
* Should item be skipped when selling to trader according to its sell categories and other checks * Should item be skipped when selling to trader according to its sell categories and other checks
* @param pmcData * @param pmcData Profile
* @param item * @param item Item to be checked is sellable to trader
* @param sellCategory * @param sellCategory categories trader will buy
* @param traderId Trader item is being checked can be sold to
* @returns true if should NOT be sold to trader * @returns true if should NOT be sold to trader
*/ */
protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[]): boolean; protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean;
/** /**
* Can this weapon be sold to a trader with its current durabiltiy level * Check if item has durability so low it precludes it from being sold to the trader (inclusive)
* @param traderID * @param item Item to check durability of
* @param item * @param traderId Trader item is sold to
* @returns boolean * @returns
*/ */
protected isWeaponBelowTraderBuyDurability(traderID: string, item: Item): boolean; protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean;
/**
* Get the percentage threshold value a trader will buy armor/weapons above
* @param traderId Trader to look up
* @returns percentage
*/
protected getTraderDurabiltyPurchaseThreshold(traderId: string): number;
/** /**
* Get the price of an item and all of its attached children * Get the price of an item and all of its attached children
* Take into account bonuses/adjsutments e.g. discounts * Take into account bonuses/adjsutments e.g. discounts
@ -113,10 +120,22 @@ export declare class TraderHelper {
getTraderUpdateSeconds(traderId: string): number; getTraderUpdateSeconds(traderId: string): number;
/** /**
* check if an item is allowed to be sold to a trader * check if an item is allowed to be sold to a trader
* @param traderFilters array of allowed categories * @param categoriesTraderBuys array of allowed categories
* @param tplToCheck itemTpl of inventory * @param tplToCheck itemTpl of inventory
* @returns boolean * @returns boolean if item can be sold to trader
*/ */
traderFilter(traderFilters: string[], tplToCheck: string): boolean; doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean;
getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel;
/**
* Store the purchase of an assort from a trader in the player profile
* @param sessionID Session id
* @param newPurchaseDetails New item assort id + count
*/
addTraderPurchasesToPlayerProfile(sessionID: string, newPurchaseDetails: {
items: {
item_id: string;
count: number;
}[];
tid: string;
}): void;
} }

View File

@ -34,6 +34,7 @@ export declare class PreAkiModLoader implements IModLoader {
* @returns Array of mod names in load order * @returns Array of mod names in load order
*/ */
getImportedModsNames(): string[]; getImportedModsNames(): string[];
getImportedModDetails(): Record<string, ModLoader.IMod>;
getModPath(mod: string): string; getModPath(mod: string): string;
protected importClass(name: string, filepath: string, container: DependencyContainer): void; protected importClass(name: string, filepath: string, container: DependencyContainer): void;
protected importMods(): Promise<void>; protected importMods(): Promise<void>;

View File

@ -57,6 +57,10 @@ export interface ModsChances {
mod_pistol_grip: number; mod_pistol_grip: number;
mod_reciever: number; mod_reciever: number;
mod_scope: number; mod_scope: number;
mod_scope_000: number;
mod_scope_001: number;
mod_scope_002: number;
mod_scope_003: number;
mod_sight_front: number; mod_sight_front: number;
mod_sight_rear: number; mod_sight_rear: number;
mod_stock: number; mod_stock: number;

View File

@ -54,8 +54,9 @@ export interface Repair {
currency: string; currency: string;
currency_coefficient: number; currency_coefficient: number;
excluded_category: string[]; excluded_category: string[];
/** Doesn't exist in client object */
excluded_id_list: any[]; excluded_id_list: any[];
quality: string; quality: number;
} }
export interface ITraderAssort { export interface ITraderAssort {
nextResupply: number; nextResupply: number;

View File

@ -0,0 +1,16 @@
export interface IChatServer {
_id: string;
RegistrationId: number;
VersionId: string;
Ip: string;
Port: number;
DateTime: number;
Chats: IChat[];
Regions: string[];
/** Possibly removed */
IsDeveloper?: boolean;
}
export interface IChat {
_id: string;
Members: number;
}

View File

@ -1,7 +1,7 @@
import { MemberCategory } from "../../enums/MemberCategory"; import { MemberCategory } from "../../enums/MemberCategory";
export interface IGetFriendListDataResponse { export interface IGetFriendListDataResponse {
Friends: Friend[]; Friends: Friend[];
Ignore: any[]; Ignore: string[];
InIgnoreList: string[]; InIgnoreList: string[];
} }
export interface Friend { export interface Friend {

View File

@ -1,4 +1,9 @@
export interface IAddItemRequestData { export interface IAddItemRequestData {
tid: string; tid: string;
items: any[]; items: AddItem[];
}
export interface AddItem {
count: number;
isPreset?: boolean;
item_id: string;
} }

View File

@ -11,6 +11,12 @@ export interface IAkiProfile {
vitality: Vitality; vitality: Vitality;
inraid: Inraid; inraid: Inraid;
insurance: Insurance[]; insurance: Insurance[];
/** Assort purchases made by player since last trader refresh */
traderPurchases?: Record<string, Record<string, TraderPurchaseData>>;
}
export declare class TraderPurchaseData {
count: number;
purchaseTimestamp: number;
} }
export interface Info { export interface Info {
id: string; id: string;
@ -93,6 +99,13 @@ export interface DateTime {
} }
export interface Aki { export interface Aki {
version: string; version: string;
mods?: ModDetails[];
}
export interface ModDetails {
name: string;
version: string;
author: string;
dateAdded: number;
} }
export interface Vitality { export interface Vitality {
health: Health; health: Health;

View File

@ -69,6 +69,7 @@ export interface EquipmentFilters {
weaponSightWhitelist: Record<string, string[]>; weaponSightWhitelist: Record<string, string[]>;
faceShieldIsActiveChancePercent?: number; faceShieldIsActiveChancePercent?: number;
lightLaserIsActiveChancePercent?: number; lightLaserIsActiveChancePercent?: number;
nvgIsActiveChancePercent?: number;
randomisation: RandomisationDetails[]; randomisation: RandomisationDetails[];
blacklist: EquipmentFilterDetails[]; blacklist: EquipmentFilterDetails[];
whitelist: EquipmentFilterDetails[]; whitelist: EquipmentFilterDetails[];

View File

@ -4,6 +4,7 @@ export interface IQuestConfig extends IBaseConfig {
kind: "aki-quest"; kind: "aki-quest";
redeemTime: number; redeemTime: number;
repeatableQuests: IRepeatableQuestConfig[]; repeatableQuests: IRepeatableQuestConfig[];
locationIdMap: Record<string, string>;
bearOnlyQuests: string[]; bearOnlyQuests: string[];
usecOnlyQuests: string[]; usecOnlyQuests: string[];
} }

View File

@ -3,8 +3,10 @@ export interface ITraderConfig extends IBaseConfig {
kind: "aki-trader"; kind: "aki-trader";
updateTime: UpdateTime[]; updateTime: UpdateTime[];
updateTimeDefault: number; updateTimeDefault: number;
/** What % of max durability an item needs to sell to a trader*/
durabilityPurchaseThreshhold: Record<string, number>;
traderPriceMultipler: number; traderPriceMultipler: number;
minDurabilityForSale: number; persistPurchaseDataInProfile: boolean;
fence: FenceConfig; fence: FenceConfig;
} }
export interface UpdateTime { export interface UpdateTime {

View File

@ -47,7 +47,7 @@ export declare class BotEquipmentModPoolService {
* @param itemTpl items tpl to look up mods for * @param itemTpl items tpl to look up mods for
* @returns Dictionary of mods (keys are mod slot names) with array of compatible mod tpls as value * @returns Dictionary of mods (keys are mod slot names) with array of compatible mod tpls as value
*/ */
getModsFoGearSlot(itemTpl: string): Record<string, string[]>; getModsForGearSlot(itemTpl: string): Record<string, string[]>;
/** /**
* Get mods for a weapon by its tpl * Get mods for a weapon by its tpl
* @param itemTpl Weapons tpl to look up mods for * @param itemTpl Weapons tpl to look up mods for

View File

@ -93,9 +93,9 @@ export declare class FenceService {
*/ */
getOfferCount(): number; getOfferCount(): number;
/** /**
* Create a trader assort for fence * Create trader assorts for fence and store in fenceService cache
*/ */
generateFenceAssortCache(): void; generateFenceAssorts(): void;
/** /**
* Create skeleton to hold assort items * Create skeleton to hold assort items
* @returns ITraderAssort object * @returns ITraderAssort object

View File

@ -30,7 +30,7 @@ export declare class InsuranceService {
insuranceExists(sessionId: string): boolean; insuranceExists(sessionId: string): boolean;
insuranceTraderArrayExists(sessionId: string, traderId: string): boolean; insuranceTraderArrayExists(sessionId: string, traderId: string): boolean;
getInsurance(sessionId: string): Record<string, Item[]>; getInsurance(sessionId: string): Record<string, Item[]>;
getInsuranceItems(sessionId: string, traderId: string): any[]; getInsuranceItems(sessionId: string, traderId: string): Item[];
resetInsurance(sessionId: string): void; resetInsurance(sessionId: string): void;
resetInsuranceTraderArray(sessionId: string, traderId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void;
addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void;

View File

@ -60,9 +60,9 @@ export declare class PaymentService {
/** /**
* Prioritise player stash first over player inventory * Prioritise player stash first over player inventory
* Post-raid healing would often take money out of the players pockets/secure container * Post-raid healing would often take money out of the players pockets/secure container
* @param a Firsat money stack item * @param a First money stack item
* @param b Second money stack item * @param b Second money stack item
* @returns sorted item * @returns sort order
*/ */
protected moneySort(a: Item, b: Item): number; protected prioritiseStashSort(a: Item, b: Item): number;
} }

View File

@ -11,6 +11,9 @@ import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
import { OnLoad } from "../di/OnLoad"; import { OnLoad } from "../di/OnLoad";
/**
* Stores flea prices for items as well as methods to interact with them
*/
export declare class RagfairPriceService implements OnLoad { export declare class RagfairPriceService implements OnLoad {
protected handbookHelper: HandbookHelper; protected handbookHelper: HandbookHelper;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
@ -24,12 +27,18 @@ export declare class RagfairPriceService implements OnLoad {
protected generatedStaticPrices: boolean; protected generatedStaticPrices: boolean;
protected prices: IRagfairServerPrices; protected prices: IRagfairServerPrices;
constructor(handbookHelper: HandbookHelper, databaseServer: DatabaseServer, logger: ILogger, itemHelper: ItemHelper, presetHelper: PresetHelper, randomUtil: RandomUtil, configServer: ConfigServer); constructor(handbookHelper: HandbookHelper, databaseServer: DatabaseServer, logger: ILogger, itemHelper: ItemHelper, presetHelper: PresetHelper, randomUtil: RandomUtil, configServer: ConfigServer);
/**
* Generate static (handbook) and dynamic (prices.json) flea prices, store inside class as dictionaries
*/
onLoad(): Promise<void>; onLoad(): Promise<void>;
getRoute(): string; getRoute(): string;
/** /**
* Iterate over all items of type "Item" in db and get template price, store in cache * Iterate over all items of type "Item" in db and get template price, store in cache
*/ */
generateStaticPrices(): void; generateStaticPrices(): void;
/**
* Create a dictionary and store prices from prices.json in it
*/
protected generateDynamicPrices(): void; protected generateDynamicPrices(): void;
/** /**
* Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value.
@ -51,6 +60,10 @@ export declare class RagfairPriceService implements OnLoad {
* @returns price in roubles * @returns price in roubles
*/ */
getStaticPriceForItem(itemTpl: string): number; getStaticPriceForItem(itemTpl: string): number;
/**
* Get prices for all items on flea, priorities dynamic prices from prices.json, use handbook prices if missing
* @returns Dictionary of item tpls and rouble cost
*/
getAllFleaPrices(): Record<string, number>; getAllFleaPrices(): Record<string, number>;
/** /**
* Get the percentage difference between two values * Get the percentage difference between two values
@ -59,7 +72,18 @@ export declare class RagfairPriceService implements OnLoad {
* @returns different in percent * @returns different in percent
*/ */
protected getPriceDifference(a: number, b: number): number; protected getPriceDifference(a: number, b: number): number;
/**
* Get the rouble price for an assorts barter scheme
* @param barterScheme
* @returns Rouble price
*/
getBarterPrice(barterScheme: IBarterScheme[]): number; getBarterPrice(barterScheme: IBarterScheme[]): number;
/**
* Generate a currency cost for an item and its mods
* @param items Item with mods to get price for
* @param desiredCurrency Currency price desired in
* @returns cost of item in desired currency
*/
getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number;
/** /**
* Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json

View File

@ -1,3 +1,4 @@
import { BotHelper } from "../helpers/BotHelper";
import { Config } from "../models/eft/common/IGlobals"; import { Config } from "../models/eft/common/IGlobals";
import { Inventory } from "../models/eft/common/tables/IBotType"; import { Inventory } from "../models/eft/common/tables/IBotType";
import { ISeasonalEvent, ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig"; import { ISeasonalEvent, ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig";
@ -9,11 +10,12 @@ export declare class SeasonalEventService {
protected logger: ILogger; protected logger: ILogger;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected botHelper: BotHelper;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected seasonalEventConfig: ISeasonalEventConfig; protected seasonalEventConfig: ISeasonalEventConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer);
protected get events(): Record<string, string>; protected get events(): Record<string, string>;
get christmasEventItems(): string[]; protected get christmasEventItems(): string[];
/** /**
* Get an array of christmas items found in bots inventories as loot * Get an array of christmas items found in bots inventories as loot
* @returns array * @returns array
@ -37,7 +39,7 @@ export declare class SeasonalEventService {
*/ */
protected getEventBotGear(eventName: string): Record<string, Record<string, Record<string, number>>>; protected getEventBotGear(eventName: string): Record<string, Record<string, Record<string, number>>>;
/** /**
* Get the dates each seasonal event starts and ends * Get the dates each seasonal event starts and ends at
* @returns Record with event name + start/end date * @returns Record with event name + start/end date
*/ */
getEventDetails(): ISeasonalEvent[]; getEventDetails(): ISeasonalEvent[];
@ -48,8 +50,9 @@ export declare class SeasonalEventService {
/** /**
* Iterate through bots inventory and loot to find and remove christmas items (as defined in SeasonalEventService) * Iterate through bots inventory and loot to find and remove christmas items (as defined in SeasonalEventService)
* @param nodeInventory Bots inventory to iterate over * @param nodeInventory Bots inventory to iterate over
* @param botRole the role of the bot being processed
*/ */
removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; removeChristmasItemsFromBotInventory(nodeInventory: Inventory, botRole: string): void;
/** /**
* Make adjusted to server code based on the name of the event passed in * Make adjusted to server code based on the name of the event passed in
* @param globalConfig globals.json * @param globalConfig globals.json

View File

@ -0,0 +1,34 @@
import { ProfileHelper } from "../helpers/ProfileHelper";
import { TraderPurchaseData } from "../models/eft/profile/IAkiProfile";
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { TimeUtil } from "../utils/TimeUtil";
/**
* Help with storing limited item purchases from traders in profile to persist them over server restarts
*/
export declare class TraderPurchasePersisterService {
protected logger: ILogger;
protected timeUtil: TimeUtil;
protected profileHelper: ProfileHelper;
protected configServer: ConfigServer;
protected traderConfig: ITraderConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, profileHelper: ProfileHelper, configServer: ConfigServer);
/**
* Get the purchases made from a trader for this profile before the last trader reset
* @param sessionId Session id
* @param traderId Trader to loop up purchases for
* @returns Dict of assort id and count purchased
*/
getProfileTraderPurchases(sessionId: string, traderId: string): Record<string, TraderPurchaseData>;
/**
* Remove all trader purchase records from all profiles that exist
* @param traderId Traders id
*/
resetTraderPurchasesStoredInProfile(traderId: string): void;
/**
* Iterate over all server profiles and remove specific trader purchase data that has passed the trader refesh time
* @param traderId Trader id
*/
removeStalePurchasesFromProfiles(traderId: string): void;
}

View File

@ -21,6 +21,17 @@ export declare class DatabaseImporter extends OnLoad {
*/ */
protected hydrateDatabase(filepath: string): Promise<void>; protected hydrateDatabase(filepath: string): Promise<void>;
getRoute(): string; getRoute(): string;
loadRecursive(filepath: string): Promise<IDatabaseTables>; /**
* Load files into js objects recursively (asynchronous)
* @param filepath Path to folder with files
* @returns
*/
loadRecursiveAsync(filepath: string): Promise<IDatabaseTables>;
/**
* Load files into js objects recursively (synchronous)
* @param filepath Path to folder with files
* @returns
*/
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void; loadImages(filepath: string): void;
} }