Update 350 types + readme

This commit is contained in:
Chomp 2023-01-17 13:54:10 +00:00
parent e76f83f229
commit 02cb78b918
27 changed files with 316 additions and 77 deletions

View File

@ -24,34 +24,18 @@ export declare class HideoutCallbacks extends OnUpdate {
configServer: ConfigServer);
/**
* Handle HideoutUpgrade
* @param pmcData
* @param body
* @param sessionID
* @returns
*/
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutUpgradeComplete
* @param pmcData
* @param body
* @param sessionID
* @returns
*/
upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutPutItemsInAreaSlots
* @param pmcData
* @param body
* @param sessionID
* @returns
*/
putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutTakeItemsFromAreaSlots
* @param pmcData
* @param body
* @param sessionID
* @returns
*/
takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse;
/**

View File

@ -56,8 +56,22 @@ export declare class HideoutController {
protected static nameBackendCountersCrafting: string;
protected hideoutConfig: IHideoutConfig;
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil);
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Start a hideout area upgrade
* @param pmcData Player profile
* @param request upgrade start request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
startUpgrade(pmcData: IPmcData, request: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Complete a hideout area upgrade
* @param pmcData Player profile
* @param request Completed upgrade request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Create item in hideout slot item array, remove item from player inventory
* @param pmcData Profile data
@ -66,7 +80,14 @@ export declare class HideoutController {
* @returns IItemEventRouterResponse object
*/
putItemsInAreaSlots(pmcData: IPmcData, addItemToHideoutRequest: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Remove item from hideout area and place into player inventory
* @param pmcData Player profile
* @param request Take item out of area request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
takeItemsFromAreaSlots(pmcData: IPmcData, request: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Find resource item in hideout area, add copy to player inventory, remove Item from hideout slot
* @param sessionID Session id
@ -77,7 +98,21 @@ export declare class HideoutController {
* @returns IItemEventRouterResponse response
*/
protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: HideoutArea): IItemEventRouterResponse;
toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Toggle area on/off
* @param pmcData Player profile
* @param request Toggle area request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
toggleArea(pmcData: IPmcData, request: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Start production for an item from hideout area
* @param pmcData Player profile
* @param body Start prodution of single item request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handles event after clicking 'start' on the scav case hideout page
@ -91,21 +126,52 @@ export declare class HideoutController {
* Add generated scav case rewards to player profile
* @param pmcData player profile to add rewards to
* @param rewards reward items to add to profile
* @param recipieId recipie id to save into Production dict
*/
protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[]): void;
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[], recipieId: string): void;
/**
* Start production of continuously created item
* @param pmcData Player profile
* @param request Continious production request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
continuousProductionStart(pmcData: IPmcData, request: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Take completed item out of hideout area and place into player inventory
* @param pmcData Player profile
* @param request Remove production from area request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
takeProduction(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Take recipie-type production out of hideout area and place into player inventory
* @param sessionID Session id
* @param recipe Completed recipie of item
* @param pmcData Player profile
* @param request Remove production from area request
* @param output Output object to update
* @returns IItemEventRouterResponse
*/
protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
/**
* Handles giving rewards stored in player profile to player after clicking 'get rewards'
* @param sessionID
* @param pmcData
* @param body
* @param output
* @returns
* @param sessionID Session id
* @param pmcData Player profile
* @param body Remove production from scavcase area request
* @param output Output object to update
* @returns IItemEventRouterResponse
*/
protected handleScavCase(sessionID: string, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Start area production for item
* @param pmcData Player profile
* @param request Start production request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
registerProduction(pmcData: IPmcData, request: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Get quick time event list for hideout
* // TODO - implement this
@ -136,5 +202,8 @@ export declare class HideoutController {
* @param request improve area request data
*/
improveArea(sessionId: string, pmcData: IPmcData, request: IHideoutImproveAreaRequestData): IItemEventRouterResponse;
/**
* Function called every x seconds as part of onUpdate event
*/
update(): void;
}

View File

@ -31,13 +31,23 @@ export declare class InsuranceController {
protected configServer: ConfigServer;
protected insuranceConfig: IInsuranceConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, insuranceService: InsuranceService, configServer: ConfigServer);
/**
* Process insurance items prior to being given to player in mail
*/
processReturn(): void;
/**
* Add insurance to an item
* @param pmcData Player profile
* @param body Insurance request
* @param sessionID Session id
* @returns IItemEventRouterResponse object to send to client
*/
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Calculate insurance cost
* @param info request object
* @param sessionID session id
* @returns response object to send to client
* @returns IGetInsuranceCostResponseData object to send to client
*/
cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData;
}

View File

@ -129,9 +129,14 @@ export declare class InventoryController {
protected getExaminedItemTpl(body: IInventoryExamineRequestData): string;
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handles sorting of Inventory.
* Handle ApplyInventoryChanges
* Sorts supplied items.
* @param pmcData Player profile
* @param request sort request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse;
sortInventory(pmcData: IPmcData, request: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse;
createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse;
deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse;
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;

View File

@ -103,6 +103,11 @@ export declare class RagfairController {
* @param profile full profile of player
*/
protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, profile: IAkiProfile): void;
/**
* Adjust ragfair offer stack count to match same value as traders assort stack count
* @param offer Flea offer to adjust
*/
protected setTraderOfferStackSize(offer: IRagfairOffer): void;
protected isLinkedSearch(info: ISearchRequestData): boolean;
protected isRequiredSearch(info: ISearchRequestData): boolean;
update(): void;

View File

@ -238,14 +238,15 @@ export declare class RepeatableQuestController {
probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>;
changeRepeatableQuest(pmcDataIn: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
/**
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
* @returns a list of rewardable items [[_tpl, itemTemplate],...]
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
* @param repeatableQuestConfig config file
* @returns a list of rewardable items [[_tpl, itemTemplate],...]
*/
protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [string, ITemplateItem][];
/**
* Checks if an id is a valid item. Valid meaning that it's an item that may be a reward
* or content of bot loot. Items that are tested as valid may be in a player backpack or stash.
* @param {*} tpl template id of item to check
* @param {string} tpl template id of item to check
* @returns boolean: true if item is valid reward
*/
isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean;

View File

@ -49,7 +49,8 @@ export declare class LocationGenerator {
* Add forced spawn point loot into loot parameter array
* @param loot array to add forced loot to
* @param forcedSpawnPoints forced loot to add
* @param name of map currently generating forced loot for
*/
protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[]): void;
protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[], locationName: string): void;
protected createItem(tpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
}

View File

@ -103,7 +103,34 @@ export declare class RagfairOfferGenerator {
* @param traderID Trader to generate offers for
*/
generateFleaOffersForTrader(traderID: string): void;
protected getItemCondition(userID: string, items: Item[], itemDetails: ITemplateItem): Item[];
/**
* Get array of an item with its mods + condition properties (e.g durability)
* Apply randomisation adjustments to condition if item base is found in ragfair.json/dynamic/condition
* @param userID id of owner of item
* @param itemWithMods Item and mods, get condition of first item (only first array item is used)
* @param itemDetails db details of first item
* @returns
*/
protected getItemCondition(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[];
/**
* Get the relevant condition id if item tpl matches in ragfair.json/condition
* @param tpl Item to look for matching condition object
* @returns condition id
*/
protected getDynamicConditionIdForTpl(tpl: string): string;
/**
* Alter an items condition based on its item base type
* @param conditionSettingsId also the parentId of item being altered
* @param item Item to adjust condition details of
* @param itemDetails db item details of first item in array
*/
protected randomiseItemCondition(conditionSettingsId: string, item: Item, itemDetails: ITemplateItem): void;
/**
* Adjust an items durability/maxDurability value
* @param item item (weapon/armor) to adjust
* @param multiplier Value to multiple durability by
*/
protected randomiseDurabilityValues(item: Item, multiplier: number): void;
/**
* Add missing conditions to an item if needed
* Durabiltiy for repairable items
@ -111,7 +138,7 @@ export declare class RagfairOfferGenerator {
* @param item item to add conditions to
* @returns Item with conditions added
*/
protected addMissingCondition(item: Item): Item;
protected addMissingConditions(item: Item): Item;
/**
* Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based
* @param offerItems Items for sale in offer

View File

@ -23,4 +23,6 @@ export declare class DurabilityLimitsHelper {
protected getMaxWeaponDeltaFromConfig(botRole: string): number;
protected getMinArmorDeltaFromConfig(botRole: string): number;
protected getMaxArmorDeltaFromConfig(botRole: string): number;
protected getMinArmorLimitPercentFromConfig(botRole: string): number;
protected getMinWeaponLimitPercentFromConfig(botRole: string): number;
}

View File

@ -36,6 +36,7 @@ export declare class HideoutHelper {
static waterCollector: string;
static bitcoin: string;
static expeditionaryFuelTank: string;
static maxSkillPoint: number;
protected hideoutConfig: IHideoutConfig;
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, configServer: ConfigServer);
registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
@ -118,6 +119,19 @@ export declare class HideoutHelper {
protected hasManagementSkillSlots(pmcData: IPmcData): boolean;
protected getHideoutManagementSkill(pmcData: IPmcData): Common;
protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number;
/**
* Get the crafting skill details from player profile
* @param pmcData Player profile
* @returns crafting skill, null if not found
*/
protected getCraftingSkill(pmcData: IPmcData): Common;
/**
* Adjust craft time based on crafting skill level found in player profile
* @param pmcData Player profile
* @param productionTime Time to complete hideout craft in seconds
* @returns Adjusted craft time in seconds
*/
protected getCraftingSkillProductionTimeReduction(pmcData: IPmcData, productionTime: number): number;
isProduction(productive: Productive): productive is Production;
getBTC(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
/**

View File

@ -27,10 +27,10 @@ export declare class TradeHelper {
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer, configServer: ConfigServer);
/**
* Buy item from flea or trader
* @param pmcData
* @param pmcData Player profile
* @param buyRequestData data from client
* @param sessionID
* @param foundInRaid
* @param sessionID Session id
* @param foundInRaid Should item be found in raid
* @param upd optional item details used when buying from flea
* @returns
*/

View File

@ -76,7 +76,7 @@ export declare class TraderHelper {
*/
protected getTraderDurabiltyPurchaseThreshold(traderId: string): number;
/**
* Get the price of an item and all of its attached children
* Get the price of passed in item and all of its attached children (mods)
* Take into account bonuses/adjsutments e.g. discounts
* @param pmcData profile data
* @param item item to calculate price of
@ -94,7 +94,14 @@ export declare class TraderHelper {
* @returns price as number
*/
protected getRawItemPrice(pmcData: IPmcData, item: Item): number;
protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number;
/**
* Get discount modifier for desired trader
* @param trader Trader to get discount for
* @param buyPriceCoefficient
* @param fenceInfo fence info, needed if getting fence modifier value
* @returns discount modifier value
*/
protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number;
/**
* Add standing to a trader and level them up if exp goes over level threshold
* @param sessionID Session id

View File

@ -23,6 +23,8 @@ export declare class PreAkiModLoader implements IModLoader {
protected configServer: ConfigServer;
protected static container: DependencyContainer;
protected readonly basepath = "user/mods/";
protected readonly modOrderPath = "user/mods/order.json";
protected order: Record<string, number>;
protected imported: Record<string, ModLoader.IMod>;
protected akiConfig: ICoreConfig;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer);

View File

@ -20,6 +20,7 @@ export interface TemplateSide {
export interface ProfileTraderTemplate {
initialLoyaltyLevel: number;
setQuestsAvailableForStart?: boolean;
setQuestsAvailableForFinish?: boolean;
initialStanding: number;
initialSalesSum: number;
jaegerUnlocked: boolean;

View File

@ -84,6 +84,7 @@ export interface ModLimits {
}
export interface RandomisationDetails {
levelRange: MinMax;
generation?: Record<string, MinMax>;
randomisedWeaponModSlots?: string[];
randomisedArmorSlots?: string[];
/** Equipment chances */

View File

@ -14,19 +14,9 @@ export interface IBotDurability {
}
/** Durability values to be used when a more specific bot type cant be found */
export interface DefaultDurability {
armor: DefaultArmor;
armor: ArmorDurability;
weapon: WeaponDurability;
}
export interface DefaultArmor {
maxDelta: number;
minDelta: number;
}
export interface WeaponDurability {
lowestMax: number;
highestMax: number;
maxDelta: number;
minDelta: number;
}
export interface PmcDurability {
armor: PmcDurabilityArmor;
weapon: WeaponDurability;
@ -44,4 +34,12 @@ export interface BotDurability {
export interface ArmorDurability {
maxDelta: number;
minDelta: number;
minLimitPercent: number;
}
export interface WeaponDurability {
lowestMax: number;
highestMax: number;
maxDelta: number;
minDelta: number;
minLimitPercent: number;
}

View File

@ -7,6 +7,8 @@ export interface ILocationConfig extends IBaseConfig {
customWaves: CustomWaves;
/** Open zones to add to map */
openZones: Record<string, string[]>;
/** Key = map id, value = item tpls that should only have one forced loot spawn position */
forcedLootSingleSpawnById: Record<string, string[]>;
}
export interface CustomWaves {
boss: Record<string, BossLocationSpawn[]>;

View File

@ -4,4 +4,5 @@ export interface IRepairConfig extends IBaseConfig {
priceMultiplier: number;
applyRandomizeDurabilityLoss: boolean;
weaponSkillRepairGain: number;
armorKitSkillPointGainPerRepairPointMultiplier: number;
}

View File

@ -15,15 +15,21 @@ export interface UpdateTime {
seconds: number;
}
export interface FenceConfig {
discountOptions: DiscountOptions;
partialRefreshTimeSeconds: number;
partialRefreshChangePercent: number;
assortSize: number;
maxPresetsPercent: number;
itemPriceMult: number;
presetPriceMult: number;
armorMaxDurabilityPercentMinMax: MinMax;
presetMaxDurabilityPercentMinMax: MinMax;
itemPriceMult: number;
regenerateAssortsOnRefresh: boolean;
itemTypeLimits: Record<string, number>;
regenerateAssortsOnRefresh: boolean;
blacklist: string[];
}
export interface DiscountOptions {
assortSize: number;
itemPriceMult: number;
presetPriceMult: number;
}

View File

@ -14,17 +14,71 @@ export declare class SaveServer {
protected logger: ILogger;
protected profileFilepath: string;
protected profiles: {};
protected onSave: {};
protected onBeforeSaveCallbacks: {};
protected saveMd5: {};
constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger);
/**
* Add callback to occur prior to saving profile changes
* @param id Id for save callback
* @param callback Callback to execute prior to running SaveServer.saveProfile()
*/
addBeforeSaveCallback(id: string, callback: (profile: Partial<IAkiProfile>) => Partial<IAkiProfile>): void;
/**
* Remove a callback from being executed prior to saving profile in SaveServer.saveProfile()
* @param id Id of callback to remove
*/
removeBeforeSaveCallback(id: string): void;
/**
* Load all profiles in /user/profiles folder into memory (this.profiles)
*/
load(): void;
/**
* Save changes for each profile from memory into user/profiles json
*/
save(): void;
/**
* Get a player profile from memory
* @param sessionId Session id
* @returns IAkiProfile
*/
getProfile(sessionId: string): IAkiProfile;
/**
* Get all profiles from memory
* @returns Dictionary of IAkiProfile
*/
getProfiles(): Record<string, IAkiProfile>;
/**
* Delete a profile by id
* @param sessionID Id of profile to remove
* @returns true when deleted, false when profile not found
*/
deleteProfileById(sessionID: string): boolean;
/**
* Create a new profile in memory with empty pmc/scav objects
* @param profileInfo Basic profile data
*/
createProfile(profileInfo: Info): void;
/**
* Add full profile in memory by key (info.id)
* @param profileDetails Profile to save
*/
addProfile(profileDetails: IAkiProfile): void;
/**
* Look up profile json in user/profiles by id and store in memory
* Execute saveLoadRouters callbacks after being loaded into memory
* @param sessionID Id of profile to store in memory
*/
loadProfile(sessionID: string): void;
/**
* Save changes from in-memory profile to user/profiles json
* Execute onBeforeSaveCallbacks callbacks prior to being saved to json
* @param sessionID profile id (user/profiles/id.json)
*/
saveProfile(sessionID: string): void;
/**
* Remove a physical profile json from user/profiles
* @param sessionID Profile id to remove
* @returns true if file no longer exists
*/
removeProfile(sessionID: string): boolean;
}

View File

@ -24,5 +24,6 @@ export declare class AkiHttpListener implements IHttpListener {
sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void;
getResponse(sessionID: string, req: IncomingMessage, body: Buffer): string;
protected getBodyInfo(body: Buffer): string;
sendJson(resp: ServerResponse, output: any, sessionID: string): void;
sendZlibJson(resp: ServerResponse, output: any, sessionID: string): void;
}

View File

@ -1,5 +1,6 @@
import { BotHelper } from "../helpers/BotHelper";
import { EquipmentChances, IBotType, ModsChances } from "../models/eft/common/tables/IBotType";
import { MinMax } from "../models/common/MinMax";
import { EquipmentChances, Generation, 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";
@ -24,6 +25,12 @@ export declare class BotEquipmentFilterService {
* @param baseValues Values to update
*/
protected adjustChances(equipmentChanges: Record<string, number>, baseValues: EquipmentChances | ModsChances): void;
/**
* Iterate over the Generation changes and alter data in baseValues.Generation
* @param generationChanges Changes to apply
* @param baseBotGeneration dictionary to update
*/
protected adjustGenerationChances(generationChanges: Record<string, MinMax>, baseBotGeneration: Generation): void;
/**
* Get equipment settings for bot
* @param botEquipmentRole equipment role to return

View File

@ -1,7 +1,7 @@
import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { PresetHelper } from "../helpers/PresetHelper";
import { FenceLevel } from "../models/eft/common/IGlobals";
import { FenceLevel, Preset } from "../models/eft/common/IGlobals";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
@ -34,10 +34,12 @@ export declare class FenceService {
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected fenceAssort: ITraderAssort;
protected fenceDiscountAssort: ITraderAssort;
protected traderConfig: ITraderConfig;
protected nextMiniRefreshTimestamp: number;
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, localisationService: LocalisationService, configServer: ConfigServer);
protected setFenceAssort(fenceAssort: ITraderAssort): void;
protected setFenceAssort(assort: ITraderAssort): void;
protected setFenceDiscountAssort(assort: ITraderAssort): void;
/**
* Get assorts player can purchase
* Adjust prices based on fence level of player
@ -46,12 +48,27 @@ export declare class FenceService {
*/
getFenceAssorts(pmcProfile: IPmcData): ITraderAssort;
/**
* Adjust assorts price by a modifier
* @param item
* @param assort
* @param modifier
* Adjust all items contained inside an assort by a multiplier
* @param assort Assort that contains items with prices to adjust
* @param itemMultipler multipler to use on items
* @param presetMultiplier preset multipler to use on presets
*/
protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void;
protected adjustAssortItemPrices(assort: ITraderAssort, itemMultipler: number, presetMultiplier: number): void;
/**
* Merge two trader assort files together
* @param firstAssort assort 1#
* @param secondAssort assort #2
* @returns merged assort
*/
protected mergeAssorts(firstAssort: ITraderAssort, secondAssort: ITraderAssort): ITraderAssort;
/**
* Adjust assorts price by a modifier
* @param item assort item details
* @param assort assort to be modified
* @param modifier value to multiply item price by
* @param presetModifier value to multiply preset price by
*/
protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number, presetModifier: number): void;
/**
* Get fence assorts with no price adjustments based on fence rep
* @returns ITraderAssort
@ -80,7 +97,7 @@ export declare class FenceService {
/**
* Choose an item (not mod) at random and remove from assorts
*/
protected removeRandomItemFromAssorts(): void;
protected removeRandomItemFromAssorts(assort: ITraderAssort): void;
/**
* Get an integer rounded count of items to replace based on percentrage from traderConfig value
* @param totalItemCount total item count
@ -102,11 +119,23 @@ export declare class FenceService {
*/
protected createBaseTraderAssortItem(): ITraderAssort;
/**
* Hydrate result parameter object with generated assorts
* Hydrate assorts parameter object with generated assorts
* @param assortCount Number of assorts to generate
* @param assorts object to add assorts to
* @param assorts object to add created assorts to
*/
protected createAssorts(assortCount: number, assorts: ITraderAssort): void;
protected createAssorts(assortCount: number, assorts: ITraderAssort, loyaltyLevel: number): void;
protected addItemAssorts(assortCount: number, fenceAssortIds: string[], assorts: ITraderAssort, fenceAssort: ITraderAssort, itemTypeCounts: Record<string, {
current: number;
max: number;
}>, loyaltyLevel: number): void;
/**
* Add preset weapons to fence presets
* @param assortCount how many assorts to add to assorts
* @param defaultWeaponPresets
* @param assorts object to add presets to
* @param loyaltyLevel
*/
protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record<string, Preset>, assorts: ITraderAssort, loyaltyLevel: number): void;
/**
* Randomise items' upd properties e.g. med packs/weapons/armor
* @param itemDetails Item being randomised

View File

@ -25,12 +25,12 @@ export declare class PaymentService {
constructor(logger: ILogger, httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, localisationService: LocalisationService, paymentHelper: PaymentHelper);
/**
* Take money and insert items into return to server request
* @param {Object} pmcData
* @param {Object} body
* @param {IPmcData} pmcData Player profile
* @param {IProcessBuyTradeRequestData} request
* @param {string} sessionID
* @returns Object
*/
payMoney(pmcData: IPmcData, body: IProcessBuyTradeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
payMoney(pmcData: IPmcData, request: IProcessBuyTradeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/**
* Receive money back after selling
* @param {IPmcData} pmcData
@ -62,7 +62,15 @@ export declare class PaymentService {
* Post-raid healing would often take money out of the players pockets/secure container
* @param a First money stack item
* @param b Second money stack item
* @param inventoryItems players inventory items
* @returns sort order
*/
protected prioritiseStashSort(a: Item, b: Item): number;
protected prioritiseStashSort(a: Item, b: Item, inventoryItems: Item[]): number;
/**
* Recursivly check items parents to see if it is inside the players inventory, not stash
* @param itemId item id to check
* @param inventoryItems player inventory
* @returns true if its in inventory
*/
protected isInInventory(itemId: string, inventoryItems: Item[]): boolean;
}

View File

@ -1,3 +1,4 @@
import { ItemHelper } from "../helpers/ItemHelper";
import { QuestHelper } from "../helpers/QuestHelper";
import { RepairHelper } from "../helpers/RepairHelper";
import { TraderHelper } from "../helpers/TraderHelper";
@ -16,12 +17,13 @@ export declare class RepairService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected questHelper: QuestHelper;
protected itemHelper: ItemHelper;
protected traderHelper: TraderHelper;
protected paymentService: PaymentService;
protected repairHelper: RepairHelper;
protected configServer: ConfigServer;
repairConfig: IRepairConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer);
constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer);
/**
* Use trader to repair an items durability
* @param sessionID Session id
@ -70,4 +72,6 @@ export declare class RepairDetails {
repairCost?: number;
repairedItem: Item;
repairedItemIsArmor: boolean;
repairAmount: number;
repairedByKit: boolean;
}

View File

@ -32,7 +32,7 @@ export declare class VFS {
createDirAsync(filepath: string): Promise<void>;
copyDir(filepath: string, target: string, fileExtensions?: string | string[]): void;
copyDirAsync(filepath: string, target: string, fileExtensions: string | string[]): Promise<void>;
readFile(filepath: string): any;
readFile(...args: Parameters<typeof fs.readFileSync>): any;
readFileAsync(filepath: string): Promise<any>;
writeFile(filepath: any, data?: string, append?: boolean, atomic?: boolean): void;
writeFileAsync(filepath: any, data?: string, append?: boolean, atomic?: boolean): Promise<void>;

View File

@ -1,4 +1,4 @@
# Mod examples for 3.4.0
# Mod examples for 3.5.0
A collection of example mods that perform typical actions in SPT