Update types for examples

This commit is contained in:
Chomp 2023-02-12 16:32:10 +00:00
parent aad0a36b11
commit ef07efc01b
2457 changed files with 24110 additions and 8120 deletions

View File

@ -65,5 +65,10 @@ export declare class DataCallbacks {
* Handle client/hideout/qte/list * Handle client/hideout/qte/list
*/ */
getQteList(url: string, info: IEmptyRequestData, sessionID: string): string; getQteList(url: string, info: IEmptyRequestData, sessionID: string): string;
/**
* Handle client/items/prices/
* Called when viewing a traders assorts
* TODO - fully implement this
*/
getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetItemPricesResponse>; getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetItemPricesResponse>;
} }

View File

@ -21,7 +21,7 @@ import { DialogueInfo } from "../models/eft/profile/IAkiProfile";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class DialogueCallbacks extends OnUpdate { export declare class DialogueCallbacks implements OnUpdate {
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;

View File

@ -1,6 +1,6 @@
import { HandbookController } from "../controllers/HandbookController"; import { HandbookController } from "../controllers/HandbookController";
import { OnLoad } from "../di/OnLoad"; import { OnLoad } from "../di/OnLoad";
export declare class HandbookCallbacks extends OnLoad { export declare class HandbookCallbacks implements OnLoad {
protected handbookController: HandbookController; protected handbookController: HandbookController;
constructor(handbookController: HandbookController); constructor(handbookController: HandbookController);
onLoad(): Promise<void>; onLoad(): Promise<void>;

View File

@ -2,7 +2,7 @@ import { HideoutController } from "../controllers/HideoutController";
import { OnUpdate } from "../di/OnUpdate"; import { OnUpdate } from "../di/OnUpdate";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData";
import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData";
import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData"; import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData";
import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData"; import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData";
@ -16,7 +16,7 @@ import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootin
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
export declare class HideoutCallbacks extends OnUpdate { export declare class HideoutCallbacks implements OnUpdate {
protected hideoutController: HideoutController; protected hideoutController: HideoutController;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected hideoutConfig: IHideoutConfig; protected hideoutConfig: IHideoutConfig;
@ -53,7 +53,7 @@ export declare class HideoutCallbacks extends OnUpdate {
/** /**
* Handle HideoutContinuousProductionStart * Handle HideoutContinuousProductionStart
*/ */
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Handle HideoutTakeProduction * Handle HideoutTakeProduction
*/ */

View File

@ -1,6 +1,6 @@
import { OnLoad } from "../di/OnLoad"; import { OnLoad } from "../di/OnLoad";
import { HttpServer } from "../servers/HttpServer"; import { HttpServer } from "../servers/HttpServer";
export declare class HttpCallbacks extends OnLoad { export declare class HttpCallbacks implements OnLoad {
protected httpServer: HttpServer; protected httpServer: HttpServer;
constructor(httpServer: HttpServer); constructor(httpServer: HttpServer);
onLoad(): Promise<void>; onLoad(): Promise<void>;

View File

@ -10,7 +10,7 @@ import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { InsuranceService } from "../services/InsuranceService"; import { InsuranceService } from "../services/InsuranceService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class InsuranceCallbacks extends OnUpdate { export declare class InsuranceCallbacks implements OnUpdate {
protected insuranceController: InsuranceController; protected insuranceController: InsuranceController;
protected insuranceService: InsuranceService; protected insuranceService: InsuranceService;
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;

View File

@ -6,7 +6,7 @@ import { ConfigServer } from "../servers/ConfigServer";
import { LocalisationService } from "../services/LocalisationService"; import { LocalisationService } from "../services/LocalisationService";
import { HttpFileUtil } from "../utils/HttpFileUtil"; import { HttpFileUtil } from "../utils/HttpFileUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
declare class ModCallbacks extends OnLoad { declare class ModCallbacks implements OnLoad {
protected logger: ILogger; protected logger: ILogger;
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected httpFileUtil: HttpFileUtil; protected httpFileUtil: HttpFileUtil;
@ -17,8 +17,5 @@ declare class ModCallbacks extends OnLoad {
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, localisationService: LocalisationService, configServer: ConfigServer);
onLoad(): Promise<void>; onLoad(): Promise<void>;
getRoute(): string; getRoute(): string;
sendBundle(sessionID: string, req: any, resp: any, body: any): void;
getBundles(url: string, info: any, sessionID: string): string;
getBundle(url: string, info: any, sessionID: string): string;
} }
export { ModCallbacks }; export { ModCallbacks };

View File

@ -1,6 +1,6 @@
import { PresetController } from "../controllers/PresetController"; import { PresetController } from "../controllers/PresetController";
import { OnLoad } from "../di/OnLoad"; import { OnLoad } from "../di/OnLoad";
export declare class PresetCallbacks extends OnLoad { export declare class PresetCallbacks implements OnLoad {
protected presetController: PresetController; protected presetController: PresetController;
constructor(presetController: PresetController); constructor(presetController: PresetController);
onLoad(): Promise<void>; onLoad(): Promise<void>;

View File

@ -1,5 +1,6 @@
import { OnLoad } from "../di/OnLoad";
import { OnUpdate } from "../di/OnUpdate";
import { RagfairController } from "../controllers/RagfairController"; import { RagfairController } from "../controllers/RagfairController";
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
@ -21,7 +22,7 @@ import { JsonUtil } from "../utils/JsonUtil";
/** /**
* Handle ragfair related callback events * Handle ragfair related callback events
*/ */
export declare class RagfairCallbacks extends OnLoadOnUpdate { export declare class RagfairCallbacks implements OnLoad, OnUpdate {
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected ragfairServer: RagfairServer; protected ragfairServer: RagfairServer;

View File

@ -1,6 +1,7 @@
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate"; import { OnLoad } from "../di/OnLoad";
import { OnUpdate } from "../di/OnUpdate";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
export declare class SaveCallbacks extends OnLoadOnUpdate { export declare class SaveCallbacks implements OnLoad, OnUpdate {
protected saveServer: SaveServer; protected saveServer: SaveServer;
constructor(saveServer: SaveServer); constructor(saveServer: SaveServer);
onLoad(): Promise<void>; onLoad(): Promise<void>;

View File

@ -6,6 +6,9 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag
export declare class TradeCallbacks { export declare class TradeCallbacks {
protected tradeController: TradeController; protected tradeController: TradeController;
constructor(tradeController: TradeController); constructor(tradeController: TradeController);
/**
* Handle client/game/profile/items/moving TradingConfirm
*/
processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse;
processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
} }

View File

@ -1,10 +1,11 @@
import { OnLoad } from "../di/OnLoad";
import { OnUpdate } from "../di/OnUpdate";
import { TraderController } from "../controllers/TraderController"; import { TraderController } from "../controllers/TraderController";
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class TraderCallbacks extends OnLoadOnUpdate { export declare class TraderCallbacks implements OnLoad, OnUpdate {
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected traderController: TraderController; protected traderController: TraderController;
constructor(httpResponse: HttpResponseUtil, traderController: TraderController); constructor(httpResponse: HttpResponseUtil, traderController: TraderController);

View File

@ -41,6 +41,12 @@ export declare class GameController {
protected locationConfig: ILocationConfig; protected locationConfig: ILocationConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, 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;
/**
* When player logs in, iterate over all active effects and reduce timer
* TODO - add body part HP regen
* @param pmcProfile
*/
protected updateProfileHealthValues(pmcProfile: IPmcData): void;
/** /**
* Waves with an identical min/max values spawn nothing, the number of bots that spawn is the difference between min and max * Waves with an identical min/max values spawn nothing, the number of bots that spawn is the difference between min and max
*/ */

View File

@ -2,25 +2,27 @@ import { HealthHelper } from "../helpers/HealthHelper";
import { InventoryHelper } from "../helpers/InventoryHelper"; import { InventoryHelper } from "../helpers/InventoryHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IWorkoutData } from "../models/eft/health/IWorkoutData";
import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData"; import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData";
import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData"; import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData";
import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData";
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
import { IWorkoutData } from "../models/eft/health/IWorkoutData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
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 { LocalisationService } from "../services/LocalisationService"; import { LocalisationService } from "../services/LocalisationService";
import { PaymentService } from "../services/PaymentService"; import { PaymentService } from "../services/PaymentService";
import { JsonUtil } from "../utils/JsonUtil";
export declare class HealthController { export declare class HealthController {
protected logger: ILogger; protected logger: ILogger;
protected jsonUtil: JsonUtil;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected paymentService: PaymentService; protected paymentService: PaymentService;
protected inventoryHelper: InventoryHelper; protected inventoryHelper: InventoryHelper;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected healthHelper: HealthHelper; protected healthHelper: HealthHelper;
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, healthHelper: HealthHelper); constructor(logger: ILogger, jsonUtil: JsonUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, healthHelper: HealthHelper);
/** /**
* stores in-raid player health * stores in-raid player health
* @param pmcData Player profile * @param pmcData Player profile
@ -61,10 +63,11 @@ export declare class HealthController {
*/ */
applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void; applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void;
/** /**
* iterate over treatment request diff and find effects to remove from player limbs * Iterate over treatment request diff and find effects to remove from player limbs
* @param sessionId * @param sessionId
* @param profile Profile to update * @param profile Profile to update
* @param treatmentRequest client request * @param treatmentRequest client request
* @param output response to send to client
*/ */
protected removeEffectsAfterPostRaidHeal(sessionId: string, profile: IPmcData, treatmentRequest: IHealthTreatmentRequestData): void; protected removeEffectsAfterPostRaidHeal(sessionId: string, profile: IPmcData, treatmentRequest: IHealthTreatmentRequestData, output: IItemEventRouterResponse): void;
} }

View File

@ -8,7 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData";
import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase";
import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData";
import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData";
import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData";
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData"; import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData";
@ -27,6 +27,7 @@ import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
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 { LocalisationService } from "../services/LocalisationService"; import { LocalisationService } from "../services/LocalisationService";
import { PlayerService } from "../services/PlayerService"; import { PlayerService } from "../services/PlayerService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
@ -53,9 +54,10 @@ export declare class HideoutController {
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected fenceService: FenceService;
protected static nameBackendCountersCrafting: string; protected static nameBackendCountersCrafting: string;
protected hideoutConfig: IHideoutConfig; protected hideoutConfig: IHideoutConfig;
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil); constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService);
/** /**
* Start a hideout area upgrade * Start a hideout area upgrade
* @param pmcData Player profile * @param pmcData Player profile
@ -73,6 +75,7 @@ export declare class HideoutController {
*/ */
upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Handle HideoutPutItemsInAreaSlots
* Create item in hideout slot item array, remove item from player inventory * Create item in hideout slot item array, remove item from player inventory
* @param pmcData Profile data * @param pmcData Profile data
* @param addItemToHideoutRequest reqeust from client to place item in area slot * @param addItemToHideoutRequest reqeust from client to place item in area slot
@ -122,6 +125,14 @@ export declare class HideoutController {
* @returns item event router response * @returns item event router response
*/ */
scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse; scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Adjust scav case time based on fence standing
*
* @param pmcData Player profile
* @param productionTime Time to complete scav case in seconds
* @returns Adjusted scav case time in seconds
*/
protected getScavCaseTime(pmcData: IPmcData, productionTime: number): number;
/** /**
* Add generated scav case rewards to player profile * Add generated scav case rewards to player profile
* @param pmcData player profile to add rewards to * @param pmcData player profile to add rewards to
@ -136,7 +147,7 @@ export declare class HideoutController {
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
continuousProductionStart(pmcData: IPmcData, request: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; continuousProductionStart(pmcData: IPmcData, request: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Take completed item out of hideout area and place into player inventory * Take completed item out of hideout area and place into player inventory
* @param pmcData Player profile * @param pmcData Player profile
@ -171,7 +182,7 @@ export declare class HideoutController {
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
registerProduction(pmcData: IPmcData, request: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; registerProduction(pmcData: IPmcData, request: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Get quick time event list for hideout * Get quick time event list for hideout
* // TODO - implement this * // TODO - implement this

View File

@ -102,6 +102,13 @@ export declare class QuestController {
* @param questRewards Rewards given to player * @param questRewards Rewards given to player
*/ */
protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Reward[]): void; protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Reward[]): void;
/**
* Look for newly available quests after completing a quest with a requirement to wait x minutes (time-locked) before being available and add data to profile
* @param pmcData Player profile to update
* @param quests Quests to look for wait conditions in
* @param completedQuestId Quest just completed
*/
protected addTimeLockedQuestsToProfile(pmcData: IPmcData, quests: IQuest[], completedQuestId: string): void;
/** /**
* Returns a list of quests that should be failed when a quest is completed * Returns a list of quests that should be failed when a quest is completed
* @param completedQuestId quest completed id * @param completedQuestId quest completed id

View File

@ -1,3 +1,4 @@
import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { PresetHelper } from "../helpers/PresetHelper"; import { PresetHelper } from "../helpers/PresetHelper";
import { ProfileHelper } from "../helpers/ProfileHelper"; import { ProfileHelper } from "../helpers/ProfileHelper";
@ -65,6 +66,7 @@ export declare class RepeatableQuestController {
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected profileFixerService: ProfileFixerService; protected profileFixerService: ProfileFixerService;
protected handbookHelper: HandbookHelper;
protected ragfairServerHelper: RagfairServerHelper; protected ragfairServerHelper: RagfairServerHelper;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
@ -73,7 +75,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, 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); constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, handbookHelper: HandbookHelper, 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.
@ -115,17 +117,18 @@ export declare class RepeatableQuestController {
/** /**
* Just for debug reasons. Draws dailies a random assort of dailies extracted from dumps * Just for debug reasons. Draws dailies a random assort of dailies extracted from dumps
*/ */
generateDebugDailies(dailiesPool: any, factory: any, number: any): any; generateDebugDailies(dailiesPool: any, factory: any, number: number): any;
/** /**
* Generates the base object of quest type format given as templates in assets/database/templates/repeatableQuests.json * Generates the base object of quest type format given as templates in assets/database/templates/repeatableQuests.json
* The templates include Elimination, Completion and Extraction quest types * The templates include Elimination, Completion and Extraction quest types
* *
* @param {string} type quest type: "Elimination", "Completion" or "Extraction" * @param {string} type quest type: "Elimination", "Completion" or "Extraction"
* @param {string} traderId trader from which the quest will be provided * @param {string} traderId trader from which the quest will be provided
* @param {string} side scav daily or pmc daily/weekly quest
* @returns {object} a object which contains the base elements for repeatable quests of the requests type * @returns {object} a object which contains the base elements for repeatable quests of the requests type
* (needs to be filled with reward and conditions by called to make a valid quest) * (needs to be filled with reward and conditions by called to make a valid quest)
*/ */
generateRepeatableTemplate(type: string, traderId: string): IRepeatableQuest; generateRepeatableTemplate(type: string, traderId: string, side: string): IRepeatableQuest;
/** /**
* Generates a valid Exploration quest * Generates a valid Exploration quest
* *

View File

@ -1,22 +1,30 @@
import { RagfairServer } from "../servers/RagfairServer"; import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper"; import { ProfileHelper } from "../helpers/ProfileHelper";
import { TradeHelper } from "../helpers/TradeHelper"; import { TradeHelper } from "../helpers/TradeHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { Upd } from "../models/eft/common/tables/IItem"; import { Upd } from "../models/eft/common/tables/IItem";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer";
import { LocalisationService } from "../services/LocalisationService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; 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 itemHelper: ItemHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected ragfairServer: RagfairServer; protected ragfairServer: RagfairServer;
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil); protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer);
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

@ -1,7 +1,7 @@
import { EventOutputHolder } from "../routers/EventOutputHolder"; import { EventOutputHolder } from "../routers/EventOutputHolder";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData";
export declare class WishlistController { export declare class WishlistController {
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
constructor(eventOutputHolder: EventOutputHolder); constructor(eventOutputHolder: EventOutputHolder);

View File

@ -1,4 +1,4 @@
export declare class OnLoad { export interface OnLoad {
onLoad(): Promise<void>; onLoad(): Promise<void>;
getRoute(): string; getRoute(): string;
} }

View File

@ -1,7 +0,0 @@
import { OnLoad } from "./OnLoad";
import { OnUpdate } from "./OnUpdate";
export declare class OnLoadOnUpdate implements OnLoad, OnUpdate {
onUpdate(timeSinceLastRun: number): Promise<boolean>;
onLoad(): Promise<void>;
getRoute(): string;
}

View File

@ -1,4 +1,4 @@
export declare class OnUpdate { export interface OnUpdate {
onUpdate(timeSinceLastRun: number): Promise<boolean>; onUpdate(timeSinceLastRun: number): Promise<boolean>;
getRoute(): string; getRoute(): string;
} }

View File

@ -2,7 +2,7 @@ import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
import { BotHelper } from "../helpers/BotHelper"; import { BotHelper } from "../helpers/BotHelper";
import { ProfileHelper } from "../helpers/ProfileHelper"; import { ProfileHelper } from "../helpers/ProfileHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Health as PmcHealth, IBotBase, Skills } from "../models/eft/common/tables/IBotBase"; import { Health as PmcHealth, IBotBase, Info, Skills } from "../models/eft/common/tables/IBotBase";
import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { Health, IBotType } from "../models/eft/common/tables/IBotType";
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IBotConfig } from "../models/spt/config/IBotConfig";
@ -90,6 +90,13 @@ export declare class BotGenerator {
*/ */
protected generateId(bot: IBotBase): IBotBase; protected generateId(bot: IBotBase): IBotBase;
protected generateInventoryID(profile: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase;
/**
* Randomise a bots game version and account category
* Chooses from all the game versions (standard, eod etc)
* Chooses account type (default, Sherpa, etc)
* @param botInfo bot info object to update
*/
protected getRandomisedGameVersionAndCategory(botInfo: Info): void;
/** /**
* Add a side-specific (usec/bear) dogtag item to a bots inventory * Add a side-specific (usec/bear) dogtag item to a bots inventory
* @param bot bot to add dogtag to * @param bot bot to add dogtag to

View File

@ -3,6 +3,7 @@ import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService"; import { ItemFilterService } from "../services/ItemFilterService";
import { SeasonalEventService } from "../services/SeasonalEventService";
/** /**
* Handle the generation of dynamic PMC loot in pockets and backpacks * Handle the generation of dynamic PMC loot in pockets and backpacks
* and the removal of blacklisted items * and the removal of blacklisted items
@ -12,10 +13,19 @@ export declare class PMCLootGenerator {
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
protected seasonalEventService: SeasonalEventService;
protected pocketLootPool: string[]; protected pocketLootPool: string[];
protected backpackLootPool: string[]; protected backpackLootPool: string[];
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService); constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService);
/**
* Create an array of loot items a PMC can have in their pockets
* @returns string array of tpls
*/
generatePMCPocketLootPool(): string[]; generatePMCPocketLootPool(): string[];
/**
* Create an array of loot items a PMC can have in their backpack
* @returns string array of tpls
*/
generatePMCBackpackLootPool(): string[]; generatePMCBackpackLootPool(): string[];
} }

View File

@ -1,4 +1,7 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotHelper } from "../helpers/BotHelper"; import { BotHelper } from "../helpers/BotHelper";
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper"; import { ProfileHelper } from "../helpers/ProfileHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Skills, Stats } from "../models/eft/common/tables/IBotBase"; import { Skills, Stats } from "../models/eft/common/tables/IBotBase";
@ -11,11 +14,18 @@ import { SaveServer } from "../servers/SaveServer";
import { BotLootCacheService } from "../services/BotLootCacheService"; import { BotLootCacheService } from "../services/BotLootCacheService";
import { FenceService } from "../services/FenceService"; import { FenceService } from "../services/FenceService";
import { LocalisationService } from "../services/LocalisationService"; import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { BotGenerator } from "./BotGenerator"; import { BotGenerator } from "./BotGenerator";
export declare class PlayerScavGenerator { export declare class PlayerScavGenerator {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected hashUtil: HashUtil;
protected itemHelper: ItemHelper;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected botGeneratorHelper: BotGeneratorHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected botHelper: BotHelper; protected botHelper: BotHelper;
@ -26,7 +36,7 @@ export declare class PlayerScavGenerator {
protected botGenerator: BotGenerator; protected botGenerator: BotGenerator;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected playerScavConfig: IPlayerScavConfig; protected playerScavConfig: IPlayerScavConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer);
/** /**
* Update a player profile to include a new player scav profile * Update a player profile to include a new player scav profile
* @param sessionID session id to specify what profile is updated * @param sessionID session id to specify what profile is updated

View File

@ -4,6 +4,7 @@ import { Item } from "../models/eft/common/tables/IItem";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
export declare class RagfairAssortGenerator { export declare class RagfairAssortGenerator {
@ -11,10 +12,11 @@ export declare class RagfairAssortGenerator {
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected seasonalEventService: SeasonalEventService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected generatedAssortItems: Item[]; protected generatedAssortItems: Item[];
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer); constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
/** /**
* Get an array of unique items that can be sold on the flea * Get an array of unique items that can be sold on the flea
* @returns array of unique items * @returns array of unique items

View File

@ -2,7 +2,6 @@ import { ItemHelper } from "../helpers/ItemHelper";
import { Product } from "../models/eft/common/tables/IBotBase"; import { Product } from "../models/eft/common/tables/IBotBase";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase"; import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase";
import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData";
import { IScavCaseConfig } from "../models/spt/config/IScavCaseConfig"; import { IScavCaseConfig } from "../models/spt/config/IScavCaseConfig";
import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "../models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "../models/spt/hideout/ScavCaseRewardCountsAndPrices";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
@ -28,10 +27,10 @@ export declare class ScavCaseRewardGenerator {
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer);
/** /**
* Create an array of rewards that will be given to the player upon completing their scav case build * Create an array of rewards that will be given to the player upon completing their scav case build
* @param body client request * @param recipeId recipe of the scav case craft
* @returns Product array * @returns Product array
*/ */
generate(body: IHideoutScavCaseStartRequestData): Product[]; generate(recipeId: string): Product[];
/** /**
* Get all db items that are not blacklisted in scavcase config * Get all db items that are not blacklisted in scavcase config
* @returns filtered array of db items * @returns filtered array of db items

View File

@ -17,15 +17,16 @@ export declare class AssortHelper {
* @param pmcProfile player profile * @param pmcProfile player profile
* @param traderId traders id * @param traderId traders id
* @param assort assort items from a trader * @param assort assort items from a trader
* @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders
* @returns assort items minus locked quest assorts * @returns assort items minus locked quest assorts
*/ */
stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, flea?: boolean): ITraderAssort; stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record<string, Record<string, string>>, flea?: boolean): ITraderAssort;
/** /**
* Remove assorts from a trader that have not been unlocked yet * Remove assorts from a trader that have not been unlocked yet
* @param pmcProfile player profile * @param pmcProfile player profile
* @param traderId traders id * @param traderId traders id
* @param assort traders assorts * @param assort traders assorts
* @returns traders assorts minus locked loyality assorts * @returns traders assorts minus locked loyalty assorts
*/ */
stripLockedLoyaltyAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort): ITraderAssort; stripLockedLoyaltyAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort): ITraderAssort;
/** /**

View File

@ -20,7 +20,7 @@ export declare class BotDifficultyHelper {
getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
/** /**
* Get difficulty settings for desired bot type, if not found use assault bot types * Get difficulty settings for desired bot type, if not found use assault bot types
* @param type bot type to retreive difficulty of * @param type bot type to retrieve difficulty of
* @param difficulty difficulty to get settings for (easy/normal etc) * @param difficulty difficulty to get settings for (easy/normal etc)
* @returns Difficulty object * @returns Difficulty object
*/ */

View File

@ -23,7 +23,7 @@ export declare class BotGeneratorHelper {
* Adds properties to an item * Adds properties to an item
* e.g. Repairable / HasHinge / Foldable / MaxDurability * e.g. Repairable / HasHinge / Foldable / MaxDurability
* @param itemTemplate Item extra properties are being generated for * @param itemTemplate Item extra properties are being generated for
* @param botRole Used by weapons to randomise the durability values. Null for non-equipped items * @param botRole Used by weapons to randomize the durability values. Null for non-equipped items
* @returns Item Upd object with extra properties * @returns Item Upd object with extra properties
*/ */
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): { generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): {
@ -53,10 +53,10 @@ export declare class BotGeneratorHelper {
protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable;
/** /**
* Can item be added to another item without conflict * Can item be added to another item without conflict
* @param items Items to check compatiblilities with * @param items Items to check compatibilities with
* @param tplToCheck Tpl of the item to check for incompatibilities * @param tplToCheck Tpl of the item to check for incompatibilities
* @param equipmentSlot Slot the item will be placed into * @param equipmentSlot Slot the item will be placed into
* @returns false if no incompatibilties, also has incompatibility reason * @returns false if no incompatibilities, also has incompatibility reason
*/ */
isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): { isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): {
incompatible: boolean; incompatible: boolean;

View File

@ -23,11 +23,11 @@ export declare class BotHelper {
*/ */
getBotTemplate(role: string): IBotType; getBotTemplate(role: string): IBotType;
/** /**
* Randomise the chance the PMC will attack their own side * Randomize the chance the PMC will attack their own side
* Look up value in bot.json/chanceSameSideIsHostilePercent * Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings * @param difficultySettings pmc difficulty settings
*/ */
randomisePmcHostility(difficultySettings: Difficulty): void; randomizePmcHostility(difficultySettings: Difficulty): void;
/** /**
* Is the passed in bot role a PMC (usec/bear/pmc) * Is the passed in bot role a PMC (usec/bear/pmc)
* @param botRole bot role to check * @param botRole bot role to check
@ -63,26 +63,26 @@ export declare class BotHelper {
rollChanceToBePmc(role: string, botConvertMinMax: MinMax): boolean; rollChanceToBePmc(role: string, botConvertMinMax: MinMax): boolean;
botRoleIsPmc(botRole: string): boolean; botRoleIsPmc(botRole: string): boolean;
/** /**
* Get randomisation settings for bot from config/bot.json * Get randomization settings for bot from config/bot.json
* @param botLevel level of bot * @param botLevel level of bot
* @param botEquipConfig bot equipment json * @param botEquipConfig bot equipment json
* @returns RandomisationDetails * @returns RandomisationDetails
*/ */
getBotRandomisationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails;
/** /**
* Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec
* @returns pmc role * @returns pmc role
*/ */
getRandomisedPmcRole(): string; getRandomizedPmcRole(): string;
/** /**
* Get the corrisponding side when sptBear or sptUsec is passed in * Get the corresponding side when sptBear or sptUsec is passed in
* @param botRole role to get side for * @param botRole role to get side for
* @returns side (usec/bear) * @returns side (usec/bear)
*/ */
getPmcSideByRole(botRole: string): string; getPmcSideByRole(botRole: string): string;
/** /**
* Get a randomised PMC side based on bot config value 'isUsec' * Get a randomized PMC side based on bot config value 'isUsec'
* @returns pmc side as string * @returns pmc side as string
*/ */
protected getRandomisedPmcSide(): string; protected getRandomizedPmcSide(): string;
} }

View File

@ -22,18 +22,18 @@ export declare class BotWeaponGeneratorHelper {
protected containerHelper: ContainerHelper; protected containerHelper: ContainerHelper;
constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper);
/** /**
* Get a randomised number of bullets for a specific magazine * Get a randomized number of bullets for a specific magazine
* @param magCounts min and max count of magazines * @param magCounts min and max count of magazines
* @param magTemplate magazine to generate bullet count for * @param magTemplate magazine to generate bullet count for
* @returns bullet count number * @returns bullet count number
*/ */
getRandomisedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number;
/** /**
* Get a randomised count of magazines * Get a randomized count of magazines
* @param magCounts min and max value returned value can be between * @param magCounts min and max value returned value can be between
* @returns numberical value of magazine count * @returns numerical value of magazine count
*/ */
getRandomisedMagazineCount(magCounts: MinMax): number; getRandomizedMagazineCount(magCounts: MinMax): number;
/** /**
* Is this magazine cylinder related (revolvers and grenade launchers) * Is this magazine cylinder related (revolvers and grenade launchers)
* @param magazineParentName the name of the magazines parent * @param magazineParentName the name of the magazines parent
@ -49,11 +49,11 @@ export declare class BotWeaponGeneratorHelper {
*/ */
createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[];
/** /**
* Add a specific number of cartrdiges to a bots inventory (defaults to vest and pockets) * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets)
* @param ammoTpl Ammo tpl to add to vest/pockets * @param ammoTpl Ammo tpl to add to vest/pockets
* @param cartridgeCount number of cartridges to add to vest/pockets * @param cartridgeCount number of cartridges to add to vest/pockets
* @param inventory bot inventory to add cartridges to * @param inventory bot inventory to add cartridges to
* @param equipmentSlotsToAddTo what equpiment slots should bullets be added into * @param equipmentSlotsToAddTo what equipment slots should bullets be added into
*/ */
addAmmoIntoEquipmentSlots(ammoTpl: string, cartridgeCount: number, inventory: Inventory, equipmentSlotsToAddTo?: EquipmentSlots[]): void; addAmmoIntoEquipmentSlots(ammoTpl: string, cartridgeCount: number, inventory: Inventory, equipmentSlotsToAddTo?: EquipmentSlots[]): void;
/** /**
@ -63,7 +63,8 @@ export declare class BotWeaponGeneratorHelper {
*/ */
getWeaponsDefaultMagazineTpl(weaponTemplate: ITemplateItem): string; getWeaponsDefaultMagazineTpl(weaponTemplate: ITemplateItem): string;
/** /**
* Adds an item with all its childern into specified equipmentSlots, wherever it fits. * TODO - move into BotGeneratorHelper, this is not the class for it
* Adds an item with all its children into specified equipmentSlots, wherever it fits.
* @param equipmentSlots * @param equipmentSlots
* @param parentId * @param parentId
* @param parentTpl * @param parentTpl

View File

@ -9,10 +9,10 @@ export declare class DurabilityLimitsHelper {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(randomUtil: RandomUtil, botHelper: BotHelper, configServer: ConfigServer); constructor(randomUtil: RandomUtil, botHelper: BotHelper, configServer: ConfigServer);
getRandomisedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number;
getRandomisedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number;
getRandomisedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number;
getRandomisedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number;
protected generateMaxWeaponDurability(botRole: string): number; protected generateMaxWeaponDurability(botRole: string): number;
protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number;
protected getLowestMaxWeaponFromConfig(botRole: string): number; protected getLowestMaxWeaponFromConfig(botRole: string): number;

View File

@ -16,7 +16,7 @@ export declare class HealthHelper {
protected healthConfig: IHealthConfig; protected healthConfig: IHealthConfig;
constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer);
/** /**
* Resets the profiles vitality/healh and vitality/effects properties to their defaults * Resets the profiles vitality/health and vitality/effects properties to their defaults
* @param sessionID Session Id * @param sessionID Session Id
* @returns updated profile * @returns updated profile
*/ */
@ -24,13 +24,13 @@ export declare class HealthHelper {
/** /**
* Update player profile with changes from request object * Update player profile with changes from request object
* @param pmcData Player profile * @param pmcData Player profile
* @param info Request object * @param request Heal request
* @param sessionID Session id * @param sessionID Session id
* @param addEffects Should effects be added or removed (default - add) * @param addEffects Should effects be added or removed (default - add)
*/ */
saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
/** /**
* Adjust hydration/energy/temprate and body part hp values in player profile * Adjust hydration/energy/temperate and body part hp values in player profile to values in profile.vitality
* @param pmcData Profile to update * @param pmcData Profile to update
* @param sessionId Session id * @param sessionId Session id
*/ */

View File

@ -2,7 +2,8 @@ import { IPmcData } from "../models/eft/common/IPmcData";
import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "../models/eft/common/tables/IBotBase"; import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "../models/eft/common/tables/IBotBase";
import { Upd } from "../models/eft/common/tables/IItem"; import { Upd } from "../models/eft/common/tables/IItem";
import { StageBonus } from "../models/eft/hideout/IHideoutArea"; import { StageBonus } from "../models/eft/hideout/IHideoutArea";
import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData"; import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData";
import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData"; import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
@ -15,7 +16,6 @@ import { LocalisationService } from "../services/LocalisationService";
import { PlayerService } from "../services/PlayerService"; import { PlayerService } from "../services/PlayerService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
import { InventoryHelper } from "./InventoryHelper"; import { InventoryHelper } from "./InventoryHelper";
import { ProfileHelper } from "./ProfileHelper"; import { ProfileHelper } from "./ProfileHelper";
@ -23,7 +23,6 @@ export declare class HideoutHelper {
protected logger: ILogger; protected logger: ILogger;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
@ -37,11 +36,12 @@ export declare class HideoutHelper {
static bitcoin: string; static bitcoin: string;
static expeditionaryFuelTank: string; static expeditionaryFuelTank: string;
static maxSkillPoint: number; static maxSkillPoint: number;
private static generatorOffMultipler;
protected hideoutConfig: IHideoutConfig; protected hideoutConfig: IHideoutConfig;
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, configServer: ConfigServer);
registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* This convinience function intialies new Production Object * This convenience function initializes new Production Object
* with all the constants. * with all the constants.
*/ */
initProduction(recipeId: string, productionTime: number): Production; initProduction(recipeId: string, productionTime: number): Production;
@ -82,6 +82,26 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}): void; }): void;
/**
* Update a productions progress value based on the amount of time that has passed
* @param pmcData Player profile
* @param prodId Production id being crafted
* @param recipe Recipe data being crafted
* @param hideoutProperties
*/
protected updateProductionProgress(pmcData: IPmcData, prodId: string, recipe: IHideoutProduction, hideoutProperties: {
btcFarmCGs?: number;
isGeneratorOn: boolean;
waterCollectorHasFilter?: boolean;
}): void;
/**
* Check if a productions progress value matches its corresponding recipes production time value
* @param pmcData Player profile
* @param prodId Production id
* @param recipe Recipe being crafted
* @returns progress matches productionTime from recipe
*/
protected doesProgressMatchProductionTime(pmcData: IPmcData, prodId: string): boolean;
/** /**
* Update progress timer for scav case * Update progress timer for scav case
* @param pmcData Profile to update * @param pmcData Profile to update
@ -106,7 +126,7 @@ export declare class HideoutHelper {
* Adjust water filter objects resourceValue or delete when they reach 0 resource * Adjust water filter objects resourceValue or delete when they reach 0 resource
* @param waterFilterArea water filter area to update * @param waterFilterArea water filter area to update
* @param production production object * @param production production object
* @param isGeneratorOn is generatory enabled * @param isGeneratorOn is generator enabled
* @param pmcData Player profile * @param pmcData Player profile
* @returns Updated HideoutArea object * @returns Updated HideoutArea object
*/ */
@ -114,6 +134,11 @@ export declare class HideoutHelper {
protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd; protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd;
protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): void; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): void;
protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production;
/**
* Get a count of how many BTC can be gathered by the profile
* @param pmcData Profile to look up
* @returns coin slot count
*/
protected getBTCSlots(pmcData: IPmcData): number; protected getBTCSlots(pmcData: IPmcData): number;
protected getManagementSkillsSlots(): number; protected getManagementSkillsSlots(): number;
protected hasManagementSkillSlots(pmcData: IPmcData): boolean; protected hasManagementSkillSlots(pmcData: IPmcData): boolean;
@ -133,7 +158,15 @@ export declare class HideoutHelper {
*/ */
protected getCraftingSkillProductionTimeReduction(pmcData: IPmcData, productionTime: number): number; protected getCraftingSkillProductionTimeReduction(pmcData: IPmcData, productionTime: number): number;
isProduction(productive: Productive): productive is Production; isProduction(productive: Productive): productive is Production;
getBTC(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; /**
* Gather crafted BTC from hideout area and add to inventory
* Reset production start timestamp if hideout area at full coin capacity
* @param pmcData Player profile
* @param request Take production request
* @param sessionId Session id
* @returns IItemEventRouterResponse
*/
getBTC(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionId: string): IItemEventRouterResponse;
/** /**
* Upgrade hideout wall from starting level to interactable level if enough time has passed * Upgrade hideout wall from starting level to interactable level if enough time has passed
* @param pmcProfile Profile to upgrade wall in * @param pmcProfile Profile to upgrade wall in

View File

@ -40,7 +40,7 @@ export declare class InRaidHelper {
* Remove Labs keycard * Remove Labs keycard
* @param profileData Profile to update * @param profileData Profile to update
* @param saveProgressRequest post raid save data request data * @param saveProgressRequest post raid save data request data
* @param sessionID Sessino id * @param sessionID Session id
* @returns Reset profile object * @returns Reset profile object
*/ */
updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): IPmcData; updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): IPmcData;
@ -66,7 +66,7 @@ export declare class InRaidHelper {
* Adds SpawnedInSession property to items found in a raid * Adds SpawnedInSession property to items found in a raid
* Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true
* @param preRaidProfile profile to update * @param preRaidProfile profile to update
* @param postRaidProfile profile to upate inventory contents of * @param postRaidProfile profile to update inventory contents of
* @param isPlayerScav Was this a p scav raid * @param isPlayerScav Was this a p scav raid
* @returns * @returns
*/ */

View File

@ -52,7 +52,7 @@ export declare class InventoryHelper {
* @param sessionID Session id * @param sessionID Session id
* @param callback Code to execute later (function) * @param callback Code to execute later (function)
* @param foundInRaid Will results added to inventory be set as found in raid * @param foundInRaid Will results added to inventory be set as found in raid
* @param addUpd Additional upd propertys for items being added to inventory * @param addUpd Additional upd properties for items being added to inventory
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
addItem(pmcData: IPmcData, request: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: { addItem(pmcData: IPmcData, request: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: {

View File

@ -30,7 +30,7 @@ declare class ItemHelper {
/** /**
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash
* @param {string} tpl the template id / tpl * @param {string} tpl the template id / tpl
* @returns boolean; true for items that may be in player posession and not quest items * @returns boolean; true for items that may be in player possession and not quest items
*/ */
isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean;
/** /**
@ -42,7 +42,7 @@ declare class ItemHelper {
*/ */
isOfBaseclass(tpl: string, baseClassTpl: string): boolean; isOfBaseclass(tpl: string, baseClassTpl: string): boolean;
/** /**
* Check if item has any of the supplied base clases * Check if item has any of the supplied base classes
* @param tpl Item to check base classes of * @param tpl Item to check base classes of
* @param baseClassTpls base classes to check for * @param baseClassTpls base classes to check for
* @returns true if any supplied base classes match * @returns true if any supplied base classes match
@ -165,7 +165,7 @@ declare class ItemHelper {
*/ */
getChildId(item: Item): string; getChildId(item: Item): string;
/** /**
* Can the pased in item be stacked * Can the passed in item be stacked
* @param tpl item to check * @param tpl item to check
* @returns true if it can be stacked * @returns true if it can be stacked
*/ */
@ -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[];
/** /**
* 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 * WARNING, SLOW. Recursively 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
@ -220,7 +220,15 @@ declare class ItemHelper {
createRandomMagCartridges(magTemplate: ITemplateItem, parentId: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, caliber?: string): Item; createRandomMagCartridges(magTemplate: ITemplateItem, parentId: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, caliber?: string): Item;
protected getRandomValidCaliber(magTemplate: ITemplateItem): string; protected getRandomValidCaliber(magTemplate: ITemplateItem): string;
protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string; protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string;
createCartidges(parentId: string, ammoTpl: string, stackCount: number): Item; /**
*
* @param parentId container cartridges will be placed in
* @param ammoTpl Cartridge to insert
* @param stackCount Count of cartridges inside parent
* @param location Location inside parent (e.g. 0, 1)
* @returns Item
*/
createCartridges(parentId: string, ammoTpl: string, stackCount: number, location: number): Item;
/** /**
* Get the size of a stack, return 1 if no stack object count property found * Get the size of a stack, return 1 if no stack object count property found
* @param item Item to get stack size of * @param item Item to get stack size of

View File

@ -6,7 +6,7 @@ export declare class NotificationSendHelper {
protected notificationService: NotificationService; protected notificationService: NotificationService;
constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); constructor(webSocketServer: WebSocketServer, notificationService: NotificationService);
/** /**
* Send notification message to the appropiate channel * Send notification message to the appropriate channel
*/ */
sendMessage(sessionID: string, notificationMessage: INotification): void; sendMessage(sessionID: string, notificationMessage: INotification): void;
} }

View File

@ -44,7 +44,7 @@ export declare class ProfileHelper {
/** /**
* Add experience to a PMC inside the players profile * Add experience to a PMC inside the players profile
* @param sessionID Session id * @param sessionID Session id
* @param experienceToAdd Experiecne to add to PMC character * @param experienceToAdd Experience to add to PMC character
*/ */
addExperienceToPmc(sessionID: string, experienceToAdd: number): void; addExperienceToPmc(sessionID: string, experienceToAdd: number): void;
getProfileByPmcId(pmcId: string): IPmcData; getProfileByPmcId(pmcId: string): IPmcData;

View File

@ -43,7 +43,7 @@ export declare class QuestHelper {
* Get status of a quest by quest id * Get status of a quest by quest id
* @param pmcData Profile to search * @param pmcData Profile to search
* @param questID Quest id to look up * @param questID Quest id to look up
* @returns QuestStauts enum * @returns QuestStatus enum
*/ */
getQuestStatus(pmcData: IPmcData, questID: string): QuestStatus; getQuestStatus(pmcData: IPmcData, questID: string): QuestStatus;
/** /**
@ -64,11 +64,10 @@ export declare class QuestHelper {
* Increase skill points of a skill on player profile * Increase skill points of a skill on player profile
* @param sessionID Session id * @param sessionID Session id
* @param pmcData Player profile * @param pmcData Player profile
* @param output output object to send back to client
* @param skillName Name of skill to increase skill points of * @param skillName Name of skill to increase skill points of
* @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, skillName: string, progressAmount: number): void;
/** /**
* Get quest name by quest id * Get quest name by quest id
* @param questId id to get * @param questId id to get
@ -76,10 +75,10 @@ export declare class QuestHelper {
*/ */
getQuestNameFromLocale(questId: string): string; getQuestNameFromLocale(questId: string): string;
/** /**
* Check if trader has sufficient loyalty to fullfill quest requirement * Check if trader has sufficient loyalty to fulfill quest requirement
* @param questProperties Quest props * @param questProperties Quest props
* @param profile Player profile * @param profile Player profile
* @returns true if loyalty is high enough to fulfil quest requirement * @returns true if loyalty is high enough to fulfill quest requirement
*/ */
traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean;
protected processReward(reward: Reward): Reward[]; protected processReward(reward: Reward): Reward[];
@ -112,12 +111,12 @@ export declare class QuestHelper {
*/ */
failedUnlocked(failedQuestId: string, sessionID: string): IQuest[]; failedUnlocked(failedQuestId: string, sessionID: string): IQuest[];
/** /**
* Adjust quest money rewards by passed in multipler * Adjust quest money rewards by passed in multiplier
* @param quest Quest to multiple money rewards * @param quest Quest to multiple money rewards
* @param multipler Value to adjust money rewards by * @param multiplier Value to adjust money rewards by
* @returns Updated quest * @returns Updated quest
*/ */
applyMoneyBoost(quest: IQuest, multipler: number): IQuest; applyMoneyBoost(quest: IQuest, multiplier: number): IQuest;
/** /**
* Sets the item stack to new value, or delete the item if value <= 0 * Sets the item stack to new value, or delete the item if value <= 0
* // TODO maybe merge this function and the one from customization * // TODO maybe merge this function and the one from customization
@ -128,12 +127,6 @@ export declare class QuestHelper {
* @param output ItemEvent router response * @param output ItemEvent router response
*/ */
changeItemStack(pmcData: IPmcData, itemId: string, newStackSize: number, sessionID: string, output: IItemEventRouterResponse): void; changeItemStack(pmcData: IPmcData, itemId: string, newStackSize: number, sessionID: string, output: IItemEventRouterResponse): void;
/**
* Get List of All Quests from db
* NOT CLONED
* @returns Array of IQuest objects
*/
getQuestsFromDb(): IQuest[];
/** /**
* Get quests, strip all requirement conditions except level * Get quests, strip all requirement conditions except level
* @param quests quests to process * @param quests quests to process
@ -154,6 +147,12 @@ export declare class QuestHelper {
* @returns Item event router response * @returns Item event router response
*/ */
failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Get List of All Quests from db
* NOT CLONED
* @returns Array of IQuest objects
*/
getQuestsFromDb(): IQuest[];
/** /**
* Get quest by id from database (repeatables are stored in profile, check there if questId not found) * Get quest by id from database (repeatables are stored in profile, check there if questId not found)
* @param questId Id of quest to find * @param questId Id of quest to find
@ -163,14 +162,14 @@ export declare class QuestHelper {
getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestFromDb(questId: string, pmcData: IPmcData): IQuest;
/** /**
* Get the locale Id from locale db for a quest message * Get the locale Id from locale db for a quest message
* @param questMessageId Quest mesage id to look up * @param questMessageId Quest message id to look up
* @returns Locale Id from locale db * @returns Locale Id from locale db
*/ */
getQuestLocaleIdFromDb(questMessageId: string): string; getQuestLocaleIdFromDb(questMessageId: string): string;
/** /**
* Alter a quests state + Add a record to its status timers object * Alter a quests state + Add a record to its status timers object
* @param pmcData Profile to update * @param pmcData Profile to update
* @param newQuestState New state the qeust should be in * @param newQuestState New state the quest should be in
* @param questId Id of the quest to alter the status of * @param questId Id of the quest to alter the status of
*/ */
updateQuestState(pmcData: IPmcData, newQuestState: QuestStatus, questId: string): void; updateQuestState(pmcData: IPmcData, newQuestState: QuestStatus, questId: string): void;

View File

@ -48,6 +48,12 @@ export declare class RagfairOfferHelper {
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[]; getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
/**
* Has a traders offer ran out of stock to sell to player
* @param offer Offer to check stock of
* @returns true if out of stock
*/
protected traderOutOfStock(offer: IRagfairOffer): boolean;
/** /**
* Check if trader offers' BuyRestrictionMax value has been reached * Check if trader offers' BuyRestrictionMax value has been reached
* @param offer offer to check restriction properties of * @param offer offer to check restriction properties of

View File

@ -30,7 +30,7 @@ export declare class RagfairSellHelper {
* 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
* @param itemSellCount count of items to sell * @param itemSellCount count of items to sell
* @returns Array of purchases of item(s) lsited * @returns Array of purchases of item(s) listed
*/ */
rollForSale(sellChancePercent: number, itemSellCount: number): SellResult[]; rollForSale(sellChancePercent: number, itemSellCount: number): SellResult[];
} }

View File

@ -7,7 +7,7 @@ export declare class RagfairSortHelper {
protected localeService: LocaleService; protected localeService: LocaleService;
constructor(databaseServer: DatabaseServer, localeService: LocaleService); constructor(databaseServer: DatabaseServer, localeService: LocaleService);
/** /**
* Sort a list of ragfair offers by something (id/rating/offer name/price/expirty time) * Sort a list of ragfair offers by something (id/rating/offer name/price/expiry time)
* @param offers Offers to sort * @param offers Offers to sort
* @param type How to sort it * @param type How to sort it
* @param direction Ascending/descending * @param direction Ascending/descending

View File

@ -24,7 +24,12 @@ export declare class RepairHelper {
* @param applyMaxDurabilityDegradation should item have max durability reduced * @param applyMaxDurabilityDegradation should item have max durability reduced
*/ */
updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void;
protected getRandomisedArmorRepairDegredationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number;
protected getRandomisedWeaponRepairDegredationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number;
/**
* Is the supplied tpl a weapon
* @param tpl tplId to check is a weapon
* @returns true if tpl is a weapon
*/
isWeaponTemplate(tpl: string): boolean; isWeaponTemplate(tpl: string): boolean;
} }

View File

@ -45,7 +45,7 @@ export declare class TradeHelper {
sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Increment the assorts buy count by number of items purchased * Increment the assorts buy count by number of items purchased
* Show error on screen if player attepts to buy more than what the buy max allows * Show error on screen if player attempts to buy more than what the buy max allows
* @param assortBeingPurchased assort being bought * @param assortBeingPurchased assort being bought
* @param itemsPurchasedCount number of items being bought * @param itemsPurchasedCount number of items being bought
*/ */

View File

@ -35,6 +35,8 @@ export declare class TraderAssortHelper {
protected fenceService: FenceService; protected fenceService: FenceService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected traderConfig: ITraderConfig; protected traderConfig: ITraderConfig;
protected mergedQuestAssorts: Record<string, Record<string, string>>;
protected createdMergedQuestAssorts: boolean;
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); 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
@ -45,6 +47,10 @@ export declare class TraderAssortHelper {
* @returns a traders' assorts * @returns a traders' assorts
*/ */
getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort;
/**
* Create a dict of all assort id = quest id mappings used to work out what items should be shown to player based on the quests they've started/completed/failed
*/
protected hydrateMergedQuestAssorts(): void;
/** /**
* Reset a traders assorts and move nextResupply value to future * Reset a traders assorts and move nextResupply value to future
* Flag trader as needing a flea offer reset to be picked up by flea update() function * Flag trader as needing a flea offer reset to be picked up by flea update() function
@ -61,7 +67,7 @@ export declare class TraderAssortHelper {
* Iterate over all assorts barter_scheme values, find barters selling for money and multiply by multipler in config * Iterate over all assorts barter_scheme values, find barters selling for money and multiply by multipler in config
* @param traderAssort Assorts to multiple price of * @param traderAssort Assorts to multiple price of
*/ */
protected multiplyItemPricesByConfigMultipler(traderAssort: ITraderAssort): void; protected multiplyItemPricesByConfigMultiplier(traderAssort: ITraderAssort): void;
/** /**
* Get an array of pristine trader items prior to any alteration by player (as they were on server start) * Get an array of pristine trader items prior to any alteration by player (as they were on server start)
* @param traderId trader id * @param traderId trader id

View File

@ -29,6 +29,8 @@ export declare class TraderHelper {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected traderConfig: ITraderConfig; protected traderConfig: ITraderConfig;
/** Dictionary of item tpl and the highest trader rouble price */
protected highestTraderPriceItems: Record<string, number>;
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer);
getTrader(traderID: string, sessionID: string): ITraderBase; getTrader(traderID: string, sessionID: string): ITraderBase;
getTraderAssortsById(traderId: string): ITraderAssort; getTraderAssortsById(traderId: string): ITraderAssort;
@ -41,11 +43,11 @@ export declare class TraderHelper {
resetTrader(sessionID: string, traderID: string): void; resetTrader(sessionID: string, traderID: string): void;
/** /**
* Alter a traders unlocked status * Alter a traders unlocked status
* @param traderID Trader to alter * @param traderId Trader to alter
* @param status New status to use * @param status New status to use
* @param sessionID Session id * @param sessionId Session id
*/ */
setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; setTraderUnlockedState(traderId: string, status: boolean, sessionId: string): void;
/** /**
* Get a list of items and their prices from player inventory that can be sold to a trader * Get a list of items and their prices from player inventory that can be sold to a trader
* @param traderID trader id being traded with * @param traderID trader id being traded with
@ -77,7 +79,7 @@ export declare class TraderHelper {
protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; protected getTraderDurabiltyPurchaseThreshold(traderId: string): number;
/** /**
* Get the price of passed in item and all of its attached children (mods) * Get the price of passed in item and all of its attached children (mods)
* Take into account bonuses/adjsutments e.g. discounts * Take into account bonuses/adjustments e.g. discounts
* @param pmcData profile data * @param pmcData profile data
* @param item item to calculate price of * @param item item to calculate price of
* @param buyPriceCoefficient * @param buyPriceCoefficient
@ -104,11 +106,11 @@ export declare class TraderHelper {
protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number;
/** /**
* Add standing to a trader and level them up if exp goes over level threshold * Add standing to a trader and level them up if exp goes over level threshold
* @param sessionID Session id * @param sessionId Session id
* @param traderId traders id * @param traderId Traders id
* @param standingToAdd Standing value to add to trader * @param standingToAdd Standing value to add to trader
*/ */
addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; addStandingToTrader(sessionId: string, traderId: string, standingToAdd: number): void;
/** /**
* Calculate traders level based on exp amount and increments level if over threshold * Calculate traders level based on exp amount and increments level if over threshold
* @param traderID trader to process * @param traderID trader to process
@ -147,4 +149,10 @@ export declare class TraderHelper {
}[]; }[];
tid: string; tid: string;
}): void; }): void;
/**
* Get the highest rouble price for an item from traders
* @param tpl Item to look up highest pride for
* @returns highest rouble cost for item
*/
getHighestTraderPriceRouble(tpl: string): number;
} }

View File

@ -19,4 +19,11 @@ export declare class BundleLoader {
getBundle(key: string, local: boolean): BundleInfo; getBundle(key: string, local: boolean): BundleInfo;
addBundles(modpath: string): void; addBundles(modpath: string): void;
} }
export interface BundleManifest {
manifest: Array<BundleManifestEntry>;
}
export interface BundleManifestEntry {
key: string;
path: string;
}
export {}; export {};

View File

@ -0,0 +1,43 @@
import { IPostAkiLoadMod } from "../models/external/IPostAkiLoadMod";
import { IPostAkiLoadModAsync } from "../models/external/IPostAkiLoadModAsync";
import { IPostDBLoadMod } from "../models/external/IPostDBLoadMod";
import { IPostDBLoadModAsync } from "../models/external/IPostDBLoadModAsync";
import { IPreAkiLoadMod } from "../models/external/IPreAkiLoadMod";
import { IPreAkiLoadModAsync } from "../models/external/IPreAkiLoadModAsync";
export declare class ModTypeCheck {
/**
* Use defined safe guard to check if the mod is a IPreAkiLoadMod
* @returns boolean
*/
isPreAkiLoad(mod: any): mod is IPreAkiLoadMod;
/**
* Use defined safe guard to check if the mod is a IPostAkiLoadMod
* @returns boolean
*/
isPostAkiLoad(mod: any): mod is IPostAkiLoadMod;
/**
* Use defined safe guard to check if the mod is a IPostDBLoadMod
* @returns boolean
*/
isPostDBAkiLoad(mod: any): mod is IPostDBLoadMod;
/**
* Use defined safe guard to check if the mod is a IPreAkiLoadModAsync
* @returns boolean
*/
isPreAkiLoadAsync(mod: any): mod is IPreAkiLoadModAsync;
/**
* Use defined safe guard to check if the mod is a IPostAkiLoadModAsync
* @returns boolean
*/
isPostAkiLoadAsync(mod: any): mod is IPostAkiLoadModAsync;
/**
* Use defined safe guard to check if the mod is a IPostDBLoadModAsync
* @returns boolean
*/
isPostDBAkiLoadAsync(mod: any): mod is IPostDBLoadModAsync;
/**
* Checks for mod to be compatible with 3.X+
* @returns boolean
*/
isPostV3Compatible(mod: any): boolean;
}

View File

@ -1,21 +1,17 @@
import { DependencyContainer } from "tsyringe"; import { DependencyContainer } from "tsyringe";
import { HandbookController } from "../controllers/HandbookController";
import { IModLoader } from "../models/spt/mod/IModLoader"; import { IModLoader } from "../models/spt/mod/IModLoader";
import { ModCompilerService } from "../services/ModCompilerService";
import { VFS } from "../utils/VFS"; import { VFS } from "../utils/VFS";
import { BundleLoader } from "./BundleLoader"; import { BundleLoader } from "./BundleLoader";
import { ModTypeCheck } from "./ModTypeCheck";
import { PreAkiModLoader } from "./PreAkiModLoader"; import { PreAkiModLoader } from "./PreAkiModLoader";
export declare class PostAkiModLoader implements IModLoader { export declare class PostAkiModLoader implements IModLoader {
protected bundleLoader: BundleLoader; protected bundleLoader: BundleLoader;
protected handbookController: HandbookController;
protected vfs: VFS; protected vfs: VFS;
protected modCompilerService: ModCompilerService;
protected preAkiModLoader: PreAkiModLoader; protected preAkiModLoader: PreAkiModLoader;
constructor(bundleLoader: BundleLoader, handbookController: HandbookController, vfs: VFS, modCompilerService: ModCompilerService, preAkiModLoader: PreAkiModLoader); protected modTypeCheck: ModTypeCheck;
getBundles(local: boolean): string; constructor(bundleLoader: BundleLoader, vfs: VFS, preAkiModLoader: PreAkiModLoader, modTypeCheck: ModTypeCheck);
getBundle(key: string, local: boolean): void;
getModPath(mod: string): string; getModPath(mod: string): string;
load(): void; load(): Promise<void>;
protected executeMods(container: DependencyContainer): void; protected executeMods(container: DependencyContainer): Promise<void>;
protected addBundles(): void; protected addBundles(): void;
} }

View File

@ -1,11 +1,13 @@
import { DependencyContainer } from "tsyringe"; import { DependencyContainer } from "tsyringe";
import { OnLoad } from "../di/OnLoad"; import { OnLoad } from "../di/OnLoad";
import { ModTypeCheck } from "./ModTypeCheck";
import { PreAkiModLoader } from "./PreAkiModLoader"; import { PreAkiModLoader } from "./PreAkiModLoader";
export declare class PostDBModLoader implements OnLoad { export declare class PostDBModLoader implements OnLoad {
protected preAkiModLoader: PreAkiModLoader; protected preAkiModLoader: PreAkiModLoader;
constructor(preAkiModLoader: PreAkiModLoader); protected modTypeCheck: ModTypeCheck;
constructor(preAkiModLoader: PreAkiModLoader, modTypeCheck: ModTypeCheck);
onLoad(): Promise<void>; onLoad(): Promise<void>;
getRoute(): string; getRoute(): string;
getModPath(mod: string): string; getModPath(mod: string): string;
protected executeMods(container: DependencyContainer): void; protected executeMods(container: DependencyContainer): Promise<void>;
} }

View File

@ -1,9 +1,5 @@
import { DependencyContainer } from "tsyringe"; import { DependencyContainer } from "tsyringe";
import { IPostAkiLoadMod } from "../models/external/IPostAkiLoadMod";
import { IPostDBLoadMod } from "../models/external/IPostDBLoadMod";
import { IPreAkiLoadMod } from "../models/external/IPreAkiLoadMod";
import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { ModLoader } from "../models/spt/mod/IMod";
import { IModLoader } from "../models/spt/mod/IModLoader"; import { IModLoader } from "../models/spt/mod/IModLoader";
import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
@ -13,6 +9,7 @@ import { ModCompilerService } from "../services/ModCompilerService";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { VFS } from "../utils/VFS"; import { VFS } from "../utils/VFS";
import { BundleLoader } from "./BundleLoader"; import { BundleLoader } from "./BundleLoader";
import { ModTypeCheck } from "./ModTypeCheck";
export declare class PreAkiModLoader implements IModLoader { export declare class PreAkiModLoader implements IModLoader {
protected logger: ILogger; protected logger: ILogger;
protected vfs: VFS; protected vfs: VFS;
@ -21,24 +18,22 @@ export declare class PreAkiModLoader implements IModLoader {
protected bundleLoader: BundleLoader; protected bundleLoader: BundleLoader;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected modTypeCheck: ModTypeCheck;
protected static container: DependencyContainer; protected static container: DependencyContainer;
protected readonly basepath = "user/mods/"; protected readonly basepath = "user/mods/";
protected readonly modOrderPath = "user/mods/order.json"; protected readonly modOrderPath = "user/mods/order.json";
protected order: Record<string, number>; protected order: Record<string, number>;
protected imported: Record<string, ModLoader.IMod>; protected imported: Record<string, IPackageJsonData>;
protected akiConfig: ICoreConfig; protected akiConfig: ICoreConfig;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modTypeCheck: ModTypeCheck);
load(container: DependencyContainer): Promise<void>; load(container: DependencyContainer): Promise<void>;
getBundles(local: boolean): string;
getBundle(key: string, local: boolean): void;
/** /**
* Returns a list of mods with preserved load order * Returns a list of mods with preserved load order
* @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>; getImportedModDetails(): Record<string, IPackageJsonData>;
getModPath(mod: string): string; getModPath(mod: string): string;
protected importClass(name: string, filepath: string, container: DependencyContainer): void;
protected importMods(): Promise<void>; protected importMods(): Promise<void>;
/** /**
* Check for duplciate mods loaded, show error if duplicate mod found * Check for duplciate mods loaded, show error if duplicate mod found
@ -63,29 +58,8 @@ export declare class PreAkiModLoader implements IModLoader {
* @returns dictionary <modName - package.json> * @returns dictionary <modName - package.json>
*/ */
protected getModsPackageData(mods: string[]): Record<string, IPackageJsonData>; protected getModsPackageData(mods: string[]): Record<string, IPackageJsonData>;
/**
* Use defined safe guard to check if the mod is a IPreAkiLoadMod
* @returns boolean
*/
protected isPreAkiLoad(mod: any): mod is IPreAkiLoadMod;
/**
* Use defined safe guard to check if the mod is a IPostAkiLoadMod
* @returns boolean
*/
protected isPostAkiLoad(mod: any): mod is IPostAkiLoadMod;
/**
* Use defined safe guard to check if the mod is a IPostDBLoadMod
* @returns boolean
*/
protected isPostDBAkiLoad(mod: any): mod is IPostDBLoadMod;
/**
* Check that the mod is compatible with SPT 3.X.X
* @param mod the mod to check
* @returns boolean
*/
protected isModSpt3XXCompatible(mod: any): boolean;
protected isModCombatibleWithAki(mod: IPackageJsonData): boolean; protected isModCombatibleWithAki(mod: IPackageJsonData): boolean;
protected executeMods(container: DependencyContainer): void; protected executeMods(container: DependencyContainer): Promise<void>;
sortModsLoadOrder(): string[]; sortModsLoadOrder(): string[];
protected addMod(mod: string): Promise<void>; protected addMod(mod: string): Promise<void>;
protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record<string, IPackageJsonData>): boolean; protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record<string, IPackageJsonData>): boolean;
@ -97,6 +71,6 @@ export declare class PreAkiModLoader implements IModLoader {
*/ */
protected validMod(modName: string): boolean; protected validMod(modName: string): boolean;
protected getLoadOrderRecursive(mod: string, result: Record<string, string>, visited: Record<string, string>): void; protected getLoadOrderRecursive(mod: string, result: Record<string, string>, visited: Record<string, string>): void;
protected getLoadOrder(mods: Record<string, ModLoader.IMod>): Record<string, string>; protected getLoadOrder(mods: Record<string, IPackageJsonData>): Record<string, string>;
getContainer(): DependencyContainer; getContainer(): DependencyContainer;
} }

View File

@ -31,6 +31,7 @@ export interface Config {
TimeBeforeDeployLocal: number; TimeBeforeDeployLocal: number;
TradingSetting: number; TradingSetting: number;
TradingSettings: ITradingSettings; TradingSettings: ITradingSettings;
ItemsCommonSettings: IItemsCommonSettings;
LoadTimeSpeedProgress: number; LoadTimeSpeedProgress: number;
BaseLoadTime: number; BaseLoadTime: number;
BaseUnloadTime: number; BaseUnloadTime: number;
@ -84,12 +85,16 @@ export interface Config {
TestValue: number; TestValue: number;
Inertia: Inertia; Inertia: Inertia;
Ballistic: Ballistic; Ballistic: Ballistic;
RepairSettings: RepairSettings;
} }
export interface IBufferZone { export interface IBufferZone {
CustomerAccessTime: number; CustomerAccessTime: number;
CustomerCriticalTimeStart: number; CustomerCriticalTimeStart: number;
CustomerKickNotifTime: number; CustomerKickNotifTime: number;
} }
export interface IItemsCommonSettings {
ItemRemoveAfterInterruptionTime: number;
}
export interface ITradingSettings { export interface ITradingSettings {
BuyoutRestrictions: IBuyoutRestrictions; BuyoutRestrictions: IBuyoutRestrictions;
} }

View File

@ -180,6 +180,7 @@ export interface Exit {
EntryPoints: string; EntryPoints: string;
ExfiltrationTime: number; ExfiltrationTime: number;
ExfiltrationType: string; ExfiltrationType: string;
RequiredSlot?: string;
Id: string; Id: string;
MaxTime: number; MaxTime: number;
MinTime: number; MinTime: number;

View File

@ -104,7 +104,10 @@ export interface BodyPartsHealth {
} }
export interface BodyPartHealth { export interface BodyPartHealth {
Health: CurrentMax; Health: CurrentMax;
Effects?: Record<string, number>; Effects?: Record<string, BodyPartEffectProperties>;
}
export interface BodyPartEffectProperties {
Time: number;
} }
export interface CurrentMax { export interface CurrentMax {
Current: number; Current: number;
@ -124,7 +127,6 @@ export interface FastPanel {
export interface Skills { export interface Skills {
Common: Common[]; Common: Common[];
Mastering: Mastering[]; Mastering: Mastering[];
Bonuses?: any[];
Points: number; Points: number;
} }
export interface Common { export interface Common {
@ -270,6 +272,7 @@ export interface Hideout {
Production: Record<string, Productive>; Production: Record<string, Productive>;
Areas: HideoutArea[]; Areas: HideoutArea[];
Improvements: Record<string, IHideoutImprovement>; Improvements: Record<string, IHideoutImprovement>;
sptUpdateLastRunTimestamp: number;
} }
export interface IHideoutImprovement { export interface IHideoutImprovement {
completed: boolean; completed: boolean;
@ -277,11 +280,15 @@ export interface IHideoutImprovement {
} }
export interface Productive { export interface Productive {
Products: Product[]; Products: Product[];
/** Seconds passed of production */
Progress?: number; Progress?: number;
/** Is craft in some state of being worked on by client (crafting/ready to pick up) */
inProgress?: boolean; inProgress?: boolean;
StartTimestamp?: number; StartTimestamp?: number;
SkipTime?: number; SkipTime?: number;
/** Seconds needed to fully craft */
ProductionTime?: number; ProductionTime?: number;
sptIsScavCase?: boolean;
} }
export interface Production extends Productive { export interface Production extends Productive {
RecipeId: string; RecipeId: string;

View File

@ -17,6 +17,7 @@ export interface Upd {
StackObjectsCount?: number; StackObjectsCount?: number;
UnlimitedCount?: boolean; UnlimitedCount?: boolean;
Repairable?: Repairable; Repairable?: Repairable;
RecodableComponent?: RecodableComponent;
FireMode?: FireMode; FireMode?: FireMode;
SpawnedInSession?: boolean; SpawnedInSession?: boolean;
Light?: Light; Light?: Light;
@ -59,6 +60,9 @@ export interface Repairable {
Durability: number; Durability: number;
MaxDurability: number; MaxDurability: number;
} }
export interface RecodableComponent {
IsEncoded: boolean;
}
export interface MedKit { export interface MedKit {
HpResource: number; HpResource: number;
} }

View File

@ -47,6 +47,7 @@ export interface IRepeatableQuest {
canShowNotificationsInGame: boolean; canShowNotificationsInGame: boolean;
rewards: IRewards; rewards: IRewards;
conditions: IConditions; conditions: IConditions;
side: string;
name: string; name: string;
note: string; note: string;
description: string; description: string;

View File

@ -159,7 +159,7 @@ export interface Props {
RigLayoutName?: string; RigLayoutName?: string;
MaxDurability?: number; MaxDurability?: number;
armorZone?: string[]; armorZone?: string[];
armorClass?: any; armorClass?: string | number;
mousePenalty?: number; mousePenalty?: number;
weaponErgonomicPenalty?: number; weaponErgonomicPenalty?: number;
BluntThroughput?: number; BluntThroughput?: number;

View File

@ -1,4 +1,4 @@
export interface IHideoutContinousProductionStartRequestData { export interface IHideoutContinuousProductionStartRequestData {
Action: "HideoutContinuousProductionStart"; Action: "HideoutContinuousProductionStart";
recipeId: string; recipeId: string;
timestamp: number; timestamp: number;

View File

@ -1,5 +1,5 @@
import { QuestStatus } from "../../../models/enums/QuestStatus"; import { QuestStatus } from "../../../models/enums/QuestStatus";
import { Skills } from "../common/tables/IBotBase"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase";
import { Item, Upd } from "../common/tables/IItem"; import { Item, Upd } from "../common/tables/IItem";
import { IQuest } from "../common/tables/IQuest"; import { IQuest } from "../common/tables/IQuest";
import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests";
@ -22,11 +22,12 @@ export interface ProfileChange {
ragFairOffers: IRagfairOffer[]; ragFairOffers: IRagfairOffer[];
builds: BuildChange[]; builds: BuildChange[];
items: ItemChanges; items: ItemChanges;
production: Record<string, Production>; production: Record<string, Productive>;
/** Hideout area improvement id */ /** Hideout area improvement id */
improvements: Record<string, Improvement>; improvements: Record<string, Improvement>;
skills: Skills; skills: Skills;
traderRelations: Record<string, TraderRelations>; health: Health;
traderRelations: Record<string, TraderInfo>;
repeatableQuests?: IPmcDataRepeatableQuest[]; repeatableQuests?: IPmcDataRepeatableQuest[];
recipeUnlocked: Record<string, boolean>; recipeUnlocked: Record<string, boolean>;
questsStatus: QuestStatusChange[]; questsStatus: QuestStatusChange[];
@ -50,14 +51,6 @@ export interface ItemChanges {
change: Product[]; change: Product[];
del: Product[]; del: Product[];
} }
export interface Production {
Progress: number;
StartTimestamp: number;
ProductionTime: number;
inProgress: boolean;
RecipeId: string;
Products: Product[];
}
export interface Improvement { export interface Improvement {
completed: boolean; completed: boolean;
improveCompleteTimestamp: number; improveCompleteTimestamp: number;
@ -76,10 +69,3 @@ export interface ItemChangeLocation {
r: number; r: number;
isSearched?: boolean; isSearched?: boolean;
} }
export interface TraderRelations {
salesSum?: number;
standing?: number;
loyalty?: number;
unlocked?: boolean;
disabled?: boolean;
}

View File

@ -6,6 +6,8 @@ export interface IJoinMatchResult {
port: number; port: number;
version: string; version: string;
location: string; location: string;
gamemode: string; raidMode: string;
mode: string;
shortid: string; shortid: string;
additional_info: any[];
} }

View File

@ -6,7 +6,13 @@ export interface ProfileData {
profileid: string; profileid: string;
profileToken: string; profileToken: string;
status: string; status: string;
sid: string;
ip: string; ip: string;
port: number; port: number;
sid: string;
version?: string;
location?: string;
raidMode?: string;
mode?: string;
shortId?: string;
additional_info?: any[];
} }

View File

@ -23,6 +23,7 @@ export interface IRagfairOffer {
summaryCost: number; summaryCost: number;
user: IRagfairOfferUser; user: IRagfairOfferUser;
notAvailable: boolean; notAvailable: boolean;
/** TODO - implement this value - not currently used */
CurrentItemCount: number; CurrentItemCount: number;
priority: boolean; priority: boolean;
} }

View File

@ -0,0 +1,4 @@
import { DependencyContainer } from "./tsyringe";
export interface IPostAkiLoadModAsync {
postAkiLoadAsync(container: DependencyContainer): Promise<void>;
}

View File

@ -0,0 +1,4 @@
import { DependencyContainer } from "./tsyringe";
export interface IPostDBLoadModAsync {
postDBLoadAsync(container: DependencyContainer): Promise<void>;
}

View File

@ -0,0 +1,4 @@
import { DependencyContainer } from "./tsyringe";
export interface IPreAkiLoadModAsync {
preAkiLoadAsync(container: DependencyContainer): Promise<void>;
}

View File

@ -6,7 +6,7 @@ import { IHideoutPutItemInRequestData } from "../../eft/hideout/IHideoutPutItemI
import { IHideoutTakeItemOutRequestData } from "../../eft/hideout/IHideoutTakeItemOutRequestData"; import { IHideoutTakeItemOutRequestData } from "../../eft/hideout/IHideoutTakeItemOutRequestData";
import { IHideoutToggleAreaRequestData } from "../../eft/hideout/IHideoutToggleAreaRequestData"; import { IHideoutToggleAreaRequestData } from "../../eft/hideout/IHideoutToggleAreaRequestData";
import { IHideoutSingleProductionStartRequestData } from "../../eft/hideout/IHideoutSingleProductionStartRequestData"; import { IHideoutSingleProductionStartRequestData } from "../../eft/hideout/IHideoutSingleProductionStartRequestData";
import { IHideoutContinousProductionStartRequestData } from "../../eft/hideout/IHideoutContinousProductionStartRequestData"; import { IHideoutContinuousProductionStartRequestData } from "../../eft/hideout/IHideoutContinuousProductionStartRequestData";
import { IHideoutTakeProductionRequestData } from "../../eft/hideout/IHideoutTakeProductionRequestData"; import { IHideoutTakeProductionRequestData } from "../../eft/hideout/IHideoutTakeProductionRequestData";
import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse";
export interface IHideoutCallbacks { export interface IHideoutCallbacks {
@ -17,7 +17,7 @@ export interface IHideoutCallbacks {
toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse; singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse; scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse;
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
update(timeSinceLastRun: number): boolean; update(timeSinceLastRun: number): boolean;
} }

View File

@ -25,6 +25,7 @@ export interface IBotConfig extends IBaseConfig {
showTypeInNickname: boolean; showTypeInNickname: boolean;
/** Max number of bots that can be spawned in a raid at any one time */ /** Max number of bots that can be spawned in a raid at any one time */
maxBotCap: Record<string, number>; maxBotCap: Record<string, number>;
chanceAssaultScavHasPlayerScavName: number;
/** How many stacks of secret ammo should a bot have in its bot secure container */ /** How many stacks of secret ammo should a bot have in its bot secure container */
secureContainerAmmoStackCount: number; secureContainerAmmoStackCount: number;
/** Batch generation size when type not available in cache */ /** Batch generation size when type not available in cache */

View File

@ -4,4 +4,5 @@ export interface ICoreConfig extends IBaseConfig {
akiVersion: string; akiVersion: string;
projectName: string; projectName: string;
compatibleTarkovVersion: string; compatibleTarkovVersion: string;
commit: string;
} }

View File

@ -3,10 +3,5 @@ export interface IHideoutConfig extends IBaseConfig {
kind: "aki-hideout"; kind: "aki-hideout";
runIntervalSeconds: number; runIntervalSeconds: number;
hoursForSkillCrafting: number; hoursForSkillCrafting: number;
generatorSpeedWithoutFuel: number;
generatorFuelFlowRate: number;
airFilterUnitFlowRate: number;
/** SEE HIDEOUTHELPER BEFORE CHANGING CONFIG */
gpuBoostRate: number;
hideoutWallAppearTimeSeconds: number; hideoutWallAppearTimeSeconds: number;
} }

View File

@ -5,5 +5,6 @@ export interface IInsuranceConfig extends IBaseConfig {
returnChancePercent: Record<string, number>; returnChancePercent: Record<string, number>;
blacklistedEquipment: string[]; blacklistedEquipment: string[];
slotIdsWithChanceOfNotReturning: string[]; slotIdsWithChanceOfNotReturning: string[];
returnTimeOverrideSeconds: number;
runIntervalSeconds: number; runIntervalSeconds: number;
} }

View File

@ -9,6 +9,7 @@ export interface KarmaLevel {
modifiers: Modifiers; modifiers: Modifiers;
itemLimits: ItemLimits; itemLimits: ItemLimits;
equipmentBlacklist: Record<string, string[]>; equipmentBlacklist: Record<string, string[]>;
labsAccessCardChancePercent: number;
} }
export interface Modifiers { export interface Modifiers {
equipment: Record<string, number>; equipment: Record<string, number>;

View File

@ -3,13 +3,24 @@ import { IBaseConfig } from "./IBaseConfig";
export interface IQuestConfig extends IBaseConfig { export interface IQuestConfig extends IBaseConfig {
kind: "aki-quest"; kind: "aki-quest";
redeemTime: number; redeemTime: number;
questTemplateIds: IPlayerTypeQuestIds;
repeatableQuests: IRepeatableQuestConfig[]; repeatableQuests: IRepeatableQuestConfig[];
locationIdMap: Record<string, string>; locationIdMap: Record<string, string>;
bearOnlyQuests: string[]; bearOnlyQuests: string[];
usecOnlyQuests: string[]; usecOnlyQuests: string[];
} }
export interface IPlayerTypeQuestIds {
pmc: IQuestTypeIds;
scav: IQuestTypeIds;
}
export interface IQuestTypeIds {
Elimination: string;
Completion: string;
Exploration: string;
}
export interface IRepeatableQuestConfig { export interface IRepeatableQuestConfig {
name: string; name: string;
side: string;
types: string[]; types: string[];
resetTime: number; resetTime: number;
numQuests: number; numQuests: number;
@ -17,11 +28,12 @@ export interface IRepeatableQuestConfig {
rewardScaling: IRewardScaling; rewardScaling: IRewardScaling;
locations: Record<ELocationName, string[]>; locations: Record<ELocationName, string[]>;
traderWhitelist: ITraderWhitelist[]; traderWhitelist: ITraderWhitelist[];
questConfig: IQuestConfig; questConfig: IRepeatableQuestTypesConfig;
/** Item base types to block when generating rewards */ /** Item base types to block when generating rewards */
rewardBaseTypeBlacklist: string[]; rewardBaseTypeBlacklist: string[];
/** Item tplIds to ignore when generating rewards */ /** Item tplIds to ignore when generating rewards */
rewardBlacklist: string[]; rewardBlacklist: string[];
rewardAmmoStackMinSize: number;
} }
export interface IRewardScaling { export interface IRewardScaling {
levels: number[]; levels: number[];
@ -35,7 +47,7 @@ export interface ITraderWhitelist {
traderId: string; traderId: string;
questTypes: string[]; questTypes: string[];
} }
export interface IQuestConfig { export interface IRepeatableQuestTypesConfig {
Exploration: IExploration; Exploration: IExploration;
Completion: ICompletion; Completion: ICompletion;
Elimination: IElimination; Elimination: IElimination;

View File

@ -16,7 +16,7 @@ export interface Sell {
} }
export interface Chance { export interface Chance {
base: number; base: number;
overprices: number; overpriced: number;
underpriced: number; underpriced: number;
} }
export interface Time { export interface Time {
@ -29,6 +29,7 @@ export interface Reputation {
loss: number; loss: number;
} }
export interface Dynamic { export interface Dynamic {
purchasesAreFoundInRaid: boolean;
barter: Barter; barter: Barter;
offerAdjustment: OfferAdjustment; offerAdjustment: OfferAdjustment;
expiredOfferThreshold: number; expiredOfferThreshold: number;
@ -43,9 +44,10 @@ export interface Dynamic {
rating: MinMax; rating: MinMax;
currencies: Record<string, number>; currencies: Record<string, number>;
showAsSingleStack: string[]; showAsSingleStack: string[];
removeSeasonalItemsWhenNotInEvent: boolean;
blacklist: Blacklist; blacklist: Blacklist;
} }
export declare class Barter { export interface Barter {
enable: boolean; enable: boolean;
chancePercent: number; chancePercent: number;
itemCountMin: number; itemCountMin: number;
@ -54,7 +56,7 @@ export declare class Barter {
minRoubleCostToBecomeBarter: number; minRoubleCostToBecomeBarter: number;
itemTypeBlacklist: string[]; itemTypeBlacklist: string[];
} }
export declare class OfferAdjustment { export interface OfferAdjustment {
maxPriceDifferenceBelowHandbookPercent: number; maxPriceDifferenceBelowHandbookPercent: number;
handbookPriceMultipier: number; handbookPriceMultipier: number;
priceThreshholdRub: number; priceThreshholdRub: number;

View File

@ -9,8 +9,6 @@ export interface IRepairConfig extends IBaseConfig {
repairKit: RepairKit; repairKit: RepairKit;
} }
export interface RepairKit { export interface RepairKit {
armorChancePercent: number;
weaponChancePercent: number;
armor: BonusSettings; armor: BonusSettings;
weapon: BonusSettings; weapon: BonusSettings;
} }

View File

@ -1,10 +0,0 @@
export declare namespace ModLoader {
interface IMod {
name: string;
version: string;
main?: string;
author?: string;
license: string;
dependencies?: Record<string, string>;
}
}

View File

@ -1,7 +1,5 @@
import { DependencyContainer } from "tsyringe"; import { DependencyContainer } from "tsyringe";
export interface IModLoader { export interface IModLoader {
load(container: DependencyContainer): void; load(container: DependencyContainer): void;
getBundles(local: boolean): string;
getBundle(key: string, local: boolean): void;
getModPath(mod: string): string; getModPath(mod: string): string;
} }

View File

@ -1,6 +1,6 @@
export interface IPackageJsonData { export interface IPackageJsonData {
incompatibilities?: string[]; incompatibilities?: string[];
dependencies?: string[]; dependencies?: Record<string, string>;
modDependencies?: Record<string, string>; modDependencies?: Record<string, string>;
name: string; name: string;
author: string; author: string;
@ -8,5 +8,6 @@ export interface IPackageJsonData {
akiVersion: string; akiVersion: string;
licence: string; licence: string;
main: string; main: string;
isBundleMod: boolean;
contributors: string[]; contributors: string[];
} }

View File

@ -42,8 +42,6 @@ export interface IDatabaseTables {
items: Record<string, ITemplateItem>; items: Record<string, ITemplateItem>;
quests: Record<string, IQuest>; quests: Record<string, IQuest>;
repeatableQuests: IRepeatableQuestDatabase; repeatableQuests: IRepeatableQuestDatabase;
/** DEPRECATED - Items file found in the client, massivly out of date compared to templates.items, try not to use this, remove ASAP*/
clientItems: Record<string, ITemplateItem>;
handbook: IHandbookBase; handbook: IHandbookBase;
customization: Record<string, ICustomizationItem>; customization: Record<string, ICustomizationItem>;
/** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */

View File

@ -10,6 +10,7 @@ export interface Config {
FirstCycleDelaySeconds: number; FirstCycleDelaySeconds: number;
FramerateLimit: FramerateLimit; FramerateLimit: FramerateLimit;
GroupStatusInterval: number; GroupStatusInterval: number;
GroupStatusButtonInterval: number;
KeepAliveInterval: number; KeepAliveInterval: number;
LobbyKeepAliveInterval: number; LobbyKeepAliveInterval: number;
Mark502and504AsNonImportant: boolean; Mark502and504AsNonImportant: boolean;

View File

@ -8,6 +8,10 @@ export declare class EventOutputHolder {
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
/** What has client been informed of this game session */
protected clientActiveSessionStorage: Record<string, {
clientInformed: boolean;
}>;
constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper, timeUtil: TimeUtil); constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper, timeUtil: TimeUtil);
protected output: IItemEventRouterResponse; protected output: IItemEventRouterResponse;
getOutput(sessionID: string): IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse;
@ -17,6 +21,11 @@ export declare class EventOutputHolder {
* @param sessionID Players id * @param sessionID Players id
*/ */
resetOutput(sessionID: string): void; resetOutput(sessionID: string): void;
/**
* Update output object with most recent values from player profile
* @param sessionId Session id
*/
updateOutputProperties(sessionId: string): void;
/** /**
* Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true * Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true
* @param pmcData Player profile * @param pmcData Player profile
@ -24,9 +33,9 @@ export declare class EventOutputHolder {
*/ */
protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record<string, IHideoutImprovement>; protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record<string, IHideoutImprovement>;
/** /**
* Return all productions from player profile, adjust completed productions' inprogress property to be false * Return productions from player profile except those completed crafts the client has already seen
* @param pmcData Player profile * @param pmcData Player profile
* @returns dictionary of hideout productions * @returns dictionary of hideout productions
*/ */
protected getProductionsFromProfileAndFlagComplete(pmcData: IPmcData): Record<string, Productive>; protected getProductionsFromProfileAndFlagComplete(productions: Record<string, Productive>): Record<string, Productive>;
} }

View File

@ -12,5 +12,11 @@ export declare class ItemEventRouter {
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], localisationService: LocalisationService, eventOutputHolder: EventOutputHolder); constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], localisationService: LocalisationService, eventOutputHolder: EventOutputHolder);
/**
*
* @param info Event request
* @param sessionID Session id
* @returns Item response
*/
handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse;
} }

View File

@ -1,7 +1,7 @@
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
import { CustomizationCallbacks } from "../../callbacks/CustomizationCallbacks"; import { CustomizationCallbacks } from "../../callbacks/CustomizationCallbacks";
import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router";
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
export declare class CustomizationItemEventRouter extends ItemEventRouterDefinition { export declare class CustomizationItemEventRouter extends ItemEventRouterDefinition {
protected customizationCallbacks: CustomizationCallbacks; protected customizationCallbacks: CustomizationCallbacks;
constructor(customizationCallbacks: CustomizationCallbacks); constructor(customizationCallbacks: CustomizationCallbacks);

View File

@ -1,7 +1,7 @@
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
import { HealthCallbacks } from "../../callbacks/HealthCallbacks"; import { HealthCallbacks } from "../../callbacks/HealthCallbacks";
import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router";
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
export declare class HealthItemEventRouter extends ItemEventRouterDefinition { export declare class HealthItemEventRouter extends ItemEventRouterDefinition {
protected healthCallbacks: HealthCallbacks; protected healthCallbacks: HealthCallbacks;
constructor(healthCallbacks: HealthCallbacks); constructor(healthCallbacks: HealthCallbacks);

View File

@ -1,7 +1,7 @@
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
import { InsuranceCallbacks } from "../../callbacks/InsuranceCallbacks"; import { InsuranceCallbacks } from "../../callbacks/InsuranceCallbacks";
import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router";
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
export declare class InsuranceItemEventRouter extends ItemEventRouterDefinition { export declare class InsuranceItemEventRouter extends ItemEventRouterDefinition {
protected insuranceCallbacks: InsuranceCallbacks; protected insuranceCallbacks: InsuranceCallbacks;
constructor(insuranceCallbacks: InsuranceCallbacks); constructor(insuranceCallbacks: InsuranceCallbacks);

View File

@ -1,7 +1,7 @@
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
import { NoteCallbacks } from "../../callbacks/NoteCallbacks"; import { NoteCallbacks } from "../../callbacks/NoteCallbacks";
import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router";
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
export declare class NoteItemEventRouter extends ItemEventRouterDefinition { export declare class NoteItemEventRouter extends ItemEventRouterDefinition {
protected noteCallbacks: NoteCallbacks; protected noteCallbacks: NoteCallbacks;
constructor(noteCallbacks: NoteCallbacks); constructor(noteCallbacks: NoteCallbacks);

View File

@ -1,7 +1,7 @@
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
import { PresetBuildCallbacks } from "../../callbacks/PresetBuildCallbacks"; import { PresetBuildCallbacks } from "../../callbacks/PresetBuildCallbacks";
import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router";
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
export declare class PresetBuildItemEventRouter extends ItemEventRouterDefinition { export declare class PresetBuildItemEventRouter extends ItemEventRouterDefinition {
protected presetBuildCallbacks: PresetBuildCallbacks; protected presetBuildCallbacks: PresetBuildCallbacks;
constructor(presetBuildCallbacks: PresetBuildCallbacks); constructor(presetBuildCallbacks: PresetBuildCallbacks);

View File

@ -1,7 +1,7 @@
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
import { RagfairCallbacks } from "../../callbacks/RagfairCallbacks"; import { RagfairCallbacks } from "../../callbacks/RagfairCallbacks";
import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router";
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
export declare class RagfairItemEventRouter extends ItemEventRouterDefinition { export declare class RagfairItemEventRouter extends ItemEventRouterDefinition {
protected ragfairCallbacks: RagfairCallbacks; protected ragfairCallbacks: RagfairCallbacks;
constructor(ragfairCallbacks: RagfairCallbacks); constructor(ragfairCallbacks: RagfairCallbacks);

View File

@ -1,7 +1,7 @@
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
import { RepairCallbacks } from "../../callbacks/RepairCallbacks"; import { RepairCallbacks } from "../../callbacks/RepairCallbacks";
import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router";
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
export declare class RepairItemEventRouter extends ItemEventRouterDefinition { export declare class RepairItemEventRouter extends ItemEventRouterDefinition {
protected repairCallbacks: RepairCallbacks; protected repairCallbacks: RepairCallbacks;
constructor(repairCallbacks: RepairCallbacks); constructor(repairCallbacks: RepairCallbacks);

View File

@ -1,7 +1,7 @@
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
import { TradeCallbacks } from "../../callbacks/TradeCallbacks"; import { TradeCallbacks } from "../../callbacks/TradeCallbacks";
import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router";
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
export declare class TradeItemEventRouter extends ItemEventRouterDefinition { export declare class TradeItemEventRouter extends ItemEventRouterDefinition {
protected tradeCallbacks: TradeCallbacks; protected tradeCallbacks: TradeCallbacks;
constructor(tradeCallbacks: TradeCallbacks); constructor(tradeCallbacks: TradeCallbacks);

View File

@ -1,7 +1,7 @@
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
import { WishlistCallbacks } from "../../callbacks/WishlistCallbacks"; import { WishlistCallbacks } from "../../callbacks/WishlistCallbacks";
import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router";
import { IPmcData } from "../../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse";
export declare class WishlistItemEventRouter extends ItemEventRouterDefinition { export declare class WishlistItemEventRouter extends ItemEventRouterDefinition {
protected wishlistCallbacks: WishlistCallbacks; protected wishlistCallbacks: WishlistCallbacks;
constructor(wishlistCallbacks: WishlistCallbacks); constructor(wishlistCallbacks: WishlistCallbacks);

View File

@ -1,5 +1,5 @@
import { IAkiProfile } from "../../models/eft/profile/IAkiProfile";
import { HandledRoute, SaveLoadRouter } from "../../di/Router"; import { HandledRoute, SaveLoadRouter } from "../../di/Router";
import { IAkiProfile } from "../../models/eft/profile/IAkiProfile";
export declare class HealthSaveLoadRouter extends SaveLoadRouter { export declare class HealthSaveLoadRouter extends SaveLoadRouter {
constructor(); constructor();
getHandledRoutes(): HandledRoute[]; getHandledRoutes(): HandledRoute[];

View File

@ -1,5 +1,5 @@
import { IAkiProfile } from "../../models/eft/profile/IAkiProfile";
import { HandledRoute, SaveLoadRouter } from "../../di/Router"; import { HandledRoute, SaveLoadRouter } from "../../di/Router";
import { IAkiProfile } from "../../models/eft/profile/IAkiProfile";
export declare class InraidSaveLoadRouter extends SaveLoadRouter { export declare class InraidSaveLoadRouter extends SaveLoadRouter {
constructor(); constructor();
getHandledRoutes(): HandledRoute[]; getHandledRoutes(): HandledRoute[];

View File

@ -1,5 +1,5 @@
import { IAkiProfile } from "../../models/eft/profile/IAkiProfile";
import { HandledRoute, SaveLoadRouter } from "../../di/Router"; import { HandledRoute, SaveLoadRouter } from "../../di/Router";
import { IAkiProfile } from "../../models/eft/profile/IAkiProfile";
export declare class InsuranceSaveLoadRouter extends SaveLoadRouter { export declare class InsuranceSaveLoadRouter extends SaveLoadRouter {
constructor(); constructor();
getHandledRoutes(): HandledRoute[]; getHandledRoutes(): HandledRoute[];

View File

@ -1,5 +1,5 @@
import { IAkiProfile } from "../../models/eft/profile/IAkiProfile";
import { HandledRoute, SaveLoadRouter } from "../../di/Router"; import { HandledRoute, SaveLoadRouter } from "../../di/Router";
import { IAkiProfile } from "../../models/eft/profile/IAkiProfile";
export declare class ProfileSaveLoadRouter extends SaveLoadRouter { export declare class ProfileSaveLoadRouter extends SaveLoadRouter {
constructor(); constructor();
getHandledRoutes(): HandledRoute[]; getHandledRoutes(): HandledRoute[];

View File

@ -1,7 +1,7 @@
/// <reference types="node" /> /// <reference types="node" />
import { IncomingMessage, ServerResponse } from "http";
import { Serializer } from "../../di/Serializer"; import { Serializer } from "../../di/Serializer";
import { ImageRouter } from "../ImageRouter"; import { ImageRouter } from "../ImageRouter";
import { IncomingMessage, ServerResponse } from "http";
export declare class ImageSerializer extends Serializer { export declare class ImageSerializer extends Serializer {
protected imageRouter: ImageRouter; protected imageRouter: ImageRouter;
constructor(imageRouter: ImageRouter); constructor(imageRouter: ImageRouter);

View File

@ -13,17 +13,18 @@ export declare class AkiHttpListener implements IHttpListener {
protected httpRouter: HttpRouter; protected httpRouter: HttpRouter;
protected serializers: Serializer[]; protected serializers: Serializer[];
protected logger: ILogger; protected logger: ILogger;
protected requestsLogger: ILogger;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected httpBufferHandler: HttpBufferHandler; protected httpBufferHandler: HttpBufferHandler;
constructor(httpRouter: HttpRouter, // TODO: delay required constructor(httpRouter: HttpRouter, // TODO: delay required
serializers: Serializer[], logger: ILogger, jsonUtil: JsonUtil, httpResponse: HttpResponseUtil, localisationService: LocalisationService, httpBufferHandler: HttpBufferHandler); serializers: Serializer[], logger: ILogger, requestsLogger: ILogger, jsonUtil: JsonUtil, httpResponse: HttpResponseUtil, localisationService: LocalisationService, httpBufferHandler: HttpBufferHandler);
canHandle(_: string, req: IncomingMessage): boolean; canHandle(_: string, req: IncomingMessage): boolean;
handle(sessionId: string, req: IncomingMessage, resp: ServerResponse): void; handle(sessionId: string, req: IncomingMessage, resp: ServerResponse): void;
sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void; sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void;
getResponse(sessionID: string, req: IncomingMessage, body: Buffer): string; getResponse(sessionID: string, req: IncomingMessage, body: Buffer): string;
protected getBodyInfo(body: Buffer): string; protected getBodyInfo(body: Buffer): any;
sendJson(resp: ServerResponse, output: any, sessionID: string): void; sendJson(resp: ServerResponse, output: string, sessionID: string): void;
sendZlibJson(resp: ServerResponse, output: any, sessionID: string): void; sendZlibJson(resp: ServerResponse, output: string, sessionID: string): void;
} }

View File

@ -58,14 +58,14 @@ export declare class BotEquipmentFilterService {
*/ */
protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails;
/** /**
* Retreive clothing weighting adjustments from bot.json config * Retrieve clothing weighting adjustments from bot.json config
* @param botRole Bot type to get adjustments for * @param botRole Bot type to get adjustments for
* @param playerLevel level of player * @param playerLevel level of player
* @returns Weighting adjustments for bots clothing * @returns Weighting adjustments for bots clothing
*/ */
protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails;
/** /**
* Retreive item weighting adjustments from bot.json config * Retrieve item weighting adjustments from bot.json config
* @param botRole Bot type to get adjustments for * @param botRole Bot type to get adjustments for
* @param playerLevel level of player * @param playerLevel level of player
* @returns Weighting adjustments for bot items * @returns Weighting adjustments for bot items
@ -73,7 +73,7 @@ export declare class BotEquipmentFilterService {
protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails;
/** /**
* Filter bot equipment based on blacklist and whitelist from config/bot.json * Filter bot equipment based on blacklist and whitelist from config/bot.json
* Prioritises whitelist first, if one is found blacklist is ignored * Prioritizes whitelist first, if one is found blacklist is ignored
* @param baseBotNode bot .json file to update * @param baseBotNode bot .json file to update
* @param blacklist equipment blacklist * @param blacklist equipment blacklist
* @returns Filtered bot file * @returns Filtered bot file
@ -81,10 +81,10 @@ export declare class BotEquipmentFilterService {
protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void;
/** /**
* Filter bot cartridges based on blacklist and whitelist from config/bot.json * Filter bot cartridges based on blacklist and whitelist from config/bot.json
* Prioritises whitelist first, if one is found blacklist is ignored * Prioritizes whitelist first, if one is found blacklist is ignored
* @param baseBotNode bot .json file to update * @param baseBotNode bot .json file to update
* @param blacklist equipment on this list should be excluded from the bot * @param blacklist equipment on this list should be excluded from the bot
* @param whitelist equipment on this list should be used exclusivly * @param whitelist equipment on this list should be used exclusively
* @returns Filtered bot file * @returns Filtered bot file
*/ */
protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void;

View File

@ -33,12 +33,22 @@ export declare class FenceService {
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
/** Main assorts you see at all rep levels */
protected fenceAssort: ITraderAssort; protected fenceAssort: ITraderAssort;
/** Assorts shown on a separte tab when you max out fence rep */
protected fenceDiscountAssort: ITraderAssort; protected fenceDiscountAssort: ITraderAssort;
protected traderConfig: ITraderConfig; protected traderConfig: ITraderConfig;
protected nextMiniRefreshTimestamp: number; protected nextMiniRefreshTimestamp: number;
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Replace main fence assort with new assort
* @param assort New assorts to replace old with
*/
protected setFenceAssort(assort: ITraderAssort): void; protected setFenceAssort(assort: ITraderAssort): void;
/**
* Replace high rep level fence assort with new assort
* @param assort New assorts to replace old with
*/
protected setFenceDiscountAssort(assort: ITraderAssort): void; protected setFenceDiscountAssort(assort: ITraderAssort): void;
/** /**
* Get assorts player can purchase * Get assorts player can purchase
@ -131,9 +141,9 @@ export declare class FenceService {
/** /**
* Add preset weapons to fence presets * Add preset weapons to fence presets
* @param assortCount how many assorts to add to assorts * @param assortCount how many assorts to add to assorts
* @param defaultWeaponPresets * @param defaultWeaponPresets a dictionary of default weapon presets
* @param assorts object to add presets to * @param assorts object to add presets to
* @param loyaltyLevel * @param loyaltyLevel loyalty level to requre item at
*/ */
protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record<string, Preset>, assorts: ITraderAssort, loyaltyLevel: number): void; protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record<string, Preset>, assorts: ITraderAssort, loyaltyLevel: number): void;
/** /**

Some files were not shown because too many files have changed in this diff Show More