Update types for 3.7.0

This commit is contained in:
Dev 2023-08-31 12:22:38 +01:00
parent 71a2f8dae6
commit 58593864c1
1692 changed files with 14347 additions and 4560 deletions

2
.gitignore vendored
View File

@ -2,3 +2,5 @@
**/package-lock.json
**/node_modules/
**/dist/
updateTypes.ps1
NewTypes/

View File

@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout
export declare class InventoryCallbacks {
protected inventoryController: InventoryController;
constructor(inventoryController: InventoryController);
/** Handle "move" */
moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse;
splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;

View File

@ -24,5 +24,7 @@ declare class LauncherCallbacks {
ping(url: string, info: IEmptyRequestData, sessionID: string): string;
removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string;
getCompatibleTarkovVersion(): string;
getLoadedServerMods(): string;
getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string;
}
export { LauncherCallbacks };

View File

@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier";
import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData";
import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
export declare class NotifierCallbacks {
protected httpServerHelper: HttpServerHelper;
protected httpResponse: HttpResponseUtil;
protected jsonUtil: JsonUtil;
protected notifierController: NotifierController;
constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController);
constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController);
/**
* If we don't have anything to send, it's ok to not send anything back
* because notification requests can be long-polling. In fact, we SHOULD wait

View File

@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData";
import { WeaponBuild } from "../models/eft/profile/IAkiProfile";
import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData";
import { IUserBuilds } from "../models/eft/profile/IAkiProfile";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class PresetBuildCallbacks {
protected httpResponse: HttpResponseUtil;
protected presetBuildController: PresetBuildController;
constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController);
/** Handle client/handbook/builds/my/list */
getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<WeaponBuild[]>;
/** Handle SaveBuild event */
saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle RemoveBuild event*/
removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IUserBuilds>;
/** Handle SaveWeaponBuild event */
saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle removeBuild event*/
removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle RemoveWeaponBuild event*/
removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle SaveEquipmentBuild event */
saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle RemoveEquipmentBuild event*/
removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
}

View File

@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData";
export declare class TradeCallbacks {
protected tradeController: TradeController;
constructor(tradeController: TradeController);
@ -12,4 +13,6 @@ export declare class TradeCallbacks {
processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle RagFairBuyOffer event */
processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle SellAllFromSavage event */
sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse;
}

View File

@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase";
import { IBotCore } from "../models/eft/common/tables/IBotCore";
import { Difficulty } from "../models/eft/common/tables/IBotType";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
@ -29,6 +30,7 @@ export declare class BotController {
protected applicationContext: ApplicationContext;
protected jsonUtil: JsonUtil;
protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig;
static readonly pmcTypeLabel = "PMC";
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
/**

View File

@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia
import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest";
import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile";
import { MessageType } from "../models/enums/MessageType";
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { SaveServer } from "../servers/SaveServer";
import { GiftService } from "../services/GiftService";
import { MailSendService } from "../services/MailSendService";
@ -24,7 +26,9 @@ export declare class DialogueController {
protected mailSendService: MailSendService;
protected giftService: GiftService;
protected hashUtil: HashUtil;
constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil);
protected configServer: ConfigServer;
protected coreConfig: ICoreConfig;
constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer);
/** Handle onUpdate spt event */
update(): void;
/**

View File

@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomLocationWaveService } from "../services/CustomLocationWaveService";
import { GiftService } from "../services/GiftService";
import { ItemBaseClassService } from "../services/ItemBaseClassService";
import { LocalisationService } from "../services/LocalisationService";
import { OpenZoneService } from "../services/OpenZoneService";
import { ProfileFixerService } from "../services/ProfileFixerService";
import { SeasonalEventService } from "../services/SeasonalEventService";
import { EncodingUtil } from "../utils/EncodingUtil";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
@ -34,6 +36,7 @@ export declare class GameController {
protected databaseServer: DatabaseServer;
protected jsonUtil: JsonUtil;
protected timeUtil: TimeUtil;
protected hashUtil: HashUtil;
protected preAkiModLoader: PreAkiModLoader;
protected httpServerHelper: HttpServerHelper;
protected randomUtil: RandomUtil;
@ -45,6 +48,7 @@ export declare class GameController {
protected customLocationWaveService: CustomLocationWaveService;
protected openZoneService: OpenZoneService;
protected seasonalEventService: SeasonalEventService;
protected itemBaseClassService: ItemBaseClassService;
protected giftService: GiftService;
protected applicationContext: ApplicationContext;
protected configServer: ConfigServer;
@ -53,12 +57,20 @@ export declare class GameController {
protected coreConfig: ICoreConfig;
protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig;
protected botConfig: IBotConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer);
protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer);
/**
* Handle client/game/start
*/
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
protected makeCustomsWishingTreeLootGuaranteed(): void;
protected setHideoutAreasAndCraftsTo30Secs(): void;
/**
* 3.7.0 moved AIDs to be numeric, old profiles need to be migrated
* We store the old AID value in new field `sessionId`
* @param fullProfile Profile to update
*/
protected fixIncorrectAidValue(fullProfile: IAkiProfile): void;
/** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */
protected adjustMapBotLimits(): void;
/**

View File

@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData";
import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase";
import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData";
import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData";
import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea";
import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData";
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad
import { IQteData } from "../models/eft/hideout/IQteData";
import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { HideoutAreas } from "../models/enums/HideoutAreas";
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
@ -76,6 +78,37 @@ export declare class HideoutController {
* @returns IItemEventRouterResponse
*/
upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Upgrade wall status to visible in profile if medstation/water collector are both level 1
* @param pmcData Player profile
*/
protected checkAndUpgradeWall(pmcData: IPmcData): void;
/**
*
* @param pmcData Profile to edit
* @param output Object to send back to client
* @param sessionID Session/player id
* @param profileHideoutArea Current hideout data for profile
* @param dbHideoutArea Hideout area being upgraded
* @param hideoutStage Stage hideout area is being upgraded to
*/
protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void;
/**
* Add an inventory item to profile from a hideout area stage data
* @param pmcData Profile to update
* @param dbHideoutData Hideout area from db being upgraded
* @param hideoutStage Stage area upgraded to
*/
protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void;
/**
*
* @param output Objet to send to client
* @param sessionID Session/player id
* @param areaType Hideout area that had stash added
* @param hideoutDbData Hideout area that caused addition of stash
* @param hideoutStage Hideout area upgraded to this
*/
protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void;
/**
* Handle HideoutPutItemsInAreaSlots
* Create item in hideout slot item array, remove item from player inventory

View File

@ -104,10 +104,8 @@ export declare class InraidController {
/**
* Mark inventory items as FiR if player survived raid, otherwise remove FiR from them
* @param offraidData Save Progress Request
* @param pmcData player profile
* @param isPlayerScav Was the player a pScav
*/
protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void;
protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void;
/**
* Update profile after player completes scav raid
* @param scavData Scav profile

View File

@ -56,9 +56,9 @@ export declare class InsuranceController {
/**
* Handle client/insurance/items/list/cost
* Calculate insurance cost
* @param info request object
* @param request request object
* @param sessionID session id
* @returns IGetInsuranceCostResponseData object to send to client
*/
cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData;
cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData;
}

View File

@ -81,25 +81,40 @@ export declare class InventoryController {
*/
discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Split Item
* spliting 1 item-stack into 2 separate items ...
*/
splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;
* Split Item
* spliting 1 stack into 2
* @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile)
* @param request Split request
* @param sessionID Session/player id
* @returns IItemEventRouterResponse
*/
splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Merge Item
* merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with`
* Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer')
* Deletes item from `body.item` and adding number of stacks into `body.with`
* @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile)
* @param body Merge request
* @param sessionID Player id
* @returns IItemEventRouterResponse
*/
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Transfer item
* Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload"
*/
* TODO: Adds no data to output to send to client, is this by design?
* TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc
* Transfer items from one stack into another while keeping original stack
* Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload"
* @param pmcData Player profile
* @param body Transfer request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Swap Item
* its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment
* Also used to swap items using quick selection on character screen
*/
swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse;
swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handles folding of Weapons
*/

View File

@ -1,10 +1,13 @@
import { HttpServerHelper } from "../helpers/HttpServerHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { PreAkiModLoader } from "../loaders/PreAkiModLoader";
import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData";
import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData";
import { IRegisterData } from "../models/eft/launcher/IRegisterData";
import { Info } from "../models/eft/profile/IAkiProfile";
import { Info, ModDetails } from "../models/eft/profile/IAkiProfile";
import { IConnectResponse } from "../models/eft/profile/IConnectResponse";
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
@ -14,11 +17,13 @@ export declare class LauncherController {
protected hashUtil: HashUtil;
protected saveServer: SaveServer;
protected httpServerHelper: HttpServerHelper;
protected profileHelper: ProfileHelper;
protected databaseServer: DatabaseServer;
protected localisationService: LocalisationService;
protected preAkiModLoader: PreAkiModLoader;
protected configServer: ConfigServer;
protected coreConfig: ICoreConfig;
constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer);
constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer);
connect(): IConnectResponse;
/**
* Get descriptive text for each of the profile edtions a player can choose
@ -33,4 +38,15 @@ export declare class LauncherController {
changePassword(info: IChangeRequestData): string;
wipe(info: IRegisterData): string;
getCompatibleTarkovVersion(): string;
/**
* Get the mods the server has currently loaded
* @returns Dictionary of mod name and mod details
*/
getLoadedServerMods(): Record<string, IPackageJsonData>;
/**
* Get the mods a profile has ever loaded into game with
* @param sessionId Player id
* @returns Array of mod details
*/
getServerModsProfileUsed(sessionId: string): ModDetails[];
}

View File

@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo
import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult";
import { AirdropTypeEnum } from "../models/enums/AirdropType";
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { LootRequest } from "../models/spt/services/LootRequest";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
export declare class LocationController {
protected jsonUtil: JsonUtil;
protected hashUtil: HashUtil;
protected randomUtil: RandomUtil;
protected weightedRandomHelper: WeightedRandomHelper;
protected logger: ILogger;
protected locationGenerator: LocationGenerator;
@ -26,7 +29,8 @@ export declare class LocationController {
protected timeUtil: TimeUtil;
protected configServer: ConfigServer;
protected airdropConfig: IAirdropConfig;
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
protected locationConfig: ILocationConfig;
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
/**
* Handle client/location/getLocalloot
* Get a location (map) with generated loot data
@ -35,7 +39,7 @@ export declare class LocationController {
*/
get(location: string): ILocationBase;
/**
* Generate a maps base location without loot
* Generate a maps base location with loot
* @param name Map name
* @returns ILocationBase
*/

View File

@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa
import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData";
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
import { IMatchConfig } from "../models/spt/config/IMatchConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { SaveServer } from "../servers/SaveServer";
@ -32,7 +32,7 @@ export declare class MatchController {
protected applicationContext: ApplicationContext;
protected matchConfig: IMatchConfig;
protected inraidConfig: IInRaidConfig;
protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext);
getEnabled(): boolean;
/** Handle raid/profile/list */

View File

@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData";
import { WeaponBuild } from "../models/eft/profile/IAkiProfile";
import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData";
import { IUserBuilds } from "../models/eft/profile/IAkiProfile";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
export declare class PresetBuildController {
protected logger: ILogger;
protected hashUtil: HashUtil;
protected eventOutputHolder: EventOutputHolder;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper;
protected saveServer: SaveServer;
constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer);
constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer);
/** Handle client/handbook/builds/my/list */
getUserBuilds(sessionID: string): WeaponBuild[];
/** Handle SaveBuild event */
saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle RemoveBuild event*/
removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
getUserBuilds(sessionID: string): IUserBuilds;
/** Handle SaveWeaponBuild event */
saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse;
/** Handle SaveEquipmentBuild event */
saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse;
/** Handle RemoveWeaponBuild event*/
removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle RemoveWeaponBuild event*/
removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle RemoveEquipmentBuild event*/
removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse;
}

View File

@ -71,7 +71,7 @@ export declare class RagfairController {
/**
* Get offers for the client based on type of search being performed
* @param searchRequest Client search request data
* @param itemsToAdd
* @param itemsToAdd comes from ragfairHelper.filterCategories()
* @param traderAssorts Trader assorts
* @param pmcProfile Player profile
* @returns array of offers
@ -149,6 +149,13 @@ export declare class RagfairController {
createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer;
getAllFleaPrices(): Record<string, number>;
getStaticPrices(): Record<string, number>;
/**
* User requested removal of the offer, actually reduces the time to 71 seconds,
* allowing for the possibility of extending the auction before it's end time
* @param offerId offer to 'remove'
* @param sessionID Players id
* @returns IItemEventRouterResponse
*/
removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse;
extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
}

View File

@ -1,11 +1,15 @@
import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { TradeHelper } from "../helpers/TradeHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Upd } from "../models/eft/common/tables/IItem";
import { Item, Upd } from "../models/eft/common/tables/IItem";
import { ITraderBase } from "../models/eft/common/tables/ITrader";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData";
import { Traders } from "../models/enums/Traders";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
import { ILogger } from "../models/spt/utils/ILogger";
@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer";
import { LocalisationService } from "../services/LocalisationService";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
declare class TradeController {
protected logger: ILogger;
protected eventOutputHolder: EventOutputHolder;
protected tradeHelper: TradeHelper;
protected itemHelper: ItemHelper;
protected profileHelper: ProfileHelper;
protected traderHelper: TraderHelper;
protected jsonUtil: JsonUtil;
protected ragfairServer: RagfairServer;
protected httpResponse: HttpResponseUtil;
protected localisationService: LocalisationService;
protected ragfairPriceService: RagfairPriceService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
protected traderConfig: ITraderConfig;
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer);
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer);
/** Handle TradingConfirm event */
confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle RagFairBuyOffer event */
confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle SellAllFromSavage event */
sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse;
/**
* Sell all sellable items to a trader from inventory
* WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD
* @param sessionId Session id
* @param profileWithItemsToSell Profile with items to be sold to trader
* @param profileThatGetsMoney Profile that gets the money after selling items
* @param trader Trader to sell items to
* @returns IItemEventRouterResponse
*/
protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse;
/**
* Looks up an items children and gets total handbook price for them
* @param parentItemId parent item that has children we want to sum price of
* @param items All items (parent + children)
* @param handbookPrices Prices of items from handbook
* @param traderDetails Trader being sold to to perform buy category check against
* @returns Rouble price
*/
protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record<string, number>, traderDetails: ITraderBase): number;
protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse;
}
export { TradeController };

View File

@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill
import { Health, IBotType } from "../models/eft/common/tables/IBotType";
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
@ -36,6 +37,7 @@ export declare class BotGenerator {
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Generate a player scav bot object

View File

@ -1,5 +1,6 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotHelper } from "../helpers/BotHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType";
@ -25,12 +26,13 @@ export declare class BotInventoryGenerator {
protected botGeneratorHelper: BotGeneratorHelper;
protected botHelper: BotHelper;
protected weightedRandomHelper: WeightedRandomHelper;
protected itemHelper: ItemHelper;
protected localisationService: LocalisationService;
protected botEquipmentModPoolService: BotEquipmentModPoolService;
protected botEquipmentModGenerator: BotEquipmentModGenerator;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer);
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer);
/**
* Add equipment/weapons/loot to bot
* @param sessionId Session id
@ -103,10 +105,10 @@ export declare class BotInventoryGenerator {
* @param equipmentChances Chances bot can have equipment equipped
* @param botRole assault/pmcBot/bossTagilla etc
* @param isPmc Is the bot being generated as a pmc
* @param itemGenerationLimitsMinMax
* @param itemGenerationWeights
*/
protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: {
slot: EquipmentSlots;
shouldSpawn: boolean;
}, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void;
}, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void;
}

View File

@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
@ -25,11 +27,13 @@ export declare class BotLootGenerator {
protected botGeneratorHelper: BotGeneratorHelper;
protected botWeaponGenerator: BotWeaponGenerator;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected weightedRandomHelper: WeightedRandomHelper;
protected botLootCacheService: BotLootCacheService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer);
protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Add loot to bots containers
* @param sessionId Session id
@ -46,17 +50,24 @@ export declare class BotLootGenerator {
* @param botRole Role of bot (sptBear/sptUsec)
*/
protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void;
/**
* Get a biased random number
* @param min Smallest size
* @param max Biggest size
* @param nValue Value to bias choice
* @returns Chosen number
*/
protected getRandomisedCount(min: number, max: number, nValue: number): number;
/**
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached
* @param pool pool of items to pick from
* @param equipmentSlots What equality slot will the loot items be added to
* @param pool Pool of items to pick from
* @param equipmentSlots What equipment slot will the loot items be added to
* @param totalItemCount Max count of items to add
* @param inventoryToAddItemsTo bot inventory loot will be added to
* @param botRole role of the bot loot is being generated for (assault/pmcbot)
* @param useLimits should item limit counts be used as defined in config/bot.json
* @param totalValueLimitRub total value of loot allowed in roubles
* @param isPmc is the bot being generated for a pmc
* @param inventoryToAddItemsTo Bot inventory loot will be added to
* @param botRole Role of the bot loot is being generated for (assault/pmcbot)
* @param useLimits Should item limit counts be used as defined in config/bot.json
* @param totalValueLimitRub Total value of loot allowed in roubles
* @param isPmc Is bot being generated for a pmc
*/
protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void;
/**
@ -70,38 +81,23 @@ export declare class BotLootGenerator {
*/
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void;
/**
* @deprecated replaced by getRandomItemFromPoolByRole()
* Get a random item from the pool parameter using the biasedRandomNumber system
* @param pool pool of items to pick an item from
* @param isPmc is the bot being created a pmc
* @returns ITemplateItem object
*/
protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem;
/**
* Get a random item from the pool parameter using the biasedRandomNumber system
* @param pool pool of items to pick an item from
* @param isPmc is the bot being created a pmc
* @param pool Pool of items to pick an item from
* @param isPmc Is the bot being created a pmc
* @returns ITemplateItem object
*/
protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem;
/**
* @deprecated Replaced by getBotLootNValueByRole()
* Get the loot nvalue from botconfig
* @param isPmc if true the pmc nvalue is returned
* @returns nvalue as number
*/
protected getBotLootNValue(isPmc: boolean): number;
/**
* Get the loot nvalue from botconfig
* @param botRole role of bot e.g. assault/sptBear
* @param botRole Role of bot e.g. assault/bosstagilla/sptBear
* @returns nvalue as number
*/
protected getBotLootNValueByRole(botRole: string): number;
/**
* Update item limit array to contain items that have a limit
* Hydrate item limit array to contain items that have a limit for a specific bot type
* All values are set to 0
* @param isPmc is the bot a pmc
* @param botRole role the bot has
* @param isPmc Is the bot a pmc
* @param botRole Role the bot has
* @param limitCount
*/
protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record<string, number>): void;
@ -110,8 +106,8 @@ export declare class BotLootGenerator {
* @param itemTemplate Item we check to see if its reached spawn limit
* @param botRole Bot type
* @param isPmc Is bot we're working with a pmc
* @param limitCount spawn limits for items on bot
* @param itemSpawnLimits the limits this bot is allowed to have
* @param limitCount Spawn limits for items on bot
* @param itemSpawnLimits The limits this bot is allowed to have
* @returns true if item has reached spawn limit
*/
protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record<string, number>, itemSpawnLimits: Record<string, number>): boolean;

View File

@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { MinMax } from "../models/common/MinMax";
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType";
import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { IRepairConfig } from "../models/spt/config/IRepairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
import { LocalisationService } from "../services/LocalisationService";
import { RepairService } from "../services/RepairService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
@ -33,10 +35,13 @@ export declare class BotWeaponGenerator {
protected botWeaponModLimitService: BotWeaponModLimitService;
protected botEquipmentModGenerator: BotEquipmentModGenerator;
protected localisationService: LocalisationService;
protected repairService: RepairService;
protected inventoryMagGenComponents: IInventoryMagGen[];
protected readonly modMagazineSlotId = "mod_magazine";
protected botConfig: IBotConfig;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]);
protected pmcConfig: IPmcConfig;
protected repairConfig: IRepairConfig;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]);
/**
* Pick a random weapon based on weightings and generate a functional weapon
* @param equipmentSlot Primary/secondary/holster
@ -63,7 +68,7 @@ export declare class BotWeaponGenerator {
* @param weaponParentId ParentId of the weapon being generated
* @param modChances Dictionary of item types and % chance weapon will have that mod
* @param botRole e.g. assault/exusec
* @param isPmc
* @param isPmc Is weapon being generated for a pmc
* @returns GenerateWeaponResult object
*/
generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult;
@ -104,11 +109,11 @@ export declare class BotWeaponGenerator {
* Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets.
* Additionally, adds extra bullets to SecuredContainer
* @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl)
* @param magCounts Magazine count to add to inventory
* @param magWeights Magazine weights for count to add to inventory
* @param inventory Inventory to add magazines to
* @param botRole The bot type we're getting generating extra mags for
*/
addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void;
addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void;
/**
* Add Grendaes for UBGL to bots vest and secure container
* @param weaponMods Weapon array with mods

View File

@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { PresetHelper } from "../helpers/PresetHelper";
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation";
import { ILocationBase } from "../models/eft/common/ILocationBase";
import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot";
import { Item } from "../models/eft/common/tables/IItem";
import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase";
import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase";
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { LocalisationService } from "../services/LocalisationService";
import { SeasonalEventService } from "../services/SeasonalEventService";
import { JsonUtil } from "../utils/JsonUtil";
@ -19,8 +22,15 @@ export interface IContainerItem {
width: number;
height: number;
}
export interface IContainerGroupCount {
/** Containers this group has + probabilty to spawn */
containerIdsWithProbability: Record<string, number>;
/** How many containers the map should spawn with this group id */
chosenCount: number;
}
export declare class LocationGenerator {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected jsonUtil: JsonUtil;
protected objectId: ObjectId;
protected randomUtil: RandomUtil;
@ -33,7 +43,38 @@ export declare class LocationGenerator {
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected locationConfig: ILocationConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Create an array of container objects with randomised loot
* @param locationBase Map base to generate containers for
* @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo
* @returns Array of container objects
*/
generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): SpawnpointTemplate[];
/**
* Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist
* @param staticContainers
* @returns IStaticContainerData array
*/
protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[];
/**
* Get containers with 100% spawn rate or have a type on the randomistion ignore list
* @param staticContainersOnMap
* @returns IStaticContainerData array
*/
protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[];
/**
* Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount
* @param containerData Containers and probability values for a groupId
* @returns List of chosen container Ids
*/
protected getContainersByProbabilty(containerData: IContainerGroupCount): string[];
/**
* Get a mapping of each groupid and the containers in that group + count of containers to spawn on map
* @param containersGroups Container group values
* @returns dictionary keyed by groupId
*/
protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record<string, IContainerMinMax>, staticContainersOnMap: IStaticContainerData[]): Record<string, IContainerGroupCount>;
/**
* Choose loot to put into a static container based on weighting
* Handle forced items + seasonal item removal when not in season
@ -44,7 +85,7 @@ export declare class LocationGenerator {
* @param locationName Name of the map to generate static loot for
* @returns IStaticContainerProps
*/
generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerProps;
protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerData;
/**
* Get a 2d grid of a containers item slots
* @param containerTpl Tpl id of the container
@ -88,9 +129,10 @@ export declare class LocationGenerator {
* Create array of item (with child items) and return
* @param chosenComposedKey Key we want to look up items for
* @param spawnPoint Dynamic spawn point item we want will be placed in
* @param staticAmmoDist ammo distributions
* @returns IContainerItem
*/
protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem;
protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): IContainerItem;
/**
* Replace the _id value for base item + all children items parentid value
* @param itemWithChildren Item with mods to update

View File

@ -1,6 +1,6 @@
import { ItemHelper } from "../helpers/ItemHelper";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
@ -18,7 +18,7 @@ export declare class PMCLootGenerator {
protected pocketLootPool: string[];
protected vestLootPool: string[];
protected backpackLootPool: string[];
protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig;
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService);
/**
* Create an array of loot items a PMC can have in their pockets

View File

@ -1,5 +1,5 @@
import { MinMax } from "../../models/common/MinMax";
import { Inventory } from "../../models/eft/common/tables/IBotBase";
import { GenerationData } from "../../models/eft/common/tables/IBotType";
import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem";
export declare class InventoryMagGen {
private magCounts;
@ -7,8 +7,8 @@ export declare class InventoryMagGen {
private weaponTemplate;
private ammoTemplate;
private pmcInventory;
constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory);
getMagCount(): MinMax;
constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory);
getMagCount(): GenerationData;
getMagazineTemplate(): ITemplateItem;
getWeaponTemplate(): ITemplateItem;
getAmmoTemplate(): ITemplateItem;

View File

@ -1,5 +1,5 @@
import { Difficulty } from "../models/eft/common/tables/IBotType";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
@ -15,7 +15,7 @@ export declare class BotDifficultyHelper {
protected localisationService: LocalisationService;
protected botHelper: BotHelper;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer);
getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
/**

View File

@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper";
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
@ -20,6 +21,7 @@ export declare class BotGeneratorHelper {
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Adds properties to an item

View File

@ -1,6 +1,7 @@
import { MinMax } from "../models/common/MinMax";
import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType";
import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
@ -15,6 +16,7 @@ export declare class BotHelper {
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Get a template object for the specified botRole from bots.types db
@ -70,7 +72,7 @@ export declare class BotHelper {
*/
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 pmcConfig.isUsec
* @returns pmc role
*/
getRandomizedPmcRole(): string;

View File

@ -1,5 +1,5 @@
import { MinMax } from "../models/common/MinMax";
import { Inventory } from "../models/eft/common/tables/IBotBase";
import { GenerationData } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { EquipmentSlots } from "../models/enums/EquipmentSlots";
@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil";
import { ContainerHelper } from "./ContainerHelper";
import { InventoryHelper } from "./InventoryHelper";
import { ItemHelper } from "./ItemHelper";
import { WeightedRandomHelper } from "./WeightedRandomHelper";
export declare class BotWeaponGeneratorHelper {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper {
protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected inventoryHelper: InventoryHelper;
protected weightedRandomHelper: WeightedRandomHelper;
protected localisationService: LocalisationService;
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, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper);
/**
* Get a randomized number of bullets for a specific magazine
* @param magCounts min and max count of magazines
* @param magCounts Weights of magazines
* @param magTemplate magazine to generate bullet count for
* @returns bullet count number
*/
getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number;
getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number;
/**
* Get a randomized count of magazines
* @param magCounts min and max value returned value can be between
* @returns numerical value of magazine count
*/
getRandomizedMagazineCount(magCounts: MinMax): number;
getRandomizedMagazineCount(magCounts: GenerationData): number;
/**
* Is this magazine cylinder related (revolvers and grenade launchers)
* @param magazineParentName the name of the magazines parent
@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper {
* @param magTemplate template object of magazine
* @returns Item array
*/
createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[];
createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[];
/**
* Add a specific number of cartridges to a bots inventory (defaults to vest and pockets)
* @param ammoTpl Ammo tpl to add to vest/pockets

View File

@ -51,7 +51,7 @@ export declare class HideoutHelper {
* This convenience function initializes new Production Object
* with all the constants.
*/
initProduction(recipeId: string, productionTime: number): Production;
initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production;
/**
* Is the provided object a Production type
* @param productive
@ -181,9 +181,10 @@ export declare class HideoutHelper {
* Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off
* @param pmcData Player profile
* @param isGeneratorOn Is the generator on for the duration of elapsed time
* @param recipe Hideout production recipe being crafted we need the ticks for
* @returns Amount of time elapsed in seconds
*/
protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number;
protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number;
/**
* Get a count of how many BTC can be gathered by the profile
* @param pmcData Profile to look up
@ -206,6 +207,12 @@ export declare class HideoutHelper {
* @returns Hideout management skill object
*/
protected getHideoutManagementSkill(pmcData: IPmcData): Common;
/**
* HideoutManagement skill gives a consumption bonus the higher the level
* 0.5% per level per 1-51, (25.5% at max)
* @param pmcData Profile to get hideout consumption level level from
* @returns consumption bonus
*/
protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number;
/**
* Adjust craft time based on crafting skill level found in player profile
@ -231,7 +238,7 @@ export declare class HideoutHelper {
*/
protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData;
/**
* Upgrade hideout wall from starting level to interactable level if enough time has passed
* Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded
* @param pmcProfile Profile to upgrade wall in
*/
unlockHideoutWallInProfile(pmcProfile: IPmcData): void;

View File

@ -1,4 +1,4 @@
import { IPmcData } from "../models/eft/common/IPmcData";
import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData";
import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase";
import { Item } from "../models/eft/common/tables/IItem";
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
@ -34,7 +34,7 @@ export declare class InRaidHelper {
*/
removeQuestItemsOnDeath(): boolean;
/**
* Check an array of items and add an upd object to money items with a stack count of 1
* Check items array and add an upd object to money with a stack count of 1
* Single stack money items have no upd object and thus no StackObjectsCount, causing issues
* @param items Items array to check
*/
@ -78,7 +78,12 @@ export declare class InRaidHelper {
* @param profileData player profile on server
*/
protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void;
protected applyTraderStandingAdjustments(preRaid: Record<string, TraderInfo>, postRaid: Record<string, TraderInfo>): void;
/**
* Adjust server trader settings if they differ from data sent by client
* @param tradersServerProfile Server
* @param tradersClientProfile Client
*/
protected applyTraderStandingAdjustments(tradersServerProfile: Record<string, TraderInfo>, tradersClientProfile: Record<string, TraderInfo>): void;
/**
* Some maps have one-time-use keys (e.g. Labs
* Remove the relevant key from an inventory based on the post-raid request data passed in
@ -91,22 +96,13 @@ export declare class InRaidHelper {
* @param sessionID Session id
*/
protected setPlayerInRaidLocationStatusToNone(sessionID: string): void;
/**
* Adds SpawnedInSession property to items found in a raid
* Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true
* @param preRaidProfile profile to update
* @param postRaidProfile profile to update inventory contents of
* @param isPlayerScav Was this a p scav raid
* @returns profile with FiR items properly tagged
*/
addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData;
/**
* Iterate over inventory items and remove the property that defines an item as Found in Raid
* Only removes property if item had FiR when entering raid
* @param postRaidProfile profile to update items for
* @returns Updated profile with SpawnedInSession removed
*/
removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData;
removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData;
/**
* Update a players inventory post-raid
* Remove equipped items from pre-raid

View File

@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper";
import { ProfileHelper } from "./ProfileHelper";
import { TraderAssortHelper } from "./TraderAssortHelper";
export interface OwnerInventoryItems {
/** Inventory items from source */
from: Item[];
/** Inventory items at destination */
to: Item[];
sameInventory: boolean;
isMail: boolean;
@ -66,8 +68,10 @@ export declare class InventoryHelper {
* @param output IItemEventRouterResponse object
* @param sessionID Session id
* @param pmcData Profile to add ammobox to
* @param output object to send to client
* @param foundInRaid should ammo be FiR
*/
protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void;
protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void;
/**
*
* @param assortItems Items to add to inventory
@ -77,6 +81,7 @@ export declare class InventoryHelper {
protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void;
/**
* Remove item from player inventory + insured items array
* Also deletes child items
* @param pmcData Profile to remove item from
* @param itemId Items id to remove
* @param sessionID Session id
@ -90,9 +95,14 @@ export declare class InventoryHelper {
protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash;
getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][];
/**
* Return the inventory that needs to be modified (scav/pmc etc)
* Changes made to result apply to character inventory
* Based on the item action, determine whose inventories we should be looking at for from and to.
* @param request Item interaction request
* @param sessionId Session id / playerid
* @returns OwnerInventoryItems with inventory of player/scav to adjust
*/
getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems;
getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems;
/**
* Made a 2d array table with 0 - free slot and 1 - used slot
* @param {Object} pmcData
@ -101,19 +111,36 @@ export declare class InventoryHelper {
*/
protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][];
protected getSortingTableSlotMap(pmcData: IPmcData): number[][];
/**
* Get Player Stash Proper Size
* @param sessionID Playerid
* @returns Array of 2 values, x and y stash size
*/
protected getPlayerStashSize(sessionID: string): Record<number, number>;
/**
* Get the players stash items tpl
* @param sessionID Player id
* @returns Stash tpl
*/
protected getStashType(sessionID: string): string;
/**
* Internal helper function to transfer an item from one profile to another.
* fromProfileData: Profile of the source.
* toProfileData: Profile of the destination.
* body: Move request
*/
* Internal helper function to transfer an item from one profile to another.
* @param fromItems Inventory of the source (can be non-player)
* @param toItems Inventory of the destination
* @param body Move request
*/
moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void;
/**
* Internal helper function to move item within the same profile_f.
*/
moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void;
* Internal helper function to move item within the same profile_f.
* @param pmcData profile to edit
* @param inventoryItems
* @param moveRequest
* @returns True if move was successful
*/
moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): {
success: boolean;
errorMessage?: string;
};
/**
* Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access
* @param pmcData Player profile

View File

@ -13,6 +13,11 @@ export declare class PresetHelper {
hasPreset(templateId: string): boolean;
getPreset(id: string): IPreset;
getPresets(templateId: string): IPreset[];
/**
* Get the default preset for passed in weapon id
* @param templateId Weapon id to get preset for
* @returns Null if no default preset, otherwise IPreset
*/
getDefaultPreset(templateId: string): IPreset;
getBaseItemTpl(presetId: string): string;
}

View File

@ -123,9 +123,10 @@ export declare class QuestHelper {
* Adjust quest money rewards by passed in multiplier
* @param quest Quest to multiple money rewards
* @param multiplier Value to adjust money rewards by
* @param questStatus Status of quest to apply money boost to rewards of
* @returns Updated quest
*/
applyMoneyBoost(quest: IQuest, multiplier: number): IQuest;
applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest;
/**
* Sets the item stack to new value, or delete the item if value <= 0
* // TODO maybe merge this function and the one from customization

View File

@ -51,8 +51,8 @@ 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, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see
* @param searchRequest
* @param itemsToAdd
* @param searchRequest Data from client
* @param itemsToAdd ragfairHelper.filterCategories()
* @param traderAssorts Trader assorts
* @param pmcProfile Player profile
* @returns Offers the player should see
@ -67,6 +67,13 @@ export declare class RagfairOfferHelper {
* @returns IRagfairOffer array
*/
getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
/**
* Check if offer is from trader standing the player does not have
* @param offer Offer to check
* @param pmcProfile Player profile
* @returns True if item is locked, false if item is purchaseable
*/
protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean;
/**
* Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme
* @param offer Offer to check is quest locked
@ -127,12 +134,12 @@ export declare class RagfairOfferHelper {
protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse;
/**
* Should a ragfair offer be visible to the player
* @param info Search request
* @param searchRequest Search request
* @param itemsToAdd ?
* @param traderAssorts Trader assort items
* @param offer The flea offer
* @param pmcProfile Player profile
* @returns True = should be shown to player
*/
isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, offer: IRagfairOffer, pmcProfile: IPmcData): boolean;
isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, offer: IRagfairOffer, pmcProfile: IPmcData): boolean;
}

View File

@ -39,12 +39,13 @@ export declare class TradeHelper {
buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse;
/**
* Sell item to trader
* @param pmcData Profile to update
* @param profileWithItemsToSell Profile to remove items from
* @param profileToReceiveMoney Profile to accept the money for selling item
* @param sellRequest Request data
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse;
sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Increment the assorts buy count by number of items purchased
* Show error on screen if player attempts to buy more than what the buy max allows

View File

@ -67,10 +67,10 @@ export declare class TraderHelper {
protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number;
/**
* Calculate traders level based on exp amount and increments level if over threshold
* @param traderID trader to process
* @param sessionID session id
* @param traderID trader to check standing of
* @param pmcData profile to update trader in
*/
lvlUp(traderID: string, sessionID: string): void;
lvlUp(traderID: string, pmcData: IPmcData): void;
/**
* Get the next update timestamp for a trader
* @param traderID Trader to look up update value for

View File

@ -29,6 +29,7 @@ export interface IConfig {
TradingUnlimitedItems: boolean;
MaxLoyaltyLevelForAll: boolean;
GlobalLootChanceModifier: number;
GraphicSettings: IGraphicSettings;
TimeBeforeDeploy: number;
TimeBeforeDeployLocal: number;
TradingSetting: number;
@ -79,6 +80,7 @@ export interface IConfig {
SkillExpPerLevel: number;
GameSearchingTimeout: number;
WallContusionAbsorption: Ixyz;
WeaponFastDrawSettings: IWeaponFastDrawSettings;
SkillsSettings: ISkillsSettings;
AzimuthPanelShowsPlayerOrientation: boolean;
Aiming: IAiming;
@ -90,6 +92,19 @@ export interface IConfig {
Ballistic: IBallistic;
RepairSettings: IRepairSettings;
}
export interface IWeaponFastDrawSettings {
HandShakeCurveFrequency: number;
HandShakeCurveIntensity: number;
HandShakeMaxDuration: number;
HandShakeTremorIntensity: number;
WeaponFastSwitchMaxSpeedMult: number;
WeaponFastSwitchMinSpeedMult: number;
WeaponPistolFastSwitchMaxSpeedMult: number;
WeaponPistolFastSwitchMinSpeedMult: number;
}
export interface IGraphicSettings {
ExperimentalFogInCity: boolean;
}
export interface IBufferZone {
CustomerAccessTime: number;
CustomerCriticalTimeStart: number;
@ -146,7 +161,11 @@ export interface IKill {
expOnDamageAllHealth: number;
longShotDistance: number;
bloodLossToLitre: number;
botExpOnDamageAllHealth: number;
botHeadShotMult: number;
victimBotLevelExp: number;
pmcExpOnDamageAllHealth: number;
pmcHeadShotMult: number;
}
export interface ICombo {
percent: number;
@ -756,6 +775,7 @@ export interface IStamina {
OverweightConsumptionByPose: Ixyz;
AimingSpeedMultiplier: number;
WalkVisualEffectMultiplier: number;
WeaponFastSwitchConsumption: number;
HandsCapacity: number;
HandsRestoration: number;
ProneConsumption: number;
@ -1215,6 +1235,11 @@ export interface IFenceLevel {
ScavAttackSupport: boolean;
ExfiltrationPriceModifier: number;
AvailableExits: number;
BotApplySilenceChance: number;
BotGetInCoverChance: number;
BotHelpChance: number;
BotSpreadoutChance: number;
BotStopChance: number;
}
export interface IInertia {
InertiaLimits: Ixyz;

View File

@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot";
export interface ILocation {
base: ILocationBase;
looseLoot: ILooseLoot;
statics: IStaticContainer;
}
export interface IStaticContainer {
containersGroups: Record<string, IContainerMinMax>;
containers: Record<string, IContainerData>;
}
export interface IContainerMinMax {
minContainers: number;
maxContainers: number;
current?: number;
chosenCount?: number;
}
export interface IContainerData {
groupId: string;
}

View File

@ -18,6 +18,8 @@ export interface ILocationBase {
BotMaxPlayer: number;
BotMaxTimePlayer: number;
BotNormal: number;
BotSpawnCountStep: number;
BotSpawnPeriodCheck: number;
BotSpawnTimeOffMax: number;
BotSpawnTimeOffMin: number;
BotSpawnTimeOnMax: number;
@ -30,6 +32,7 @@ export interface ILocationBase {
Enabled: boolean;
EnableCoop: boolean;
GlobalLootChanceModifier: number;
GlobalContainerChanceModifier: number;
IconX: number;
IconY: number;
Id: string;
@ -47,6 +50,7 @@ export interface ILocationBase {
MinPlayers: number;
MaxCoopGroup: number;
Name: string;
NonWaveGroupScenario: INonWaveGroupScenario;
NewSpawn: boolean;
OcculsionCullingEnabled: boolean;
OldSpawn: boolean;
@ -85,6 +89,12 @@ export interface ILocationBase {
users_summon_seconds: number;
waves: Wave[];
}
export interface INonWaveGroupScenario {
Chance: number;
Enabled: boolean;
MaxToBeGroup: number;
MinToBeGroup: number;
}
export interface ILimit extends MinMax {
items: any[];
}
@ -207,6 +217,7 @@ export interface Wave {
time_max: number;
time_min: number;
sptId?: string;
ChanceGroup?: number;
}
export declare enum WildSpawnType {
ASSAULT = "assault",

View File

@ -16,11 +16,12 @@ export interface SpawnpointsForced {
}
export interface SpawnpointTemplate {
Id: string;
IsStatic: boolean;
IsContainer: boolean;
useGravity: boolean;
randomRotation: boolean;
Position: Ixyz;
Rotation: Ixyz;
IsAlwaysSpawn: boolean;
IsGroupPosition: boolean;
GroupPositions: any[];
Root: string;

View File

@ -1,3 +1,7 @@
import { IBotBase } from "./tables/IBotBase";
import { IBotBase, IEftStats } from "./tables/IBotBase";
export interface IPmcData extends IBotBase {
}
export interface IPostRaidPmcData extends IBotBase {
/** Only found in profile we get from client post raid */
EftStats: IEftStats;
}

View File

@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem";
import { IPmcDataRepeatableQuest } from "./IRepeatableQuests";
export interface IBotBase {
_id: string;
aid: string;
aid: number;
/** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */
sessionId: string;
savage?: string;
Info: Info;
Customization: Customization;
@ -121,6 +123,8 @@ export interface Inventory {
sortingTable: string;
questRaidItems: string;
questStashItems: string;
/** Key is hideout area enum numeric as string e.g. "24", value is area _id */
hideoutAreaStashes: Record<string, string>;
fastPanel: Record<string, string>;
}
export interface IBaseJsonSkills {
@ -146,6 +150,9 @@ export interface Common extends IBaseSkill {
export interface Mastering extends IBaseSkill {
}
export interface Stats {
Eft: IEftStats;
}
export interface IEftStats {
CarriedQuestItems: string[];
Victims: Victim[];
TotalSessionExperience: number;
@ -292,6 +299,12 @@ export interface Productive {
SkipTime?: number;
/** Seconds needed to fully craft */
ProductionTime?: number;
GivenItemsInStart?: string[];
Interrupted?: boolean;
/** Used in hideout prodiction.json */
needFuelForAllProductionTime?: boolean;
/** Used when sending data to client */
NeedFuelForAllProductionTime?: boolean;
sptIsScavCase?: boolean;
}
export interface Production extends Productive {

View File

@ -101,18 +101,22 @@ export interface Experience {
standingForKill: number;
}
export interface Generation {
items: ItemMinMax;
items: GenerationWeightingItems;
}
export interface ItemMinMax {
grenades: MinMaxWithWhitelist;
healing: MinMaxWithWhitelist;
drugs: MinMaxWithWhitelist;
stims: MinMaxWithWhitelist;
looseLoot: MinMaxWithWhitelist;
magazines: MinMaxWithWhitelist;
specialItems: MinMaxWithWhitelist;
export interface GenerationWeightingItems {
grenades: GenerationData;
healing: GenerationData;
drugs: GenerationData;
stims: GenerationData;
backpackLoot: GenerationData;
pocketLoot: GenerationData;
vestLoot: GenerationData;
magazines: GenerationData;
specialItems: GenerationData;
}
export interface MinMaxWithWhitelist extends MinMax {
export interface GenerationData {
/** key: number of items, value: weighting */
weights: Record<string, number>;
/** Array of item tpls */
whitelist: string[];
}

View File

@ -11,31 +11,30 @@ export interface IStaticAmmoDetails {
}
export interface IStaticContainerDetails {
staticWeapons: IStaticWeaponProps[];
staticContainers: IStaticContainerProps[];
staticContainers: IStaticContainerData[];
staticForced: IStaticForcedProps[];
}
export interface IStaticWeaponProps {
export interface IStaticContainerData {
probability: number;
template: IStaticContainerProps;
}
export interface IStaticPropsBase {
Id: string;
IsStatic: boolean;
IsContainer: boolean;
useGravity: boolean;
randomRotation: boolean;
Position: Ixyz;
Rotation: Ixyz;
IsGroupPosition: boolean;
IsAlwaysSpawn: boolean;
GroupPositions: any[];
Root: string;
Items: any[];
}
export interface IStaticWeaponProps extends IStaticPropsBase {
Items: Item[];
}
export interface IStaticContainerProps {
Id: string;
IsStatic: boolean;
useGravity: boolean;
randomRotation: boolean;
Position: Ixyz;
Rotation: Ixyz;
IsGroupPosition: boolean;
GroupPositions: any[];
Root: string;
export interface IStaticContainerProps extends IStaticPropsBase {
Items: StaticItem[];
}
export interface StaticItem {

View File

@ -7,4 +7,5 @@ export interface Metrics {
RenderBins: number[];
GameUpdateBins: number[];
MemoryMeasureInterval: number;
PauseReasons: number[];
}

View File

@ -1,4 +1,4 @@
import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile";
import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile";
import { IPmcData } from "../IPmcData";
export interface IProfileTemplates {
Standard: IProfileSides;
@ -14,7 +14,7 @@ export interface TemplateSide {
character: IPmcData;
suits: string[];
dialogues: Record<string, Dialogue>;
weaponbuilds: Record<string, WeaponBuild>;
userbuilds: IUserBuilds;
trader: ProfileTraderTemplate;
}
export interface ProfileTraderTemplate {

View File

@ -9,6 +9,7 @@ export interface ITemplateItem {
}
export interface Props {
AllowSpawnOnLocations?: any[];
BeltMagazineRefreshCount?: number;
ChangePriceCoef?: number;
FixedPrice?: boolean;
SendToClient?: boolean;
@ -83,6 +84,7 @@ export interface Props {
Velocity?: number;
RaidModdable?: boolean;
ToolModdable?: boolean;
UniqueAnimationModID?: number;
BlocksFolding?: boolean;
BlocksCollapsible?: boolean;
IsAnimated?: boolean;
@ -106,10 +108,12 @@ export interface Props {
Intensity?: number;
Mask?: string;
MaskSize?: number;
IsMagazineForStationaryWeapon?: boolean;
NoiseIntensity?: number;
NoiseScale?: number;
Color?: IColor;
DiffuseIntensity?: number;
MagazineWithBelt?: boolean;
HasHinge?: boolean;
RampPalette?: string;
DepthFade?: number;
@ -212,6 +216,7 @@ export interface Props {
MinRepairDegradation?: number;
MaxRepairDegradation?: number;
IronSightRange?: number;
IsBeltMachineGun?: boolean;
IsFlareGun?: boolean;
IsGrenadeLauncher?: boolean;
IsOneoff?: boolean;

View File

@ -6,6 +6,7 @@ export interface IGameConfigResponse {
taxonomy: number;
activeProfileId: string;
backend: Backend;
useProtobuf: boolean;
utc_time: number;
/** Total in game time */
totalInGame: number;

View File

@ -8,6 +8,7 @@ export interface IHideoutArea {
craftGivesExp: boolean;
displayLevel: boolean;
enableAreaRequirements: boolean;
parentArea?: string;
stages: Record<string, Stage>;
}
export interface IAreaRequirement {
@ -19,6 +20,8 @@ export interface Stage {
autoUpgrade: boolean;
bonuses: StageBonus[];
constructionTime: number;
/** Containers inventory tpl */
container?: string;
description: string;
displayInterface: boolean;
improvements: IStageImprovement[];
@ -67,6 +70,7 @@ export interface StageBonus {
type: string;
filter?: string[];
icon?: string;
/** CHANGES PER DUMP */
id?: string;
templateId?: string;
}

View File

@ -1,10 +1,10 @@
import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState";
import { IPmcData } from "../common/IPmcData";
import { IPostRaidPmcData } from "../common/IPmcData";
import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData";
import { IInsuredItemsData } from "./IInsuredItemsData";
export interface ISaveProgressRequestData {
exit: PlayerRaidEndState;
profile: IPmcData;
profile: IPostRaidPmcData;
isPlayerScav: boolean;
health: ISyncHealthRequestData;
insurance: IInsuredItemsData[];

View File

@ -5,6 +5,7 @@ export interface To {
id: string;
container: string;
location?: ToLocation | number;
isSearched?: boolean;
}
export interface ToLocation {
x: number;

View File

@ -1,10 +1,7 @@
import { OwnerInfo } from "../common/request/IBaseInteractionRequestData";
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData {
Action: "Examine";
item: string;
fromOwner: IFromOwner;
}
export interface IFromOwner {
id: string;
type: string;
fromOwner: OwnerInfo;
}

View File

@ -1,7 +1,11 @@
import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData {
Action: "Split";
item: string;
/** Id of item to split */
splitItem: string;
/** Id of new item stack */
newItem: string;
/** Destination new item will be placed in */
container: Container;
count: number;
}

View File

@ -1,3 +1,4 @@
import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType";
import { QuestStatus } from "../../../models/enums/QuestStatus";
import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase";
import { Item, Upd } from "../common/tables/IItem";
@ -20,7 +21,8 @@ export interface ProfileChange {
experience: number;
quests: IQuest[];
ragFairOffers: IRagfairOffer[];
builds: BuildChange[];
weaponBuilds: IWeaponBuildChange[];
equipmentBuilds: IEquipmentBuildChange[];
items: ItemChanges;
production: Record<string, Productive>;
/** Hideout area improvement id */
@ -30,8 +32,13 @@ export interface ProfileChange {
traderRelations: Record<string, TraderInfo>;
repeatableQuests?: IPmcDataRepeatableQuest[];
recipeUnlocked: Record<string, boolean>;
changedHideoutStashes?: Record<string, IHideoutStashItem>;
questsStatus: QuestStatusChange[];
}
export interface IHideoutStashItem {
Id: string;
Tpl: string;
}
export interface QuestStatusChange {
qid: string;
startTime: number;
@ -40,12 +47,21 @@ export interface QuestStatusChange {
completedConditions: string[];
availableAfter: number;
}
export interface BuildChange {
export interface IWeaponBuildChange {
id: string;
name: string;
root: string;
items: Item[];
}
export interface IEquipmentBuildChange {
id: string;
name: string;
root: string;
items: Item[];
type: string;
fastpanel: any[];
buildType: EquipmentBuildType;
}
export interface ItemChanges {
new: Product[];
change: Product[];

View File

@ -1,4 +1,4 @@
import { Upd } from "../common/tables/IItem";
import { Item } from "../common/tables/IItem";
export interface IPresetBuildActionRequestData {
Action: string;
id: string;
@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData {
root: string;
items: Item[];
}
export interface Item {
_id: string;
_tpl: string;
upd?: Upd;
parentId?: string;
slotId?: string;
}

View File

@ -0,0 +1,4 @@
export interface IRemoveBuildRequestData {
Action: "RemoveBuild";
id: string;
}

View File

@ -1,3 +1,4 @@
import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType";
import { MemberCategory } from "../../../models/enums/MemberCategory";
import { MessageType } from "../../enums/MessageType";
import { IPmcData } from "../common/IPmcData";
@ -7,7 +8,7 @@ export interface IAkiProfile {
characters: Characters;
/** Clothing purchases */
suits: string[];
weaponbuilds: Record<string, WeaponBuild>;
userbuilds: IUserBuilds;
dialogues: Record<string, Dialogue>;
aki: Aki;
vitality: Vitality;
@ -22,6 +23,7 @@ export declare class TraderPurchaseData {
}
export interface Info {
id: string;
aid: number;
username: string;
password: string;
wipe: boolean;
@ -31,11 +33,25 @@ export interface Characters {
pmc: IPmcData;
scav: IPmcData;
}
export interface WeaponBuild {
export interface IUserBuilds {
weaponBuilds: IWeaponBuild[];
equipmentBuilds: IEquipmentBuild[];
}
export interface IWeaponBuild {
id: string;
name: string;
root: string;
items: Item[];
type: string;
}
export interface IEquipmentBuild {
id: string;
name: string;
root: string;
items: Item[];
type: string;
fastPanel: Record<string, string>;
buildType: EquipmentBuildType;
}
export interface Dialogue {
attachmentsNew: number;
@ -74,7 +90,7 @@ export interface Message {
Member?: IUpdatableChatMember;
templateId?: string;
text?: string;
hasRewards: boolean;
hasRewards?: boolean;
rewardCollected: boolean;
items?: MessageItems;
maxStorageTime?: number;

View File

@ -0,0 +1,6 @@
import { OwnerInfo } from "../common/request/IBaseInteractionRequestData";
export interface ISellScavItemsToFenceRequestData {
Action: "SellAllFromSavage";
fromOwner: OwnerInfo;
toOwner: OwnerInfo;
}

View File

@ -0,0 +1,3 @@
export declare enum AccountTypes {
SPT_DEVELOPER = "spt developer"
}

View File

@ -6,6 +6,7 @@ export declare enum BackendErrorCodes {
WRONG_AUTHORIZATION_CODE = 211,
NEED_CAPTCHA = 214,
NO_NEED_CAPTCHA = 215,
CAPTCHA_INVALID_ANSWER = 216,
CAPTCHA_FAILED = 218,
CAPTCHA_BRUTE_FORCED = 219,
NO_ROOM_IN_STASH = 223,
@ -15,6 +16,7 @@ export declare enum BackendErrorCodes {
REPORT_NOT_ALLOWED = 238,
NICKNAME_IS_ABUSIVE = 241,
NICKNAME_CHANGE_TIMEOUT = 242,
NOT_ENOUGH_SPACE_TO_UNPACK = 257,
NOT_MODIFIED = 304,
HTTP_BAD_REQUEST = 400,
HTTP_NOT_AUTHORIZED = 401,
@ -63,5 +65,21 @@ export declare enum BackendErrorCodes {
EXAMINATIONFAILED = 22001,
ITEMALREADYEXAMINED = 22002,
UNKNOWNNGINXERROR = 9000,
PARSERESPONSEERROR = 9001
PARSERESPONSEERROR = 9001,
UNKNOWNMATCHMAKERERROR2 = 503000,
UNKNOWNGROUPERROR = 502000,
GROUPREQUESTNOTFOUND = 502002,
GROUPFULL = 502004,
PLAYERALREADYINGROUP = 502005,
PLAYERNOTINGROUP = 502006,
PLAYERNOTLEADER = 502007,
CANTCHANGEREADYSTATE = 502010,
PLAYERFORBIDDENGROUPINVITES = 502011,
LEADERALREADYREADY = 502012,
GROUPSENDINVITEERROR = 502013,
PLAYERISOFFLINE = 502014,
PLAYERISNOTSEARCHINGFORGROUP = 502018,
PLAYERALREADYLOOKINGFORGAME = 503001,
PLAYERINRAID = 503002,
LIMITFORPRESETSREACHED = 504001
}

View File

@ -1,6 +1,7 @@
export declare enum ConfigTypes {
AIRDROP = "aki-airdrop",
BOT = "aki-bot",
PMC = "aki-pmc",
CORE = "aki-core",
HEALTH = "aki-health",
HIDEOUT = "aki-hideout",

View File

@ -0,0 +1,4 @@
export declare enum EquipmentBuildType {
CUSTOM = 0,
STANDARD = 1
}

View File

@ -23,5 +23,7 @@ export declare enum HideoutAreas {
BITCOIN_FARM = 20,
CHRISTMAS_TREE = 21,
EMERGENCY_WALL = 22,
GYM = 23
GYM = 23,
WEAPON_STAND = 24,
WEAPON_STAND_SECONDARY = 25
}

View File

@ -16,5 +16,10 @@ export declare enum ItemEventActions {
DELETE_MAP_MARKER = "DeleteMapMarker",
EDIT_MAP_MARKER = "EditMapMarker",
OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer",
HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent"
HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent",
SAVE_WEAPON_BUILD = "SaveWeaponBuild",
REMOVE_WEAPON_BUILD = "RemoveWeaponBuild",
REMOVE_BUILD = "RemoveBuild",
SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild",
REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild"
}

View File

@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber {
FOLLOWERBIRDEYE = 28,
BOSSZRYACHIY = 29,
FOLLOWERZRYACHIY = 30,
ARENAFIGHTER = 31,
ARENAFIGHTEREVENT = 32,
CRAZYASSAULTEVENT = 33,
SPTUSEC = 34,
SPTBEAR = 35
BOSSBOAR = 32,
FOLLOWERBOAR = 33,
ARENAFIGHTER = 34,
ARENAFIGHTEREVENT = 35,
BOSSBOARSNIPER = 36,
CRAZYASSAULTEVENT = 37,
SPTUSEC = 38,
SPTBEAR = 39
}

View File

@ -1,10 +1,12 @@
import { IPmcData } from "../../eft/common/IPmcData";
import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData";
import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse";
import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData";
import { WeaponBuild } from "../../eft/profile/IAkiProfile";
import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse";
import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData";
import { IWeaponBuild } from "../../eft/profile/IAkiProfile";
export interface IPresetBuildCallbacks {
getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData<WeaponBuild[]>;
saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData<IWeaponBuild[]>;
saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
}

View File

@ -1,8 +1,7 @@
import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType";
import { GenerationData } from "../../../models/eft/common/tables/IBotType";
import { MinMax } from "../../common/MinMax";
import { IBaseConfig } from "./IBaseConfig";
import { IBotDurability } from "./IBotDurability";
import { IPmcConfig } from "./IPmcConfig";
export interface IBotConfig extends IBaseConfig {
kind: "aki-bot";
/** How many variants of each bot should be generated on raid start */
@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig {
lootNValue: LootNvalue;
/** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */
revenge: Record<string, string[]>;
/** PMC bot specific config settings */
pmc: IPmcConfig;
/** Control how many items are allowed to spawn on a bot
* key: bottype, value: <key: itemTpl: value: max item count> */
itemSpawnLimits: Record<string, Record<string, number>>;
@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig {
showTypeInNickname: boolean;
/** Max number of bots that can be spawned in a raid at any one time */
maxBotCap: Record<string, number>;
/** Chance scav has fake pscav name e.g. Scav name (player name) */
chanceAssaultScavHasPlayerScavName: number;
/** How many stacks of secret ammo should a bot have in its bot secure container */
secureContainerAmmoStackCount: number;
/** Batch generation size when type not available in cache */
botGenerationBatchSizePerType: number;
}
/** Number of bots to generate and store in cache on raid start per bot type */
export interface PresetBatch {
@ -55,6 +51,7 @@ export interface PresetBatch {
followerBirdEye: number;
followerBigPipe: number;
followerTest: number;
followerBoar: number;
marksman: number;
pmcBot: number;
sectantPriest: number;
@ -65,6 +62,8 @@ export interface PresetBatch {
arenaFighterEvent: number;
arenaFighter: number;
crazyAssaultEvent: number;
bossBoar: number;
bossBoarSniper: number;
sptUsec: number;
sptBear: number;
}
@ -102,7 +101,7 @@ export interface ModLimits {
export interface RandomisationDetails {
/** Between what levels do these randomisation setting apply to */
levelRange: MinMax;
generation?: Record<string, MinMaxWithWhitelist>;
generation?: Record<string, GenerationData>;
/** Mod slots that should be fully randomisate -ignores mods from bottype.json */
randomisedWeaponModSlots?: string[];
/** Armor slots that should be randomised e.g. 'Headwear, Armband' */

View File

@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig {
compatibleTarkovVersion: string;
serverName: string;
profileSaveIntervalSeconds: number;
sptFriendNickname: string;
fixes: IGameFixes;
commit: string;
}

View File

@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig {
kind: "aki-hideout";
runIntervalSeconds: number;
hoursForSkillCrafting: number;
hideoutWallAppearTimeSeconds: number;
expCraftAmount: number;
}

View File

@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig {
enableBotTypeLimits: boolean;
/** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/
botTypeLimits: Record<string, IBotTypeLimit[]>;
/** container randomisation settings */
containerRandomisationSettings: IContainerRandomistionSettings;
/** How full must a random loose magazine be %*/
minFillLooseMagazinePercent: number;
/** How full must a random static magazine be %*/
minFillStaticMagazinePercent: number;
makeWishingTreeAlwaysGiveGift: boolean;
allowDuplicateItemsInStaticContainers: boolean;
}
export interface IContainerRandomistionSettings {
enabled: boolean;
/** What maps can use the container randomisation feature */
maps: Record<string, boolean>;
/** Some container types don't work when randomised */
containerTypesToNotRandomise: string[];
containerGroupMinSizeMultiplier: number;
containerGroupMaxSizeMultiplier: number;
}
export interface IFixEmptyBotWavesSettings {
enabled: boolean;

View File

@ -1,4 +1,4 @@
import { MinMax } from "../../common/MinMax";
import { GenerationData } from "../../../models/eft/common/tables/IBotType";
import { IBaseConfig } from "./IBaseConfig";
export interface IPlayerScavConfig extends IBaseConfig {
kind: "aki-playerscav";
@ -16,10 +16,10 @@ export interface Modifiers {
mod: Record<string, number>;
}
export interface ItemLimits {
healing: MinMax;
drugs: MinMax;
stims: MinMax;
looseLoot: MinMax;
magazines: MinMax;
grenades: MinMax;
healing: GenerationData;
drugs: GenerationData;
stims: GenerationData;
looseLoot: GenerationData;
magazines: GenerationData;
grenades: GenerationData;
}

View File

@ -1,6 +1,8 @@
import { MemberCategory } from "../../../models/enums/MemberCategory";
import { MinMax } from "../../common/MinMax";
export interface IPmcConfig {
import { IBaseConfig } from "./IBaseConfig";
export interface IPmcConfig extends IBaseConfig {
kind: "aki-pmc";
/** What game version should the PMC have */
gameVersionWeight: Record<string, number>;
/** What account type should the PMC have */
@ -18,6 +20,8 @@ export interface IPmcConfig {
difficulty: string;
/** Chance out of 100 to have a complete gun in backpack */
looseWeaponInBackpackChancePercent: number;
/** Chance out of 100 to have an enhancement applied to PMC weapon */
weaponHasEnhancementChancePercent: number;
/** MinMax count of weapons to have in backpack */
looseWeaponInBackpackLootMinMax: MinMax;
/** Percentage chance PMC will be USEC */

View File

@ -28,6 +28,10 @@ export interface FenceConfig {
itemStackSizeOverrideMinMax: Record<string, MinMax>;
itemTypeLimits: Record<string, number>;
regenerateAssortsOnRefresh: boolean;
/** Max rouble price before item is not listed on flea */
itemCategoryRoublePriceLimit: Record<string, number>;
/** Each slotid with % to be removed prior to listing on fence */
presetSlotsToRemoveChancePercent: Record<string, number>;
/** Block seasonal items from appearing when season is inactive */
blacklistSeasonalItems: boolean;
blacklist: string[];

View File

@ -1,4 +1,5 @@
import { IQteData } from "../../../models/eft/hideout/IQteData";
import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile";
import { IGlobals } from "../../eft/common/IGlobals";
import { IBotBase } from "../../eft/common/tables/IBotBase";
import { IBotCore } from "../../eft/common/tables/IBotCore";
@ -48,6 +49,8 @@ export interface IDatabaseTables {
profiles: IProfileTemplates;
/** Flea prices of items - gathered from online flea market dump */
prices: Record<string, number>;
/** Default equipment loadouts that show on main inventory screen */
defaultEquipmentPresets: IEquipmentBuild[];
};
traders?: Record<string, ITrader>;
globals?: IGlobals;

View File

@ -33,7 +33,7 @@ export declare class EventOutputHolder {
*/
protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record<string, IHideoutImprovement>;
/**
* Return productions from player profile except those completed crafts the client has already seen
* Return productions from player profile except those completed crafts the client has already seen
* @param pmcData Player profile
* @returns dictionary of hideout productions
*/

View File

@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http";
import { NotifierController } from "../../controllers/NotifierController";
import { Serializer } from "../../di/Serializer";
import { HttpServerHelper } from "../../helpers/HttpServerHelper";
import { JsonUtil } from "../../utils/JsonUtil";
export declare class NotifySerializer extends Serializer {
protected notifierController: NotifierController;
protected jsonUtil: JsonUtil;
protected httpServerHelper: HttpServerHelper;
constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper);
constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper);
serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void;
canHandle(route: string): boolean;
}

View File

@ -1,12 +1,13 @@
import { JsonUtil } from "../utils/JsonUtil";
import { VFS } from "../utils/VFS";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigTypes } from "../models/enums/ConfigTypes";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class ConfigServer {
protected logger: ILogger;
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected configs: Record<string, any>;
protected readonly acceptableFileExtensions: string[];
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil);
getConfig<T>(configType: ConfigTypes): T;
getConfigByString<T>(configType: string): T;

View File

@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { LocalisationService } from "../services/LocalisationService";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { ConfigServer } from "./ConfigServer";
export declare class WebSocketServer {
@ -13,8 +14,9 @@ export declare class WebSocketServer {
protected randomUtil: RandomUtil;
protected configServer: ConfigServer;
protected localisationService: LocalisationService;
protected jsonUtil: JsonUtil;
protected httpServerHelper: HttpServerHelper;
constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper);
constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper);
protected httpConfig: IHttpConfig;
protected defaultNotification: INotification;
protected webSockets: Record<string, WebSocket.WebSocket>;

View File

@ -1,5 +1,5 @@
import { BotHelper } from "../helpers/BotHelper";
import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType";
import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType";
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService {
* @param generationChanges Changes to apply
* @param baseBotGeneration dictionary to update
*/
protected adjustGenerationChances(generationChanges: Record<string, MinMaxWithWhitelist>, baseBotGeneration: Generation): void;
protected adjustGenerationChances(generationChanges: Record<string, GenerationData>, baseBotGeneration: Generation): void;
/**
* Get equipment settings for bot
* @param botEquipmentRole equipment role to return

View File

@ -44,12 +44,12 @@ export declare class FenceService {
* Replace main fence assort with new assort
* @param assort New assorts to replace old with
*/
protected setFenceAssort(assort: ITraderAssort): void;
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;
setFenceDiscountAssort(assort: ITraderAssort): void;
/**
* Get assorts player can purchase
* Adjust prices based on fence level of player
@ -153,6 +153,18 @@ export declare class FenceService {
* @param loyaltyLevel loyalty level to requre item at
*/
protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record<string, IPreset>, assorts: ITraderAssort, loyaltyLevel: number): void;
/**
* Remove parts of a weapon prior to being listed on flea
* @param weaponAndMods Weapon to remove parts from
*/
protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void;
/**
* Roll % chance check to see if item should be removed
* @param weaponMod Weapon mod being checked
* @param itemsBeingDeleted Current list of items on weapon being deleted
* @returns True if item will be removed
*/
protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean;
/**
* Randomise items' upd properties e.g. med packs/weapons/armor
* @param itemDetails Item being randomised

View File

@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader";
import { DialogueHelper } from "../helpers/DialogueHelper";
import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { NotificationSendHelper } from "../helpers/NotificationSendHelper";
import { SecureContainerHelper } from "../helpers/SecureContainerHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
import { LocaleService } from "./LocaleService";
import { LocalisationService } from "./LocalisationService";
import { MailSendService } from "./MailSendService";
export declare class InsuranceService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
@ -33,11 +33,11 @@ export declare class InsuranceService {
protected handbookHelper: HandbookHelper;
protected localisationService: LocalisationService;
protected localeService: LocaleService;
protected notificationSendHelper: NotificationSendHelper;
protected mailSendService: MailSendService;
protected configServer: ConfigServer;
protected insured: Record<string, Record<string, Item[]>>;
protected insuranceConfig: IInsuranceConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer);
constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer);
/**
* Does player have insurance array
* @param sessionId Player id
@ -67,9 +67,10 @@ export declare class InsuranceService {
sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void;
/**
* Send a message to player informing them gear was lost
* @param sessionID Session id
* @param sessionId Session id
* @param locationName name of map insurance was lost on
*/
sendLostInsuranceMessage(sessionID: string): void;
sendLostInsuranceMessage(sessionId: string, locationName?: string): void;
/**
* Check all root insured items and remove location property + set slotId to 'hideout'
* @param sessionId Session id

View File

@ -45,7 +45,7 @@ export declare class MailSendService {
* @param items Optional items to send to player
* @param maxStorageTimeSeconds Optional time to collect items before they expire
*/
sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void;
sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void;
/**
* Send a message from SYSTEM to the player with or without items
* @param playerId Players id to send message to
@ -54,6 +54,14 @@ export declare class MailSendService {
* @param maxStorageTimeSeconds Optional time to collect items before they expire
*/
sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void;
/**
* Send a message from SYSTEM to the player with or without items with loalised text
* @param playerId Players id to send message to
* @param messageLocaleId Id of key from locale file to send to player
* @param items Optional items to send to player
* @param maxStorageTimeSeconds Optional time to collect items before they expire
*/
sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void;
/**
* Send a USER message to a player with or without items
* @param playerId Players id to send message to

View File

@ -35,6 +35,9 @@ export declare class ProfileFixerService {
* @param pmcProfile profile to check and fix
*/
checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void;
protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void;
protected addHideoutAreaStashes(pmcProfile: IPmcData): void;
protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void;
protected adjustUnreasonableModFleaPrices(): void;
/**
* Add tag to profile to indicate when it was made

View File

@ -94,11 +94,11 @@ export declare class RepairService {
*/
addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void;
/**
* Add buff to item
* Add random buff to item
* @param itemConfig weapon/armor config
* @param repairDetails Details for item to repair
*/
protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void;
addBuff(itemConfig: BonusSettings, item: Item): void;
/**
* Check if item should be buffed by checking the item type and relevant player skill level
* @param repairDetails Item that was repaired

View File

@ -18,4 +18,5 @@ export declare class HashUtil {
* @returns hash value
*/
generateHashForData(algorithm: string, data: crypto.BinaryLike): string;
generateAccountId(): number;
}

View File

@ -9,6 +9,11 @@ export declare class HttpResponseUtil {
protected localisationService: LocalisationService;
constructor(jsonUtil: JsonUtil, localisationService: LocalisationService);
protected clearString(s: string): any;
/**
* Return passed in data as JSON string
* @param data
* @returns
*/
noBody(data: any): any;
getBody<T>(data: T, err?: number, errmsg?: any): IGetBodyResponseData<T>;
getUnclearedBody(data: any, err?: number, errmsg?: any): string;

View File

@ -1,3 +1,4 @@
import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces";
import { ILogger } from "../models/spt/utils/ILogger";
import { HashUtil } from "./HashUtil";
import { VFS } from "./VFS";
@ -7,21 +8,68 @@ export declare class JsonUtil {
protected logger: ILogger;
protected fileHashes: any;
protected jsonCacheExists: boolean;
protected jsonCachePath: string;
constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger);
/**
* From object to string
* @param data object to turn into JSON
* @param prettify Should output be prettified?
* @param prettify Should output be prettified
* @returns string
*/
serialize<T>(data: T, prettify?: boolean): string;
serialize(data: any, prettify?: boolean): string;
/**
* From object to string
* @param data object to turn into JSON
* @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
* @returns string
*/
serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
/**
* From object to string
* @param data object to turn into JSON
* @param filename Name of file being serialized
* @param options Stringify options or a replacer.
* @returns The string converted from the JavaScript value
*/
serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string;
/**
* From string to object
* @param jsonString json string to turn into object
* @param filename Name of file being deserialized
* @returns object
*/
deserialize<T>(jsonString: string, filename?: string): T;
/**
* From string to object
* @param jsonString json string to turn into object
* @param filename Name of file being deserialized
* @param options Parsing options
* @returns object
*/
deserializeJsonC<T>(jsonString: string, filename?: string, options?: IParseOptions): T;
deserializeWithCacheCheckAsync<T>(jsonString: string, filePath: string): Promise<T>;
/**
* From json string to object
* @param jsonString String to turn into object
* @param filePath Path to json file being processed
* @returns Object
*/
deserializeWithCacheCheck<T>(jsonString: string, filePath: string): T;
clone<T>(data: T): T;
/**
* Create file if nothing found
* @param jsonCachePath path to cache
*/
protected ensureJsonCacheExists(jsonCachePath: string): void;
/**
* Read contents of json cache and add to class field
* @param jsonCachePath Path to cache
*/
protected hydrateJsonCache(jsonCachePath: string): void;
/**
* Convert into string and back into object to clone object
* @param objectToClone Item to clone
* @returns Cloned parameter
*/
clone<T>(objectToClone: T): T;
}

View File

@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil";
*/
export declare class ProbabilityObjectArray<K, V = undefined> extends Array<ProbabilityObject<K, V>> {
private mathUtil;
constructor(mathUtil: MathUtil, ...items: ProbabilityObject<K, V>[]);
private jsonUtil;
constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject<K, V>[]);
filter(callbackfn: (value: ProbabilityObject<K, V>, index: number, array: ProbabilityObject<K, V>[]) => any): ProbabilityObjectArray<K, V>;
/**
* Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1
@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray<K, V = undefined> extends Array<Prob
/**
* Draw random element of the ProbabilityObject N times to return an array of N keys.
* Drawing can be with or without replacement
*
* @param {integer} count The number of times we want to draw
* @param {boolean} replacement Draw with or without replacement from the input dict
* @param {array} locklist list keys which shall be replaced even if drawing without replacement
* @return {array} Array consisting of N random keys for this ProbabilityObjectArray
* @param count The number of times we want to draw
* @param replacement Draw with or without replacement from the input dict (true = dont remove after drawing)
* @param locklist list keys which shall be replaced even if drawing without replacement
* @returns Array consisting of N random keys for this ProbabilityObjectArray
*/
draw(count?: number, replacement?: boolean, locklist?: Array<K>): K[];
}

View File

@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout
export declare class InventoryCallbacks {
protected inventoryController: InventoryController;
constructor(inventoryController: InventoryController);
/** Handle "move" */
moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse;
splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;

View File

@ -24,5 +24,7 @@ declare class LauncherCallbacks {
ping(url: string, info: IEmptyRequestData, sessionID: string): string;
removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string;
getCompatibleTarkovVersion(): string;
getLoadedServerMods(): string;
getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string;
}
export { LauncherCallbacks };

View File

@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier";
import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData";
import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
export declare class NotifierCallbacks {
protected httpServerHelper: HttpServerHelper;
protected httpResponse: HttpResponseUtil;
protected jsonUtil: JsonUtil;
protected notifierController: NotifierController;
constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController);
constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController);
/**
* If we don't have anything to send, it's ok to not send anything back
* because notification requests can be long-polling. In fact, we SHOULD wait

View File

@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData";
import { WeaponBuild } from "../models/eft/profile/IAkiProfile";
import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData";
import { IUserBuilds } from "../models/eft/profile/IAkiProfile";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class PresetBuildCallbacks {
protected httpResponse: HttpResponseUtil;
protected presetBuildController: PresetBuildController;
constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController);
/** Handle client/handbook/builds/my/list */
getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<WeaponBuild[]>;
/** Handle SaveBuild event */
saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle RemoveBuild event*/
removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IUserBuilds>;
/** Handle SaveWeaponBuild event */
saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle removeBuild event*/
removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle RemoveWeaponBuild event*/
removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle SaveEquipmentBuild event */
saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle RemoveEquipmentBuild event*/
removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
}

View File

@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData";
export declare class TradeCallbacks {
protected tradeController: TradeController;
constructor(tradeController: TradeController);
@ -12,4 +13,6 @@ export declare class TradeCallbacks {
processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle RagFairBuyOffer event */
processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle SellAllFromSavage event */
sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse;
}

View File

@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase";
import { IBotCore } from "../models/eft/common/tables/IBotCore";
import { Difficulty } from "../models/eft/common/tables/IBotType";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
@ -29,6 +30,7 @@ export declare class BotController {
protected applicationContext: ApplicationContext;
protected jsonUtil: JsonUtil;
protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig;
static readonly pmcTypeLabel = "PMC";
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
/**

View File

@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia
import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest";
import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile";
import { MessageType } from "../models/enums/MessageType";
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { SaveServer } from "../servers/SaveServer";
import { GiftService } from "../services/GiftService";
import { MailSendService } from "../services/MailSendService";
@ -24,7 +26,9 @@ export declare class DialogueController {
protected mailSendService: MailSendService;
protected giftService: GiftService;
protected hashUtil: HashUtil;
constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil);
protected configServer: ConfigServer;
protected coreConfig: ICoreConfig;
constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer);
/** Handle onUpdate spt event */
update(): void;
/**

View File

@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomLocationWaveService } from "../services/CustomLocationWaveService";
import { GiftService } from "../services/GiftService";
import { ItemBaseClassService } from "../services/ItemBaseClassService";
import { LocalisationService } from "../services/LocalisationService";
import { OpenZoneService } from "../services/OpenZoneService";
import { ProfileFixerService } from "../services/ProfileFixerService";
import { SeasonalEventService } from "../services/SeasonalEventService";
import { EncodingUtil } from "../utils/EncodingUtil";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
@ -34,6 +36,7 @@ export declare class GameController {
protected databaseServer: DatabaseServer;
protected jsonUtil: JsonUtil;
protected timeUtil: TimeUtil;
protected hashUtil: HashUtil;
protected preAkiModLoader: PreAkiModLoader;
protected httpServerHelper: HttpServerHelper;
protected randomUtil: RandomUtil;
@ -45,6 +48,7 @@ export declare class GameController {
protected customLocationWaveService: CustomLocationWaveService;
protected openZoneService: OpenZoneService;
protected seasonalEventService: SeasonalEventService;
protected itemBaseClassService: ItemBaseClassService;
protected giftService: GiftService;
protected applicationContext: ApplicationContext;
protected configServer: ConfigServer;
@ -53,12 +57,20 @@ export declare class GameController {
protected coreConfig: ICoreConfig;
protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig;
protected botConfig: IBotConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer);
protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer);
/**
* Handle client/game/start
*/
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
protected makeCustomsWishingTreeLootGuaranteed(): void;
protected setHideoutAreasAndCraftsTo30Secs(): void;
/**
* 3.7.0 moved AIDs to be numeric, old profiles need to be migrated
* We store the old AID value in new field `sessionId`
* @param fullProfile Profile to update
*/
protected fixIncorrectAidValue(fullProfile: IAkiProfile): void;
/** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */
protected adjustMapBotLimits(): void;
/**

View File

@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData";
import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase";
import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData";
import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData";
import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea";
import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData";
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad
import { IQteData } from "../models/eft/hideout/IQteData";
import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { HideoutAreas } from "../models/enums/HideoutAreas";
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
@ -76,6 +78,37 @@ export declare class HideoutController {
* @returns IItemEventRouterResponse
*/
upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Upgrade wall status to visible in profile if medstation/water collector are both level 1
* @param pmcData Player profile
*/
protected checkAndUpgradeWall(pmcData: IPmcData): void;
/**
*
* @param pmcData Profile to edit
* @param output Object to send back to client
* @param sessionID Session/player id
* @param profileHideoutArea Current hideout data for profile
* @param dbHideoutArea Hideout area being upgraded
* @param hideoutStage Stage hideout area is being upgraded to
*/
protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void;
/**
* Add an inventory item to profile from a hideout area stage data
* @param pmcData Profile to update
* @param dbHideoutData Hideout area from db being upgraded
* @param hideoutStage Stage area upgraded to
*/
protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void;
/**
*
* @param output Objet to send to client
* @param sessionID Session/player id
* @param areaType Hideout area that had stash added
* @param hideoutDbData Hideout area that caused addition of stash
* @param hideoutStage Hideout area upgraded to this
*/
protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void;
/**
* Handle HideoutPutItemsInAreaSlots
* Create item in hideout slot item array, remove item from player inventory

View File

@ -104,10 +104,8 @@ export declare class InraidController {
/**
* Mark inventory items as FiR if player survived raid, otherwise remove FiR from them
* @param offraidData Save Progress Request
* @param pmcData player profile
* @param isPlayerScav Was the player a pScav
*/
protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void;
protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void;
/**
* Update profile after player completes scav raid
* @param scavData Scav profile

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