Update types for 3.8.1
This commit is contained in:
parent
36f643f3a6
commit
f20a95325d
@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController";
|
||||
import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData";
|
||||
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||
import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||
import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType";
|
||||
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||
export declare class BotCallbacks {
|
||||
@ -19,6 +20,11 @@ export declare class BotCallbacks {
|
||||
* @returns string
|
||||
*/
|
||||
getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||
/**
|
||||
* Handle singleplayer/settings/bot/difficulties
|
||||
* @returns dictionary of every bot and its diffiulty settings
|
||||
*/
|
||||
getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record<string, Difficulties>;
|
||||
/**
|
||||
* Handle client/game/bot/generate
|
||||
* @returns IGetBodyResponseData
|
||||
|
@ -39,11 +39,6 @@ export declare class InraidCallbacks {
|
||||
* @returns JSON as string
|
||||
*/
|
||||
getRaidMenuSettings(): string;
|
||||
/**
|
||||
* Handle singleplayer/settings/weapon/durability
|
||||
* @returns
|
||||
*/
|
||||
getWeaponDurability(): string;
|
||||
/**
|
||||
* Handle singleplayer/airdrop/config
|
||||
* @returns JSON as string
|
||||
|
@ -51,12 +51,13 @@ export declare class BotController {
|
||||
getBotCoreDifficulty(): IBotCore;
|
||||
/**
|
||||
* Get bot difficulty settings
|
||||
* adjust PMC settings to ensure they engage the correct bot types
|
||||
* Adjust PMC settings to ensure they engage the correct bot types
|
||||
* @param type what bot the server is requesting settings for
|
||||
* @param diffLevel difficulty level server requested settings for
|
||||
* @returns Difficulty object
|
||||
*/
|
||||
getBotDifficulty(type: string, diffLevel: string): Difficulty;
|
||||
getAllBotDifficulties(): Record<string, any>;
|
||||
/**
|
||||
* Generate bot profiles and store in cache
|
||||
* @param sessionId Session id
|
||||
|
@ -28,7 +28,7 @@ export declare class BuildController {
|
||||
saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void;
|
||||
/** Handle client/builds/delete*/
|
||||
removeBuild(sessionID: string, request: IRemoveBuildRequestData): void;
|
||||
protected removePlayerBuild(id: string, sessionID: string): void;
|
||||
protected removePlayerBuild(idToRemove: string, sessionID: string): void;
|
||||
/**
|
||||
* Handle client/builds/magazine/save
|
||||
*/
|
||||
|
@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService";
|
||||
import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService";
|
||||
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||
import { OpenZoneService } from "@spt-aki/services/OpenZoneService";
|
||||
import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService";
|
||||
import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService";
|
||||
import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService";
|
||||
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||
@ -55,6 +56,7 @@ export declare class GameController {
|
||||
protected itemBaseClassService: ItemBaseClassService;
|
||||
protected giftService: GiftService;
|
||||
protected raidTimeAdjustmentService: RaidTimeAdjustmentService;
|
||||
protected profileActivityService: ProfileActivityService;
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected configServer: ConfigServer;
|
||||
protected httpConfig: IHttpConfig;
|
||||
@ -65,12 +67,14 @@ export declare class GameController {
|
||||
protected pmcConfig: IPmcConfig;
|
||||
protected lootConfig: ILootConfig;
|
||||
protected botConfig: IBotConfig;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
load(): void;
|
||||
/**
|
||||
* Handle client/game/start
|
||||
*/
|
||||
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
|
||||
protected adjustHideoutCraftTimes(): void;
|
||||
protected adjustHideoutBuildTimes(): void;
|
||||
protected adjustLocationBotValues(): void;
|
||||
/**
|
||||
* Out of date/incorrectly made trader mods forget this data
|
||||
|
@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||
import { FenceService } from "@spt-aki/services/FenceService";
|
||||
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||
import { PlayerService } from "@spt-aki/services/PlayerService";
|
||||
import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
@ -57,13 +58,14 @@ export declare class HideoutController {
|
||||
protected hideoutHelper: HideoutHelper;
|
||||
protected scavCaseRewardGenerator: ScavCaseRewardGenerator;
|
||||
protected localisationService: LocalisationService;
|
||||
protected profileActivityService: ProfileActivityService;
|
||||
protected configServer: ConfigServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected fenceService: FenceService;
|
||||
/** Key used in TaskConditionCounters array */
|
||||
protected static nameTaskConditionCountersCrafting: string;
|
||||
protected hideoutConfig: IHideoutConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService);
|
||||
/**
|
||||
* Handle HideoutUpgrade event
|
||||
* Start a hideout area upgrade
|
||||
|
@ -44,6 +44,11 @@ export declare class LauncherController {
|
||||
protected formatID(timeStamp: number, counter: number): string;
|
||||
changeUsername(info: IChangeRequestData): string;
|
||||
changePassword(info: IChangeRequestData): string;
|
||||
/**
|
||||
* Handle launcher requesting profile be wiped
|
||||
* @param info IRegisterData
|
||||
* @returns Session id
|
||||
*/
|
||||
wipe(info: IRegisterData): string;
|
||||
getCompatibleTarkovVersion(): string;
|
||||
/**
|
||||
|
@ -80,9 +80,10 @@ export declare class BotGenerator {
|
||||
* @param botJsonTemplate x.json from database
|
||||
* @param botGenerationDetails
|
||||
* @param botRole role of bot e.g. assault
|
||||
* @param sessionId profile session id
|
||||
* @returns Nickname for bot
|
||||
*/
|
||||
protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string;
|
||||
protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string;
|
||||
/**
|
||||
* Log the number of PMCs generated to the debug console
|
||||
* @param output Generated bot array, ready to send to client
|
||||
|
@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator {
|
||||
* Create base fence assorts dynamically and store in memory
|
||||
*/
|
||||
generateFenceBaseAssorts(): void;
|
||||
/**
|
||||
* Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit
|
||||
* @param rootItemDb Ammo box or ammo item from items.db
|
||||
* @returns True if penetration value is above limit set in config
|
||||
*/
|
||||
protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean;
|
||||
/**
|
||||
* Get the penetration power value of an ammo, works with ammo boxes and raw ammos
|
||||
* @param rootItemDb Ammo box or ammo item from items.db
|
||||
* @returns Penetration power of passed in item, null if it doesnt have a power
|
||||
*/
|
||||
protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number;
|
||||
protected getItemPrice(itemTpl: string, items: Item[]): number;
|
||||
protected getAmmoBoxPrice(items: Item[]): number;
|
||||
/**
|
||||
|
@ -41,10 +41,10 @@ export declare class LootGenerator {
|
||||
*/
|
||||
createRandomLoot(options: LootRequest): LootItem[];
|
||||
/**
|
||||
* Filter armor items by their main plates protection level
|
||||
* @param armor Armor preset
|
||||
* @param options Loot request options
|
||||
* @returns True item passes checks
|
||||
* Filter armor items by their front plates protection level - top if its a helmet
|
||||
* @param armor Armor preset to check
|
||||
* @param options Loot request options - armor level etc
|
||||
* @returns True if item has desired armor level
|
||||
*/
|
||||
protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean;
|
||||
/**
|
||||
@ -74,13 +74,13 @@ export declare class LootGenerator {
|
||||
protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number;
|
||||
/**
|
||||
* Find a random item in items.json and add to result array
|
||||
* @param globalDefaultPresets presets to choose from
|
||||
* @param itemTypeCounts item limit counts
|
||||
* @param itemBlacklist items to skip
|
||||
* @param result array to add found preset to
|
||||
* @param presetPool Presets to choose from
|
||||
* @param itemTypeCounts Item limit counts
|
||||
* @param itemBlacklist Items to skip
|
||||
* @param result Array to add chosen preset to
|
||||
* @returns true if preset was valid and added to pool
|
||||
*/
|
||||
protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record<string, {
|
||||
protected findAndAddRandomPresetToLoot(presetPool: IPreset[], itemTypeCounts: Record<string, {
|
||||
current: number;
|
||||
max: number;
|
||||
}>, itemBlacklist: string[], result: LootItem[]): boolean;
|
||||
|
@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator {
|
||||
* @param minPrice The minimum priced item to include
|
||||
* @returns True if any items remain in `rewardItems`, false otherwise
|
||||
*/
|
||||
protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean;
|
||||
protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[];
|
||||
/**
|
||||
* Get a randomised number a reward items stack size should be based on its handbook price
|
||||
* @param item Reward item to get stack size for
|
||||
|
20
TypeScript/10ScopesAndTypes/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts
vendored
Normal file
20
TypeScript/10ScopesAndTypes/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand";
|
||||
import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot {
|
||||
protected logger: ILogger;
|
||||
protected mailSendService: MailSendService;
|
||||
protected chatCommands: IChatCommand[] | ICommandoCommand[];
|
||||
constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]);
|
||||
/**
|
||||
* @deprecated As of v3.7.6. Use registerChatCommand.
|
||||
*/
|
||||
registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void;
|
||||
registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void;
|
||||
abstract getChatBot(): IUserDialogInfo;
|
||||
protected abstract getUnrecognizedCommandMessage(): string;
|
||||
handleMessage(sessionId: string, request: ISendMessageRequest): string;
|
||||
}
|
@ -1,6 +1,10 @@
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
export interface ICommandoCommand {
|
||||
/**
|
||||
* @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0.
|
||||
*/
|
||||
export type ICommandoCommand = IChatCommand;
|
||||
export interface IChatCommand {
|
||||
getCommandPrefix(): string;
|
||||
getCommandHelp(command: string): string;
|
||||
getCommands(): Set<string>;
|
@ -1,9 +1,9 @@
|
||||
import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand";
|
||||
import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||
export declare class SptCommandoCommands implements ICommandoCommand {
|
||||
export declare class SptCommandoCommands implements IChatCommand {
|
||||
protected configServer: ConfigServer;
|
||||
protected sptCommands: ISptCommand[];
|
||||
constructor(configServer: ConfigServer, sptCommands: ISptCommand[]);
|
||||
|
@ -1,9 +1,12 @@
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService);
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt give "item name" 5
|
||||
* spt give templateId 5
|
||||
* spt give en "item name in english" 5
|
||||
* spt give es "nombre en español" 5
|
||||
* spt give 5 <== this is the reply when the algo isn't sure about an item
|
||||
*/
|
||||
private static commandRegex;
|
||||
private static maxAllowedDistance;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||
|
6
TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts
vendored
Normal file
6
TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/SavedCommand.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
export declare class SavedCommand {
|
||||
quantity: number;
|
||||
potentialItemNames: string[];
|
||||
locale: string;
|
||||
constructor(quantity: number, potentialItemNames: string[], locale: string);
|
||||
}
|
@ -1,15 +1,10 @@
|
||||
import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand";
|
||||
import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot";
|
||||
import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
export declare class CommandoDialogueChatBot implements IDialogueChatBot {
|
||||
protected logger: ILogger;
|
||||
protected mailSendService: MailSendService;
|
||||
protected commandoCommands: ICommandoCommand[];
|
||||
constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]);
|
||||
registerCommandoCommand(commandoCommand: ICommandoCommand): void;
|
||||
export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot {
|
||||
constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]);
|
||||
getChatBot(): IUserDialogInfo;
|
||||
handleMessage(sessionId: string, request: ISendMessageRequest): string;
|
||||
protected getUnrecognizedCommandMessage(): string;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ export declare class HideoutHelper {
|
||||
* @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation
|
||||
* @returns Items craft time with bonuses subtracted
|
||||
*/
|
||||
protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number;
|
||||
getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number;
|
||||
/**
|
||||
* Adjust water filter objects resourceValue or delete when they reach 0 resource
|
||||
* @param waterFilterArea water filter area to update
|
||||
|
@ -17,7 +17,7 @@ export declare class HttpServerHelper {
|
||||
constructor(configServer: ConfigServer);
|
||||
getMimeText(key: string): string;
|
||||
/**
|
||||
* Combine ip and port into url
|
||||
* Combine ip and port into address
|
||||
* @returns url
|
||||
*/
|
||||
buildUrl(): string;
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { IPreset } from "@spt-aki/models/eft/common/IGlobals";
|
||||
import { BaseClasses } from "@spt-aki/models/enums/BaseClasses";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
@ -27,6 +28,13 @@ export declare class PresetHelper {
|
||||
*/
|
||||
getDefaultEquipmentPresets(): Record<string, IPreset>;
|
||||
isPreset(id: string): boolean;
|
||||
/**
|
||||
* Checks to see if the preset is of the given base class.
|
||||
* @param id The id of the preset
|
||||
* @param baseClass The BaseClasses enum to check against
|
||||
* @returns True if the preset is of the given base class, false otherwise
|
||||
*/
|
||||
isPresetBaseClass(id: string, baseClass: BaseClasses): boolean;
|
||||
hasPreset(templateId: string): boolean;
|
||||
getPreset(id: string): IPreset;
|
||||
getAllPresets(): IPreset[];
|
||||
|
@ -109,6 +109,8 @@ export interface GenerationWeightingItems {
|
||||
grenades: GenerationData;
|
||||
healing: GenerationData;
|
||||
drugs: GenerationData;
|
||||
food: GenerationData;
|
||||
drink: GenerationData;
|
||||
stims: GenerationData;
|
||||
backpackLoot: GenerationData;
|
||||
pocketLoot: GenerationData;
|
||||
|
@ -145,6 +145,7 @@ export interface IQuestReward {
|
||||
target?: string;
|
||||
items?: Item[];
|
||||
loyaltyLevel?: number;
|
||||
/** Hideout area id */
|
||||
traderId?: string;
|
||||
unknown?: boolean;
|
||||
findInRaid?: boolean;
|
||||
|
@ -216,3 +216,7 @@ export declare enum Ammo26x75 {
|
||||
WHITE_FLARE = "62389bc9423ed1685422dc57",
|
||||
YELLOW_FLARE = "62389be94d5d474bf712e709"
|
||||
}
|
||||
export declare enum Ammo68x51 {
|
||||
SIG_FMJ = "6529302b8c26af6326029fb7",
|
||||
SIG_HYBRID = "6529243824cbe3c74a05e5c1"
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
export declare enum Weapons127x55 {
|
||||
ASH_12 = "5cadfbf7ae92152ac412eeef"
|
||||
ASH_12 = "5cadfbf7ae92152ac412eeef",
|
||||
RSH_12 = "633ec7c2a6918cb895019c6c"
|
||||
}
|
||||
export declare enum Weapons86x70 {
|
||||
MK_18 = "5fc22d7c187fea44d52eda44",
|
||||
@ -7,14 +8,20 @@ export declare enum Weapons86x70 {
|
||||
}
|
||||
export declare enum Weapons9x39 {
|
||||
AS_VAL = "57c44b372459772d2b39b8ce",
|
||||
VSS_VINTOREZ = "57838ad32459774a17445cd2"
|
||||
VSS_VINTOREZ = "57838ad32459774a17445cd2",
|
||||
KBP_9A_91 = "644674a13d52156624001fbc",
|
||||
VSK_94 = "645e0c6b3b381ede770e1cc9"
|
||||
}
|
||||
export declare enum Weapons762x54R {
|
||||
SVDS = "5c46fbd72e2216398b5a8c9c",
|
||||
MP_18 = "61f7c9e189e6fb1a5e3ea78d",
|
||||
MOSIN_INFANTRY = "5bfd297f0db834001a669119",
|
||||
MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1",
|
||||
SV_98 = "55801eed4bdc2d89578b4588"
|
||||
SV_98 = "55801eed4bdc2d89578b4588",
|
||||
AVT_40 = "6410733d5dd49d77bd07847e",
|
||||
SVT_40 = "643ea5b23db6f9f57107d9fd",
|
||||
PKM = "64637076203536ad5600c990",
|
||||
PKP = "64ca3d3954fc657e230529cc"
|
||||
}
|
||||
export declare enum Weapons762x51 {
|
||||
VPO_101 = "5c501a4d2e221602b412b540",
|
||||
@ -46,7 +53,9 @@ export declare enum Weapons762x39 {
|
||||
AKMSN = "5abcbc27d8ce8700182eceeb",
|
||||
MK47_MUTANT = "606587252535c57a13424cfd",
|
||||
RD_704 = "628a60ae6b1d481ff772e9c8",
|
||||
VPO_136 = "59e6152586f77473dc057aa1"
|
||||
VPO_136 = "59e6152586f77473dc057aa1",
|
||||
RPD = "6513ef33e06849f06c0957ca",
|
||||
RPDN = "65268d8ecb944ff1e90ea385"
|
||||
}
|
||||
export declare enum Weapons762x35 {
|
||||
MCX = "5fbcc1d9016cce60e8341ab3"
|
||||
@ -61,7 +70,9 @@ export declare enum Weapons556x45 {
|
||||
M4A1 = "5447a9cd4bdc2dbd208b4567",
|
||||
SCARL_BLACK = "6184055050224f204c1da540",
|
||||
SCARL_FDE = "618428466ef05c2ce828f218",
|
||||
TX15_DML = "5d43021ca4b9362eab4b5e25"
|
||||
TX15_DML = "5d43021ca4b9362eab4b5e25",
|
||||
AUG_A1 = "62e7c4fba689e8c9c50dfc38",
|
||||
AUG_A3 = "63171672192e68c5460cebc5"
|
||||
}
|
||||
export declare enum Weapons545x39 {
|
||||
AK_105 = "5ac66d9b5acfc4001633997a",
|
||||
@ -75,7 +86,8 @@ export declare enum Weapons545x39 {
|
||||
AKS_74UN = "583990e32459771419544dd2",
|
||||
SAG_AK = "628b5638ad252a16da6dd245",
|
||||
SAG_AK_SHORT = "628b9c37a733087d0d7fe84b",
|
||||
RPK_16 = "5beed0f50db834001c062b12"
|
||||
RPK_16 = "5beed0f50db834001c062b12",
|
||||
AK_12 = "6499849fc93611967b034949"
|
||||
}
|
||||
export declare enum Weapons57x28FN {
|
||||
FN_57_BLACK = "5d3eb3b0a4b93615055e84d2",
|
||||
@ -97,7 +109,8 @@ export declare enum Weapons9x33R {
|
||||
CR_50DS = "61a4c8884f95bc3b2c5dc96f"
|
||||
}
|
||||
export declare enum Weapons9x21 {
|
||||
SR_1MP = "59f98b4986f7746f546d2cef"
|
||||
SR_1MP = "59f98b4986f7746f546d2cef",
|
||||
SR_2M = "62e14904c2699c0ec93adc47"
|
||||
}
|
||||
export declare enum Weapons9x19 {
|
||||
GLOCK_17 = "5a7ae0c351dfba0017554310",
|
||||
@ -115,7 +128,8 @@ export declare enum Weapons9x19 {
|
||||
PP_19_01 = "59984ab886f7743e98271174",
|
||||
SAIGA_9 = "59f9cabd86f7743a10721f46",
|
||||
STM_9 = "60339954d62c9b14ed777c06",
|
||||
VECTOR_9MM = "5fc3f2d5900b1d5091531e57"
|
||||
VECTOR_9MM = "5fc3f2d5900b1d5091531e57",
|
||||
GLOCK_19X = "63088377b5cd696784087147"
|
||||
}
|
||||
export declare enum Weapons9x18 {
|
||||
APB = "5abccb7dd8ce87001773e277",
|
||||
@ -149,3 +163,10 @@ export declare enum Weapons20Gauge {
|
||||
export declare enum Weapons23x75 {
|
||||
KS_23M = "5e848cc2988a8701445df1e8"
|
||||
}
|
||||
export declare enum Weapons68x51 {
|
||||
MCX_SPEAR = "65290f395ae2ae97b80fdf2d"
|
||||
}
|
||||
export declare enum Weapons40x46 {
|
||||
M32A1 = "6275303a9f372d6ea97f9ec7",
|
||||
FN40GL = "5e81ebcd8e146c7080625e15"
|
||||
}
|
||||
|
@ -7,6 +7,8 @@ export interface IBotLootCache {
|
||||
specialItems: Record<string, number>;
|
||||
healingItems: Record<string, number>;
|
||||
drugItems: Record<string, number>;
|
||||
foodItems: Record<string, number>;
|
||||
drinkItems: Record<string, number>;
|
||||
stimItems: Record<string, number>;
|
||||
grenadeItems: Record<string, number>;
|
||||
}
|
||||
@ -20,5 +22,7 @@ export declare enum LootCacheType {
|
||||
HEALING_ITEMS = "HealingItems",
|
||||
DRUG_ITEMS = "DrugItems",
|
||||
STIM_ITEMS = "StimItems",
|
||||
GRENADE_ITEMS = "GrenadeItems"
|
||||
GRENADE_ITEMS = "GrenadeItems",
|
||||
FOOD_ITEMS = "FoodItems",
|
||||
DRINK_ITEMS = "DrinkItems"
|
||||
}
|
||||
|
@ -167,11 +167,8 @@ export interface IAdjustmentDetails {
|
||||
add: Record<string, Record<string, number>>;
|
||||
edit: Record<string, Record<string, number>>;
|
||||
}
|
||||
export interface IArmorPlateWeights {
|
||||
export interface IArmorPlateWeights extends Record<string, any> {
|
||||
levelRange: MinMax;
|
||||
frontPlateWeights: Record<string, number>;
|
||||
backPlateWeights: Record<string, number>;
|
||||
sidePlateWeights: Record<string, number>;
|
||||
}
|
||||
export interface IRandomisedResourceDetails {
|
||||
food: IRandomisedResourceValues;
|
||||
|
@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig {
|
||||
serverName: string;
|
||||
profileSaveIntervalSeconds: number;
|
||||
sptFriendNickname: string;
|
||||
allowProfileWipe: boolean;
|
||||
bsgLogging: IBsgLogging;
|
||||
release: IRelease;
|
||||
fixes: IGameFixes;
|
||||
|
@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig {
|
||||
runIntervalValues: IRunIntervalValues;
|
||||
hoursForSkillCrafting: number;
|
||||
expCraftAmount: number;
|
||||
overrideCraftTimeSeconds: number;
|
||||
overrideBuildTimeSeconds: number;
|
||||
/** Only process a profiles hideout crafts when it has been active in the last x minutes */
|
||||
updateProfileHideoutWhenActiveWithinMinutes: number;
|
||||
}
|
||||
|
@ -1,9 +1,13 @@
|
||||
import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig";
|
||||
export interface IHttpConfig extends IBaseConfig {
|
||||
webSocketPingDelayMs: number;
|
||||
kind: "aki-http";
|
||||
/** Address used by webserver */
|
||||
ip: string;
|
||||
port: number;
|
||||
/** Address used by game client to connect to */
|
||||
backendIp: string;
|
||||
backendPort: string;
|
||||
webSocketPingDelayMs: number;
|
||||
logRequests: boolean;
|
||||
/** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */
|
||||
serverImagePathOverride: Record<string, string>;
|
||||
|
@ -36,5 +36,4 @@ export interface RaidMenuSettings {
|
||||
export interface Save {
|
||||
/** Should loot gained from raid be saved */
|
||||
loot: boolean;
|
||||
durability: boolean;
|
||||
}
|
||||
|
@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig {
|
||||
/** How full must a random static magazine be %*/
|
||||
minFillStaticMagazinePercent: number;
|
||||
allowDuplicateItemsInStaticContainers: boolean;
|
||||
/** Chance loose/static magazines have ammo in them */
|
||||
/** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */
|
||||
magazineLootHasAmmoChancePercent: number;
|
||||
/** Chance static magazines have ammo in them */
|
||||
staticMagazineLootHasAmmoChancePercent: number;
|
||||
/** Key: map, value: loose loot ids to ignore */
|
||||
looseLootBlacklist: Record<string, string[]>;
|
||||
/** Key: map, value: settings to control how long scav raids are*/
|
||||
|
@ -40,6 +40,8 @@ export interface FenceConfig {
|
||||
presetSlotsToRemoveChancePercent: Record<string, number>;
|
||||
/** Block seasonal items from appearing when season is inactive */
|
||||
blacklistSeasonalItems: boolean;
|
||||
/** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */
|
||||
ammoMaxPenLimit: number;
|
||||
blacklist: string[];
|
||||
coopExtractGift: CoopExtractReward;
|
||||
btrDeliveryExpireHours: number;
|
||||
|
7
TypeScript/10ScopesAndTypes/types/models/spt/fence/ICreateFenceAssortsResult.d.ts
vendored
Normal file
7
TypeScript/10ScopesAndTypes/types/models/spt/fence/ICreateFenceAssortsResult.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader";
|
||||
export interface ICreateFenceAssortsResult {
|
||||
sptItems: Item[][];
|
||||
barter_scheme: Record<string, IBarterScheme[][]>;
|
||||
loyal_level_items: Record<string, number>;
|
||||
}
|
@ -19,6 +19,7 @@ export declare class HttpServer {
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected webSocketServer: WebSocketServer;
|
||||
protected httpConfig: IHttpConfig;
|
||||
protected started: boolean;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer);
|
||||
/**
|
||||
* Handle server loading event
|
||||
@ -26,4 +27,5 @@ export declare class HttpServer {
|
||||
load(): void;
|
||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): void;
|
||||
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||
isStarted(): boolean;
|
||||
}
|
||||
|
@ -69,6 +69,8 @@ export declare class BotLootCacheService {
|
||||
* @returns
|
||||
*/
|
||||
protected isGrenade(props: Props): boolean;
|
||||
protected isFood(tpl: string): boolean;
|
||||
protected isDrink(tpl: string): boolean;
|
||||
/**
|
||||
* Check if a bot type exists inside the loot cache
|
||||
* @param botRole role to check for
|
||||
|
@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||
import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader";
|
||||
import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
|
||||
import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult";
|
||||
import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||
@ -37,7 +38,7 @@ export declare class FenceService {
|
||||
protected fenceAssort: ITraderAssort;
|
||||
/** Assorts shown on a separate tab when you max out fence rep */
|
||||
protected fenceDiscountAssort: ITraderAssort;
|
||||
/** Hydrated on initial assort generation as part of generateFenceAssorts() */
|
||||
/** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */
|
||||
protected desiredAssortCounts: IFenceAssortGenerationValues;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
/**
|
||||
@ -93,17 +94,23 @@ export declare class FenceService {
|
||||
* Replace a percentage of fence assorts with freshly generated items
|
||||
*/
|
||||
performPartialRefresh(): void;
|
||||
/**
|
||||
* Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead
|
||||
* @param newFenceAssorts Assorts to fold into existing fence assorts
|
||||
* @param existingFenceAssorts Current fence assorts new assorts will be added to
|
||||
*/
|
||||
protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void;
|
||||
/**
|
||||
* Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config
|
||||
*/
|
||||
protected incrementPartialRefreshTime(): void;
|
||||
/**
|
||||
* Compare the current fence offer count to what the config wants it to be,
|
||||
* If value is lower add extra count to value to generate more items to fill gap
|
||||
* @param existingItemCountToReplace count of items to generate
|
||||
* @returns number of items to generate
|
||||
* Get values that will hydrate the passed in assorts back to the desired counts
|
||||
* @param assortItems Current assorts after items have been removed
|
||||
* @param generationValues Base counts assorts should be adjusted to
|
||||
* @returns IGenerationAssortValues object with adjustments needed to reach desired state
|
||||
*/
|
||||
protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues;
|
||||
protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues;
|
||||
/**
|
||||
* Delete desired number of items from assort (including children)
|
||||
* @param itemCountToReplace
|
||||
@ -132,6 +139,12 @@ export declare class FenceService {
|
||||
* Uses fence base cache generatedon server start as a base
|
||||
*/
|
||||
generateFenceAssorts(): void;
|
||||
/**
|
||||
* Convert the intermediary assort data generated into format client can process
|
||||
* @param intermediaryAssorts Generated assorts that will be converted
|
||||
* @returns ITraderAssort
|
||||
*/
|
||||
protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort;
|
||||
/**
|
||||
* Create object that contains calculated fence assort item values to make based on config
|
||||
* Stored in this.desiredAssortCounts
|
||||
@ -147,7 +160,7 @@ export declare class FenceService {
|
||||
* @param assortCount Number of assorts to generate
|
||||
* @param assorts object to add created assorts to
|
||||
*/
|
||||
protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void;
|
||||
protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult;
|
||||
/**
|
||||
* Add item assorts to existing assort data
|
||||
* @param assortCount Number to add
|
||||
@ -156,7 +169,7 @@ export declare class FenceService {
|
||||
* @param itemTypeLimits
|
||||
* @param loyaltyLevel Loyalty level to set new item to
|
||||
*/
|
||||
protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record<string, {
|
||||
protected addItemAssorts(assortCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record<string, {
|
||||
current: number;
|
||||
max: number;
|
||||
}>, loyaltyLevel: number): void;
|
||||
@ -165,10 +178,10 @@ export declare class FenceService {
|
||||
* e.g. salewa hp resource units left
|
||||
* @param rootItemBeingAdded item to look for a match against
|
||||
* @param itemDbDetails Db details of matching item
|
||||
* @param fenceItemAssorts Items to search through
|
||||
* @param itemsWithChildren Items to search through
|
||||
* @returns Matching assort item
|
||||
*/
|
||||
protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item;
|
||||
protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item;
|
||||
/**
|
||||
* Should this item be forced into only 1 stack on fence
|
||||
* @param existingItem Existing item from fence assort
|
||||
@ -176,6 +189,7 @@ export declare class FenceService {
|
||||
* @returns True item should be force stacked
|
||||
*/
|
||||
protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean;
|
||||
protected itemInPreventDupeCategoryList(tpl: string): boolean;
|
||||
/**
|
||||
* Adjust price of item based on what is left to buy (resource/uses left)
|
||||
* @param barterSchemes All barter scheme for item having price adjusted
|
||||
@ -197,7 +211,7 @@ export declare class FenceService {
|
||||
* @param baseFenceAssort Base data to draw from
|
||||
* @param loyaltyLevel Which loyalty level is required to see/buy item
|
||||
*/
|
||||
protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void;
|
||||
protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void;
|
||||
/**
|
||||
* Adjust plate / soft insert durability values
|
||||
* @param armor Armor item array to add mods into
|
||||
|
@ -10,6 +10,7 @@ export declare class ItemBaseClassService {
|
||||
protected localisationService: LocalisationService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemBaseClassesCache: Record<string, string[]>;
|
||||
protected items: Record<string, ITemplateItem>;
|
||||
protected cacheGenerated: boolean;
|
||||
constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer);
|
||||
/**
|
||||
@ -21,9 +22,8 @@ export declare class ItemBaseClassService {
|
||||
* Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary
|
||||
* @param itemIdToUpdate item tpl to store base ids against in dictionary
|
||||
* @param item item being checked
|
||||
* @param allDbItems all items in db
|
||||
*/
|
||||
protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record<string, ITemplateItem>): void;
|
||||
protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void;
|
||||
/**
|
||||
* Does item tpl inherit from the requested base class
|
||||
* @param itemTpl item to check base classes of
|
||||
@ -31,6 +31,12 @@ export declare class ItemBaseClassService {
|
||||
* @returns true if item inherits from base class passed in
|
||||
*/
|
||||
itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean;
|
||||
/**
|
||||
* Check if cached item template is of type Item
|
||||
* @param itemTemplateId item to check
|
||||
* @returns true if item is of type Item
|
||||
*/
|
||||
private cachedItemIsOfItemType;
|
||||
/**
|
||||
* Get base classes item inherits from
|
||||
* @param itemTpl item to get base classes for
|
||||
|
@ -60,7 +60,7 @@ export declare class PaymentService {
|
||||
*/
|
||||
addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void;
|
||||
/**
|
||||
* Get all money stacks in inventory and prioritse items in stash
|
||||
* Get all money stacks in inventory and prioritise items in stash
|
||||
* @param pmcData
|
||||
* @param currencyTpl
|
||||
* @param playerStashId Players stash id
|
||||
|
21
TypeScript/10ScopesAndTypes/types/services/ProfileActivityService.d.ts
vendored
Normal file
21
TypeScript/10ScopesAndTypes/types/services/ProfileActivityService.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
export declare class ProfileActivityService {
|
||||
protected profileActivityTimestamps: Record<string, number>;
|
||||
/**
|
||||
* Was the requested profile active in the last requested minutes
|
||||
* @param sessionId Profile to check
|
||||
* @param minutes Minutes to check for activity in
|
||||
* @returns True when profile was active within past x minutes
|
||||
*/
|
||||
activeWithinLastMinutes(sessionId: string, minutes: number): boolean;
|
||||
/**
|
||||
* Get an array of profile ids that were active in the last x minutes
|
||||
* @param minutes How many minutes from now to search for profiles
|
||||
* @returns String array of profile ids
|
||||
*/
|
||||
getActiveProfileIdsWithinMinutes(minutes: number): string[];
|
||||
/**
|
||||
* Update the timestamp a profile was last observed active
|
||||
* @param sessionId Profile to update
|
||||
*/
|
||||
setActivityTimestamp(sessionId: string): void;
|
||||
}
|
@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
|
||||
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||
import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||
import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests";
|
||||
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||
import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea";
|
||||
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas";
|
||||
import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig";
|
||||
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
|
||||
@ -119,6 +120,19 @@ export declare class ProfileFixerService {
|
||||
* @param pmcProfile Profile to check inventory of
|
||||
*/
|
||||
checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void;
|
||||
/**
|
||||
* @param buildType The type of build, used for logging only
|
||||
* @param build The build to check for invalid items
|
||||
* @param itemsDb The items database to use for item lookup
|
||||
* @returns True if the build should be removed from the build list, false otherwise
|
||||
*/
|
||||
protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record<string, ITemplateItem>): boolean;
|
||||
/**
|
||||
* @param magazineBuild The magazine build to check for validity
|
||||
* @param itemsDb The items database to use for item lookup
|
||||
* @returns True if the build should be removed from the build list, false otherwise
|
||||
*/
|
||||
protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record<string, ITemplateItem>): boolean;
|
||||
/**
|
||||
* Attempt to fix common item issues that corrupt profiles
|
||||
* @param pmcProfile Profile to check items of
|
||||
@ -155,6 +169,10 @@ export declare class ProfileFixerService {
|
||||
* @param pmcProfile Profile to add missing IDs to
|
||||
*/
|
||||
addMissingIdsToBonuses(pmcProfile: IPmcData): void;
|
||||
/**
|
||||
* 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found
|
||||
*/
|
||||
fixBitcoinProductionTime(pmcProfile: IPmcData): void;
|
||||
/**
|
||||
* At some point the property name was changed,migrate data across to new name
|
||||
* @param pmcProfile Profile to migrate improvements in
|
||||
|
@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad {
|
||||
* @returns cost of item in desired currency
|
||||
*/
|
||||
getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number;
|
||||
/**
|
||||
* @param itemTemplateId
|
||||
* @param desiredCurrency
|
||||
* @param item
|
||||
* @param offerItems
|
||||
* @param isPackOffer
|
||||
* @returns
|
||||
*/
|
||||
getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number;
|
||||
/**
|
||||
* using data from config, adjust an items price to be relative to its handbook price
|
||||
* @param handbookPrices Prices of items in handbook
|
||||
|
@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate";
|
||||
import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||
import { HttpServer } from "@spt-aki/servers/HttpServer";
|
||||
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||
import { EncodingUtil } from "@spt-aki/utils/EncodingUtil";
|
||||
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||
@ -12,11 +13,12 @@ export declare class App {
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected encodingUtil: EncodingUtil;
|
||||
protected httpServer: HttpServer;
|
||||
protected onLoadComponents: OnLoad[];
|
||||
protected onUpdateComponents: OnUpdate[];
|
||||
protected onUpdateLastRun: {};
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]);
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]);
|
||||
load(): Promise<void>;
|
||||
protected update(onUpdateComponents: OnUpdate[]): Promise<void>;
|
||||
protected logUpdateException(err: any, updateable: OnUpdate): void;
|
||||
|
@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger {
|
||||
protected abstract isLogExceptions(): boolean;
|
||||
protected abstract getFilePath(): string;
|
||||
protected abstract getFileName(): string;
|
||||
protected getLogFrequency(): string;
|
||||
protected getLogMaxSize(): string;
|
||||
protected getLogMaxFiles(): string;
|
||||
writeToLogFile(data: string | Daum): Promise<void>;
|
||||
|
@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController";
|
||||
import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData";
|
||||
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||
import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||
import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType";
|
||||
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||
export declare class BotCallbacks {
|
||||
@ -19,6 +20,11 @@ export declare class BotCallbacks {
|
||||
* @returns string
|
||||
*/
|
||||
getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||
/**
|
||||
* Handle singleplayer/settings/bot/difficulties
|
||||
* @returns dictionary of every bot and its diffiulty settings
|
||||
*/
|
||||
getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record<string, Difficulties>;
|
||||
/**
|
||||
* Handle client/game/bot/generate
|
||||
* @returns IGetBodyResponseData
|
||||
|
@ -39,11 +39,6 @@ export declare class InraidCallbacks {
|
||||
* @returns JSON as string
|
||||
*/
|
||||
getRaidMenuSettings(): string;
|
||||
/**
|
||||
* Handle singleplayer/settings/weapon/durability
|
||||
* @returns
|
||||
*/
|
||||
getWeaponDurability(): string;
|
||||
/**
|
||||
* Handle singleplayer/airdrop/config
|
||||
* @returns JSON as string
|
||||
|
@ -51,12 +51,13 @@ export declare class BotController {
|
||||
getBotCoreDifficulty(): IBotCore;
|
||||
/**
|
||||
* Get bot difficulty settings
|
||||
* adjust PMC settings to ensure they engage the correct bot types
|
||||
* Adjust PMC settings to ensure they engage the correct bot types
|
||||
* @param type what bot the server is requesting settings for
|
||||
* @param diffLevel difficulty level server requested settings for
|
||||
* @returns Difficulty object
|
||||
*/
|
||||
getBotDifficulty(type: string, diffLevel: string): Difficulty;
|
||||
getAllBotDifficulties(): Record<string, any>;
|
||||
/**
|
||||
* Generate bot profiles and store in cache
|
||||
* @param sessionId Session id
|
||||
|
@ -28,7 +28,7 @@ export declare class BuildController {
|
||||
saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void;
|
||||
/** Handle client/builds/delete*/
|
||||
removeBuild(sessionID: string, request: IRemoveBuildRequestData): void;
|
||||
protected removePlayerBuild(id: string, sessionID: string): void;
|
||||
protected removePlayerBuild(idToRemove: string, sessionID: string): void;
|
||||
/**
|
||||
* Handle client/builds/magazine/save
|
||||
*/
|
||||
|
@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService";
|
||||
import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService";
|
||||
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||
import { OpenZoneService } from "@spt-aki/services/OpenZoneService";
|
||||
import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService";
|
||||
import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService";
|
||||
import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService";
|
||||
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||
@ -55,6 +56,7 @@ export declare class GameController {
|
||||
protected itemBaseClassService: ItemBaseClassService;
|
||||
protected giftService: GiftService;
|
||||
protected raidTimeAdjustmentService: RaidTimeAdjustmentService;
|
||||
protected profileActivityService: ProfileActivityService;
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected configServer: ConfigServer;
|
||||
protected httpConfig: IHttpConfig;
|
||||
@ -65,12 +67,14 @@ export declare class GameController {
|
||||
protected pmcConfig: IPmcConfig;
|
||||
protected lootConfig: ILootConfig;
|
||||
protected botConfig: IBotConfig;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
load(): void;
|
||||
/**
|
||||
* Handle client/game/start
|
||||
*/
|
||||
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
|
||||
protected adjustHideoutCraftTimes(): void;
|
||||
protected adjustHideoutBuildTimes(): void;
|
||||
protected adjustLocationBotValues(): void;
|
||||
/**
|
||||
* Out of date/incorrectly made trader mods forget this data
|
||||
|
@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||
import { FenceService } from "@spt-aki/services/FenceService";
|
||||
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||
import { PlayerService } from "@spt-aki/services/PlayerService";
|
||||
import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
@ -57,13 +58,14 @@ export declare class HideoutController {
|
||||
protected hideoutHelper: HideoutHelper;
|
||||
protected scavCaseRewardGenerator: ScavCaseRewardGenerator;
|
||||
protected localisationService: LocalisationService;
|
||||
protected profileActivityService: ProfileActivityService;
|
||||
protected configServer: ConfigServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected fenceService: FenceService;
|
||||
/** Key used in TaskConditionCounters array */
|
||||
protected static nameTaskConditionCountersCrafting: string;
|
||||
protected hideoutConfig: IHideoutConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService);
|
||||
/**
|
||||
* Handle HideoutUpgrade event
|
||||
* Start a hideout area upgrade
|
||||
|
@ -44,6 +44,11 @@ export declare class LauncherController {
|
||||
protected formatID(timeStamp: number, counter: number): string;
|
||||
changeUsername(info: IChangeRequestData): string;
|
||||
changePassword(info: IChangeRequestData): string;
|
||||
/**
|
||||
* Handle launcher requesting profile be wiped
|
||||
* @param info IRegisterData
|
||||
* @returns Session id
|
||||
*/
|
||||
wipe(info: IRegisterData): string;
|
||||
getCompatibleTarkovVersion(): string;
|
||||
/**
|
||||
|
@ -80,9 +80,10 @@ export declare class BotGenerator {
|
||||
* @param botJsonTemplate x.json from database
|
||||
* @param botGenerationDetails
|
||||
* @param botRole role of bot e.g. assault
|
||||
* @param sessionId profile session id
|
||||
* @returns Nickname for bot
|
||||
*/
|
||||
protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string;
|
||||
protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string;
|
||||
/**
|
||||
* Log the number of PMCs generated to the debug console
|
||||
* @param output Generated bot array, ready to send to client
|
||||
|
@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator {
|
||||
* Create base fence assorts dynamically and store in memory
|
||||
*/
|
||||
generateFenceBaseAssorts(): void;
|
||||
/**
|
||||
* Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit
|
||||
* @param rootItemDb Ammo box or ammo item from items.db
|
||||
* @returns True if penetration value is above limit set in config
|
||||
*/
|
||||
protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean;
|
||||
/**
|
||||
* Get the penetration power value of an ammo, works with ammo boxes and raw ammos
|
||||
* @param rootItemDb Ammo box or ammo item from items.db
|
||||
* @returns Penetration power of passed in item, null if it doesnt have a power
|
||||
*/
|
||||
protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number;
|
||||
protected getItemPrice(itemTpl: string, items: Item[]): number;
|
||||
protected getAmmoBoxPrice(items: Item[]): number;
|
||||
/**
|
||||
|
@ -41,10 +41,10 @@ export declare class LootGenerator {
|
||||
*/
|
||||
createRandomLoot(options: LootRequest): LootItem[];
|
||||
/**
|
||||
* Filter armor items by their main plates protection level
|
||||
* @param armor Armor preset
|
||||
* @param options Loot request options
|
||||
* @returns True item passes checks
|
||||
* Filter armor items by their front plates protection level - top if its a helmet
|
||||
* @param armor Armor preset to check
|
||||
* @param options Loot request options - armor level etc
|
||||
* @returns True if item has desired armor level
|
||||
*/
|
||||
protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean;
|
||||
/**
|
||||
@ -74,13 +74,13 @@ export declare class LootGenerator {
|
||||
protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number;
|
||||
/**
|
||||
* Find a random item in items.json and add to result array
|
||||
* @param globalDefaultPresets presets to choose from
|
||||
* @param itemTypeCounts item limit counts
|
||||
* @param itemBlacklist items to skip
|
||||
* @param result array to add found preset to
|
||||
* @param presetPool Presets to choose from
|
||||
* @param itemTypeCounts Item limit counts
|
||||
* @param itemBlacklist Items to skip
|
||||
* @param result Array to add chosen preset to
|
||||
* @returns true if preset was valid and added to pool
|
||||
*/
|
||||
protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record<string, {
|
||||
protected findAndAddRandomPresetToLoot(presetPool: IPreset[], itemTypeCounts: Record<string, {
|
||||
current: number;
|
||||
max: number;
|
||||
}>, itemBlacklist: string[], result: LootItem[]): boolean;
|
||||
|
@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator {
|
||||
* @param minPrice The minimum priced item to include
|
||||
* @returns True if any items remain in `rewardItems`, false otherwise
|
||||
*/
|
||||
protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean;
|
||||
protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[];
|
||||
/**
|
||||
* Get a randomised number a reward items stack size should be based on its handbook price
|
||||
* @param item Reward item to get stack size for
|
||||
|
20
TypeScript/11BundleLoadingSample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts
vendored
Normal file
20
TypeScript/11BundleLoadingSample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand";
|
||||
import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot {
|
||||
protected logger: ILogger;
|
||||
protected mailSendService: MailSendService;
|
||||
protected chatCommands: IChatCommand[] | ICommandoCommand[];
|
||||
constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]);
|
||||
/**
|
||||
* @deprecated As of v3.7.6. Use registerChatCommand.
|
||||
*/
|
||||
registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void;
|
||||
registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void;
|
||||
abstract getChatBot(): IUserDialogInfo;
|
||||
protected abstract getUnrecognizedCommandMessage(): string;
|
||||
handleMessage(sessionId: string, request: ISendMessageRequest): string;
|
||||
}
|
@ -1,6 +1,10 @@
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
export interface ICommandoCommand {
|
||||
/**
|
||||
* @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0.
|
||||
*/
|
||||
export type ICommandoCommand = IChatCommand;
|
||||
export interface IChatCommand {
|
||||
getCommandPrefix(): string;
|
||||
getCommandHelp(command: string): string;
|
||||
getCommands(): Set<string>;
|
@ -1,9 +1,9 @@
|
||||
import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand";
|
||||
import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||
export declare class SptCommandoCommands implements ICommandoCommand {
|
||||
export declare class SptCommandoCommands implements IChatCommand {
|
||||
protected configServer: ConfigServer;
|
||||
protected sptCommands: ISptCommand[];
|
||||
constructor(configServer: ConfigServer, sptCommands: ISptCommand[]);
|
||||
|
@ -1,9 +1,12 @@
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
@ -14,7 +17,20 @@ export declare class GiveSptCommand implements ISptCommand {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService);
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt give "item name" 5
|
||||
* spt give templateId 5
|
||||
* spt give en "item name in english" 5
|
||||
* spt give es "nombre en español" 5
|
||||
* spt give 5 <== this is the reply when the algo isn't sure about an item
|
||||
*/
|
||||
private static commandRegex;
|
||||
private static maxAllowedDistance;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||
|
@ -0,0 +1,6 @@
|
||||
export declare class SavedCommand {
|
||||
quantity: number;
|
||||
potentialItemNames: string[];
|
||||
locale: string;
|
||||
constructor(quantity: number, potentialItemNames: string[], locale: string);
|
||||
}
|
@ -1,15 +1,10 @@
|
||||
import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand";
|
||||
import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot";
|
||||
import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
export declare class CommandoDialogueChatBot implements IDialogueChatBot {
|
||||
protected logger: ILogger;
|
||||
protected mailSendService: MailSendService;
|
||||
protected commandoCommands: ICommandoCommand[];
|
||||
constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]);
|
||||
registerCommandoCommand(commandoCommand: ICommandoCommand): void;
|
||||
export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot {
|
||||
constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]);
|
||||
getChatBot(): IUserDialogInfo;
|
||||
handleMessage(sessionId: string, request: ISendMessageRequest): string;
|
||||
protected getUnrecognizedCommandMessage(): string;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ export declare class HideoutHelper {
|
||||
* @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation
|
||||
* @returns Items craft time with bonuses subtracted
|
||||
*/
|
||||
protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number;
|
||||
getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number;
|
||||
/**
|
||||
* Adjust water filter objects resourceValue or delete when they reach 0 resource
|
||||
* @param waterFilterArea water filter area to update
|
||||
|
@ -17,7 +17,7 @@ export declare class HttpServerHelper {
|
||||
constructor(configServer: ConfigServer);
|
||||
getMimeText(key: string): string;
|
||||
/**
|
||||
* Combine ip and port into url
|
||||
* Combine ip and port into address
|
||||
* @returns url
|
||||
*/
|
||||
buildUrl(): string;
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { IPreset } from "@spt-aki/models/eft/common/IGlobals";
|
||||
import { BaseClasses } from "@spt-aki/models/enums/BaseClasses";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
@ -27,6 +28,13 @@ export declare class PresetHelper {
|
||||
*/
|
||||
getDefaultEquipmentPresets(): Record<string, IPreset>;
|
||||
isPreset(id: string): boolean;
|
||||
/**
|
||||
* Checks to see if the preset is of the given base class.
|
||||
* @param id The id of the preset
|
||||
* @param baseClass The BaseClasses enum to check against
|
||||
* @returns True if the preset is of the given base class, false otherwise
|
||||
*/
|
||||
isPresetBaseClass(id: string, baseClass: BaseClasses): boolean;
|
||||
hasPreset(templateId: string): boolean;
|
||||
getPreset(id: string): IPreset;
|
||||
getAllPresets(): IPreset[];
|
||||
|
@ -109,6 +109,8 @@ export interface GenerationWeightingItems {
|
||||
grenades: GenerationData;
|
||||
healing: GenerationData;
|
||||
drugs: GenerationData;
|
||||
food: GenerationData;
|
||||
drink: GenerationData;
|
||||
stims: GenerationData;
|
||||
backpackLoot: GenerationData;
|
||||
pocketLoot: GenerationData;
|
||||
|
@ -145,6 +145,7 @@ export interface IQuestReward {
|
||||
target?: string;
|
||||
items?: Item[];
|
||||
loyaltyLevel?: number;
|
||||
/** Hideout area id */
|
||||
traderId?: string;
|
||||
unknown?: boolean;
|
||||
findInRaid?: boolean;
|
||||
|
@ -216,3 +216,7 @@ export declare enum Ammo26x75 {
|
||||
WHITE_FLARE = "62389bc9423ed1685422dc57",
|
||||
YELLOW_FLARE = "62389be94d5d474bf712e709"
|
||||
}
|
||||
export declare enum Ammo68x51 {
|
||||
SIG_FMJ = "6529302b8c26af6326029fb7",
|
||||
SIG_HYBRID = "6529243824cbe3c74a05e5c1"
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
export declare enum Weapons127x55 {
|
||||
ASH_12 = "5cadfbf7ae92152ac412eeef"
|
||||
ASH_12 = "5cadfbf7ae92152ac412eeef",
|
||||
RSH_12 = "633ec7c2a6918cb895019c6c"
|
||||
}
|
||||
export declare enum Weapons86x70 {
|
||||
MK_18 = "5fc22d7c187fea44d52eda44",
|
||||
@ -7,14 +8,20 @@ export declare enum Weapons86x70 {
|
||||
}
|
||||
export declare enum Weapons9x39 {
|
||||
AS_VAL = "57c44b372459772d2b39b8ce",
|
||||
VSS_VINTOREZ = "57838ad32459774a17445cd2"
|
||||
VSS_VINTOREZ = "57838ad32459774a17445cd2",
|
||||
KBP_9A_91 = "644674a13d52156624001fbc",
|
||||
VSK_94 = "645e0c6b3b381ede770e1cc9"
|
||||
}
|
||||
export declare enum Weapons762x54R {
|
||||
SVDS = "5c46fbd72e2216398b5a8c9c",
|
||||
MP_18 = "61f7c9e189e6fb1a5e3ea78d",
|
||||
MOSIN_INFANTRY = "5bfd297f0db834001a669119",
|
||||
MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1",
|
||||
SV_98 = "55801eed4bdc2d89578b4588"
|
||||
SV_98 = "55801eed4bdc2d89578b4588",
|
||||
AVT_40 = "6410733d5dd49d77bd07847e",
|
||||
SVT_40 = "643ea5b23db6f9f57107d9fd",
|
||||
PKM = "64637076203536ad5600c990",
|
||||
PKP = "64ca3d3954fc657e230529cc"
|
||||
}
|
||||
export declare enum Weapons762x51 {
|
||||
VPO_101 = "5c501a4d2e221602b412b540",
|
||||
@ -46,7 +53,9 @@ export declare enum Weapons762x39 {
|
||||
AKMSN = "5abcbc27d8ce8700182eceeb",
|
||||
MK47_MUTANT = "606587252535c57a13424cfd",
|
||||
RD_704 = "628a60ae6b1d481ff772e9c8",
|
||||
VPO_136 = "59e6152586f77473dc057aa1"
|
||||
VPO_136 = "59e6152586f77473dc057aa1",
|
||||
RPD = "6513ef33e06849f06c0957ca",
|
||||
RPDN = "65268d8ecb944ff1e90ea385"
|
||||
}
|
||||
export declare enum Weapons762x35 {
|
||||
MCX = "5fbcc1d9016cce60e8341ab3"
|
||||
@ -61,7 +70,9 @@ export declare enum Weapons556x45 {
|
||||
M4A1 = "5447a9cd4bdc2dbd208b4567",
|
||||
SCARL_BLACK = "6184055050224f204c1da540",
|
||||
SCARL_FDE = "618428466ef05c2ce828f218",
|
||||
TX15_DML = "5d43021ca4b9362eab4b5e25"
|
||||
TX15_DML = "5d43021ca4b9362eab4b5e25",
|
||||
AUG_A1 = "62e7c4fba689e8c9c50dfc38",
|
||||
AUG_A3 = "63171672192e68c5460cebc5"
|
||||
}
|
||||
export declare enum Weapons545x39 {
|
||||
AK_105 = "5ac66d9b5acfc4001633997a",
|
||||
@ -75,7 +86,8 @@ export declare enum Weapons545x39 {
|
||||
AKS_74UN = "583990e32459771419544dd2",
|
||||
SAG_AK = "628b5638ad252a16da6dd245",
|
||||
SAG_AK_SHORT = "628b9c37a733087d0d7fe84b",
|
||||
RPK_16 = "5beed0f50db834001c062b12"
|
||||
RPK_16 = "5beed0f50db834001c062b12",
|
||||
AK_12 = "6499849fc93611967b034949"
|
||||
}
|
||||
export declare enum Weapons57x28FN {
|
||||
FN_57_BLACK = "5d3eb3b0a4b93615055e84d2",
|
||||
@ -97,7 +109,8 @@ export declare enum Weapons9x33R {
|
||||
CR_50DS = "61a4c8884f95bc3b2c5dc96f"
|
||||
}
|
||||
export declare enum Weapons9x21 {
|
||||
SR_1MP = "59f98b4986f7746f546d2cef"
|
||||
SR_1MP = "59f98b4986f7746f546d2cef",
|
||||
SR_2M = "62e14904c2699c0ec93adc47"
|
||||
}
|
||||
export declare enum Weapons9x19 {
|
||||
GLOCK_17 = "5a7ae0c351dfba0017554310",
|
||||
@ -115,7 +128,8 @@ export declare enum Weapons9x19 {
|
||||
PP_19_01 = "59984ab886f7743e98271174",
|
||||
SAIGA_9 = "59f9cabd86f7743a10721f46",
|
||||
STM_9 = "60339954d62c9b14ed777c06",
|
||||
VECTOR_9MM = "5fc3f2d5900b1d5091531e57"
|
||||
VECTOR_9MM = "5fc3f2d5900b1d5091531e57",
|
||||
GLOCK_19X = "63088377b5cd696784087147"
|
||||
}
|
||||
export declare enum Weapons9x18 {
|
||||
APB = "5abccb7dd8ce87001773e277",
|
||||
@ -149,3 +163,10 @@ export declare enum Weapons20Gauge {
|
||||
export declare enum Weapons23x75 {
|
||||
KS_23M = "5e848cc2988a8701445df1e8"
|
||||
}
|
||||
export declare enum Weapons68x51 {
|
||||
MCX_SPEAR = "65290f395ae2ae97b80fdf2d"
|
||||
}
|
||||
export declare enum Weapons40x46 {
|
||||
M32A1 = "6275303a9f372d6ea97f9ec7",
|
||||
FN40GL = "5e81ebcd8e146c7080625e15"
|
||||
}
|
||||
|
@ -7,6 +7,8 @@ export interface IBotLootCache {
|
||||
specialItems: Record<string, number>;
|
||||
healingItems: Record<string, number>;
|
||||
drugItems: Record<string, number>;
|
||||
foodItems: Record<string, number>;
|
||||
drinkItems: Record<string, number>;
|
||||
stimItems: Record<string, number>;
|
||||
grenadeItems: Record<string, number>;
|
||||
}
|
||||
@ -20,5 +22,7 @@ export declare enum LootCacheType {
|
||||
HEALING_ITEMS = "HealingItems",
|
||||
DRUG_ITEMS = "DrugItems",
|
||||
STIM_ITEMS = "StimItems",
|
||||
GRENADE_ITEMS = "GrenadeItems"
|
||||
GRENADE_ITEMS = "GrenadeItems",
|
||||
FOOD_ITEMS = "FoodItems",
|
||||
DRINK_ITEMS = "DrinkItems"
|
||||
}
|
||||
|
@ -167,11 +167,8 @@ export interface IAdjustmentDetails {
|
||||
add: Record<string, Record<string, number>>;
|
||||
edit: Record<string, Record<string, number>>;
|
||||
}
|
||||
export interface IArmorPlateWeights {
|
||||
export interface IArmorPlateWeights extends Record<string, any> {
|
||||
levelRange: MinMax;
|
||||
frontPlateWeights: Record<string, number>;
|
||||
backPlateWeights: Record<string, number>;
|
||||
sidePlateWeights: Record<string, number>;
|
||||
}
|
||||
export interface IRandomisedResourceDetails {
|
||||
food: IRandomisedResourceValues;
|
||||
|
@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig {
|
||||
serverName: string;
|
||||
profileSaveIntervalSeconds: number;
|
||||
sptFriendNickname: string;
|
||||
allowProfileWipe: boolean;
|
||||
bsgLogging: IBsgLogging;
|
||||
release: IRelease;
|
||||
fixes: IGameFixes;
|
||||
|
@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig {
|
||||
runIntervalValues: IRunIntervalValues;
|
||||
hoursForSkillCrafting: number;
|
||||
expCraftAmount: number;
|
||||
overrideCraftTimeSeconds: number;
|
||||
overrideBuildTimeSeconds: number;
|
||||
/** Only process a profiles hideout crafts when it has been active in the last x minutes */
|
||||
updateProfileHideoutWhenActiveWithinMinutes: number;
|
||||
}
|
||||
|
@ -1,9 +1,13 @@
|
||||
import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig";
|
||||
export interface IHttpConfig extends IBaseConfig {
|
||||
webSocketPingDelayMs: number;
|
||||
kind: "aki-http";
|
||||
/** Address used by webserver */
|
||||
ip: string;
|
||||
port: number;
|
||||
/** Address used by game client to connect to */
|
||||
backendIp: string;
|
||||
backendPort: string;
|
||||
webSocketPingDelayMs: number;
|
||||
logRequests: boolean;
|
||||
/** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */
|
||||
serverImagePathOverride: Record<string, string>;
|
||||
|
@ -36,5 +36,4 @@ export interface RaidMenuSettings {
|
||||
export interface Save {
|
||||
/** Should loot gained from raid be saved */
|
||||
loot: boolean;
|
||||
durability: boolean;
|
||||
}
|
||||
|
@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig {
|
||||
/** How full must a random static magazine be %*/
|
||||
minFillStaticMagazinePercent: number;
|
||||
allowDuplicateItemsInStaticContainers: boolean;
|
||||
/** Chance loose/static magazines have ammo in them */
|
||||
/** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */
|
||||
magazineLootHasAmmoChancePercent: number;
|
||||
/** Chance static magazines have ammo in them */
|
||||
staticMagazineLootHasAmmoChancePercent: number;
|
||||
/** Key: map, value: loose loot ids to ignore */
|
||||
looseLootBlacklist: Record<string, string[]>;
|
||||
/** Key: map, value: settings to control how long scav raids are*/
|
||||
|
@ -40,6 +40,8 @@ export interface FenceConfig {
|
||||
presetSlotsToRemoveChancePercent: Record<string, number>;
|
||||
/** Block seasonal items from appearing when season is inactive */
|
||||
blacklistSeasonalItems: boolean;
|
||||
/** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */
|
||||
ammoMaxPenLimit: number;
|
||||
blacklist: string[];
|
||||
coopExtractGift: CoopExtractReward;
|
||||
btrDeliveryExpireHours: number;
|
||||
|
7
TypeScript/11BundleLoadingSample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts
vendored
Normal file
7
TypeScript/11BundleLoadingSample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader";
|
||||
export interface ICreateFenceAssortsResult {
|
||||
sptItems: Item[][];
|
||||
barter_scheme: Record<string, IBarterScheme[][]>;
|
||||
loyal_level_items: Record<string, number>;
|
||||
}
|
@ -19,6 +19,7 @@ export declare class HttpServer {
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected webSocketServer: WebSocketServer;
|
||||
protected httpConfig: IHttpConfig;
|
||||
protected started: boolean;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer);
|
||||
/**
|
||||
* Handle server loading event
|
||||
@ -26,4 +27,5 @@ export declare class HttpServer {
|
||||
load(): void;
|
||||
protected handleRequest(req: IncomingMessage, resp: ServerResponse): void;
|
||||
protected getCookies(req: IncomingMessage): Record<string, string>;
|
||||
isStarted(): boolean;
|
||||
}
|
||||
|
@ -69,6 +69,8 @@ export declare class BotLootCacheService {
|
||||
* @returns
|
||||
*/
|
||||
protected isGrenade(props: Props): boolean;
|
||||
protected isFood(tpl: string): boolean;
|
||||
protected isDrink(tpl: string): boolean;
|
||||
/**
|
||||
* Check if a bot type exists inside the loot cache
|
||||
* @param botRole role to check for
|
||||
|
@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||
import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader";
|
||||
import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
|
||||
import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult";
|
||||
import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||
@ -37,7 +38,7 @@ export declare class FenceService {
|
||||
protected fenceAssort: ITraderAssort;
|
||||
/** Assorts shown on a separate tab when you max out fence rep */
|
||||
protected fenceDiscountAssort: ITraderAssort;
|
||||
/** Hydrated on initial assort generation as part of generateFenceAssorts() */
|
||||
/** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */
|
||||
protected desiredAssortCounts: IFenceAssortGenerationValues;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
/**
|
||||
@ -93,17 +94,23 @@ export declare class FenceService {
|
||||
* Replace a percentage of fence assorts with freshly generated items
|
||||
*/
|
||||
performPartialRefresh(): void;
|
||||
/**
|
||||
* Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead
|
||||
* @param newFenceAssorts Assorts to fold into existing fence assorts
|
||||
* @param existingFenceAssorts Current fence assorts new assorts will be added to
|
||||
*/
|
||||
protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void;
|
||||
/**
|
||||
* Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config
|
||||
*/
|
||||
protected incrementPartialRefreshTime(): void;
|
||||
/**
|
||||
* Compare the current fence offer count to what the config wants it to be,
|
||||
* If value is lower add extra count to value to generate more items to fill gap
|
||||
* @param existingItemCountToReplace count of items to generate
|
||||
* @returns number of items to generate
|
||||
* Get values that will hydrate the passed in assorts back to the desired counts
|
||||
* @param assortItems Current assorts after items have been removed
|
||||
* @param generationValues Base counts assorts should be adjusted to
|
||||
* @returns IGenerationAssortValues object with adjustments needed to reach desired state
|
||||
*/
|
||||
protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues;
|
||||
protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues;
|
||||
/**
|
||||
* Delete desired number of items from assort (including children)
|
||||
* @param itemCountToReplace
|
||||
@ -132,6 +139,12 @@ export declare class FenceService {
|
||||
* Uses fence base cache generatedon server start as a base
|
||||
*/
|
||||
generateFenceAssorts(): void;
|
||||
/**
|
||||
* Convert the intermediary assort data generated into format client can process
|
||||
* @param intermediaryAssorts Generated assorts that will be converted
|
||||
* @returns ITraderAssort
|
||||
*/
|
||||
protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort;
|
||||
/**
|
||||
* Create object that contains calculated fence assort item values to make based on config
|
||||
* Stored in this.desiredAssortCounts
|
||||
@ -147,7 +160,7 @@ export declare class FenceService {
|
||||
* @param assortCount Number of assorts to generate
|
||||
* @param assorts object to add created assorts to
|
||||
*/
|
||||
protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void;
|
||||
protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult;
|
||||
/**
|
||||
* Add item assorts to existing assort data
|
||||
* @param assortCount Number to add
|
||||
@ -156,7 +169,7 @@ export declare class FenceService {
|
||||
* @param itemTypeLimits
|
||||
* @param loyaltyLevel Loyalty level to set new item to
|
||||
*/
|
||||
protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record<string, {
|
||||
protected addItemAssorts(assortCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record<string, {
|
||||
current: number;
|
||||
max: number;
|
||||
}>, loyaltyLevel: number): void;
|
||||
@ -165,10 +178,10 @@ export declare class FenceService {
|
||||
* e.g. salewa hp resource units left
|
||||
* @param rootItemBeingAdded item to look for a match against
|
||||
* @param itemDbDetails Db details of matching item
|
||||
* @param fenceItemAssorts Items to search through
|
||||
* @param itemsWithChildren Items to search through
|
||||
* @returns Matching assort item
|
||||
*/
|
||||
protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item;
|
||||
protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item;
|
||||
/**
|
||||
* Should this item be forced into only 1 stack on fence
|
||||
* @param existingItem Existing item from fence assort
|
||||
@ -176,6 +189,7 @@ export declare class FenceService {
|
||||
* @returns True item should be force stacked
|
||||
*/
|
||||
protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean;
|
||||
protected itemInPreventDupeCategoryList(tpl: string): boolean;
|
||||
/**
|
||||
* Adjust price of item based on what is left to buy (resource/uses left)
|
||||
* @param barterSchemes All barter scheme for item having price adjusted
|
||||
@ -197,7 +211,7 @@ export declare class FenceService {
|
||||
* @param baseFenceAssort Base data to draw from
|
||||
* @param loyaltyLevel Which loyalty level is required to see/buy item
|
||||
*/
|
||||
protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void;
|
||||
protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void;
|
||||
/**
|
||||
* Adjust plate / soft insert durability values
|
||||
* @param armor Armor item array to add mods into
|
||||
|
@ -10,6 +10,7 @@ export declare class ItemBaseClassService {
|
||||
protected localisationService: LocalisationService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemBaseClassesCache: Record<string, string[]>;
|
||||
protected items: Record<string, ITemplateItem>;
|
||||
protected cacheGenerated: boolean;
|
||||
constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer);
|
||||
/**
|
||||
@ -21,9 +22,8 @@ export declare class ItemBaseClassService {
|
||||
* Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary
|
||||
* @param itemIdToUpdate item tpl to store base ids against in dictionary
|
||||
* @param item item being checked
|
||||
* @param allDbItems all items in db
|
||||
*/
|
||||
protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record<string, ITemplateItem>): void;
|
||||
protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void;
|
||||
/**
|
||||
* Does item tpl inherit from the requested base class
|
||||
* @param itemTpl item to check base classes of
|
||||
@ -31,6 +31,12 @@ export declare class ItemBaseClassService {
|
||||
* @returns true if item inherits from base class passed in
|
||||
*/
|
||||
itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean;
|
||||
/**
|
||||
* Check if cached item template is of type Item
|
||||
* @param itemTemplateId item to check
|
||||
* @returns true if item is of type Item
|
||||
*/
|
||||
private cachedItemIsOfItemType;
|
||||
/**
|
||||
* Get base classes item inherits from
|
||||
* @param itemTpl item to get base classes for
|
||||
|
@ -60,7 +60,7 @@ export declare class PaymentService {
|
||||
*/
|
||||
addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void;
|
||||
/**
|
||||
* Get all money stacks in inventory and prioritse items in stash
|
||||
* Get all money stacks in inventory and prioritise items in stash
|
||||
* @param pmcData
|
||||
* @param currencyTpl
|
||||
* @param playerStashId Players stash id
|
||||
|
21
TypeScript/11BundleLoadingSample/types/services/ProfileActivityService.d.ts
vendored
Normal file
21
TypeScript/11BundleLoadingSample/types/services/ProfileActivityService.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
export declare class ProfileActivityService {
|
||||
protected profileActivityTimestamps: Record<string, number>;
|
||||
/**
|
||||
* Was the requested profile active in the last requested minutes
|
||||
* @param sessionId Profile to check
|
||||
* @param minutes Minutes to check for activity in
|
||||
* @returns True when profile was active within past x minutes
|
||||
*/
|
||||
activeWithinLastMinutes(sessionId: string, minutes: number): boolean;
|
||||
/**
|
||||
* Get an array of profile ids that were active in the last x minutes
|
||||
* @param minutes How many minutes from now to search for profiles
|
||||
* @returns String array of profile ids
|
||||
*/
|
||||
getActiveProfileIdsWithinMinutes(minutes: number): string[];
|
||||
/**
|
||||
* Update the timestamp a profile was last observed active
|
||||
* @param sessionId Profile to update
|
||||
*/
|
||||
setActivityTimestamp(sessionId: string): void;
|
||||
}
|
@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
|
||||
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||
import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||
import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests";
|
||||
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||
import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea";
|
||||
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas";
|
||||
import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig";
|
||||
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
|
||||
@ -119,6 +120,19 @@ export declare class ProfileFixerService {
|
||||
* @param pmcProfile Profile to check inventory of
|
||||
*/
|
||||
checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void;
|
||||
/**
|
||||
* @param buildType The type of build, used for logging only
|
||||
* @param build The build to check for invalid items
|
||||
* @param itemsDb The items database to use for item lookup
|
||||
* @returns True if the build should be removed from the build list, false otherwise
|
||||
*/
|
||||
protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record<string, ITemplateItem>): boolean;
|
||||
/**
|
||||
* @param magazineBuild The magazine build to check for validity
|
||||
* @param itemsDb The items database to use for item lookup
|
||||
* @returns True if the build should be removed from the build list, false otherwise
|
||||
*/
|
||||
protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record<string, ITemplateItem>): boolean;
|
||||
/**
|
||||
* Attempt to fix common item issues that corrupt profiles
|
||||
* @param pmcProfile Profile to check items of
|
||||
@ -155,6 +169,10 @@ export declare class ProfileFixerService {
|
||||
* @param pmcProfile Profile to add missing IDs to
|
||||
*/
|
||||
addMissingIdsToBonuses(pmcProfile: IPmcData): void;
|
||||
/**
|
||||
* 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found
|
||||
*/
|
||||
fixBitcoinProductionTime(pmcProfile: IPmcData): void;
|
||||
/**
|
||||
* At some point the property name was changed,migrate data across to new name
|
||||
* @param pmcProfile Profile to migrate improvements in
|
||||
|
@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad {
|
||||
* @returns cost of item in desired currency
|
||||
*/
|
||||
getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number;
|
||||
/**
|
||||
* @param itemTemplateId
|
||||
* @param desiredCurrency
|
||||
* @param item
|
||||
* @param offerItems
|
||||
* @param isPackOffer
|
||||
* @returns
|
||||
*/
|
||||
getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number;
|
||||
/**
|
||||
* using data from config, adjust an items price to be relative to its handbook price
|
||||
* @param handbookPrices Prices of items in handbook
|
||||
|
@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate";
|
||||
import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||
import { HttpServer } from "@spt-aki/servers/HttpServer";
|
||||
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||
import { EncodingUtil } from "@spt-aki/utils/EncodingUtil";
|
||||
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||
@ -12,11 +13,12 @@ export declare class App {
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected encodingUtil: EncodingUtil;
|
||||
protected httpServer: HttpServer;
|
||||
protected onLoadComponents: OnLoad[];
|
||||
protected onUpdateComponents: OnUpdate[];
|
||||
protected onUpdateLastRun: {};
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]);
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]);
|
||||
load(): Promise<void>;
|
||||
protected update(onUpdateComponents: OnUpdate[]): Promise<void>;
|
||||
protected logUpdateException(err: any, updateable: OnUpdate): void;
|
||||
|
@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger {
|
||||
protected abstract isLogExceptions(): boolean;
|
||||
protected abstract getFilePath(): string;
|
||||
protected abstract getFileName(): string;
|
||||
protected getLogFrequency(): string;
|
||||
protected getLogMaxSize(): string;
|
||||
protected getLogMaxFiles(): string;
|
||||
writeToLogFile(data: string | Daum): Promise<void>;
|
||||
|
@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController";
|
||||
import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData";
|
||||
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||
import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||
import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType";
|
||||
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||
export declare class BotCallbacks {
|
||||
@ -19,6 +20,11 @@ export declare class BotCallbacks {
|
||||
* @returns string
|
||||
*/
|
||||
getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||
/**
|
||||
* Handle singleplayer/settings/bot/difficulties
|
||||
* @returns dictionary of every bot and its diffiulty settings
|
||||
*/
|
||||
getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record<string, Difficulties>;
|
||||
/**
|
||||
* Handle client/game/bot/generate
|
||||
* @returns IGetBodyResponseData
|
||||
|
@ -39,11 +39,6 @@ export declare class InraidCallbacks {
|
||||
* @returns JSON as string
|
||||
*/
|
||||
getRaidMenuSettings(): string;
|
||||
/**
|
||||
* Handle singleplayer/settings/weapon/durability
|
||||
* @returns
|
||||
*/
|
||||
getWeaponDurability(): string;
|
||||
/**
|
||||
* Handle singleplayer/airdrop/config
|
||||
* @returns JSON as string
|
||||
|
@ -51,12 +51,13 @@ export declare class BotController {
|
||||
getBotCoreDifficulty(): IBotCore;
|
||||
/**
|
||||
* Get bot difficulty settings
|
||||
* adjust PMC settings to ensure they engage the correct bot types
|
||||
* Adjust PMC settings to ensure they engage the correct bot types
|
||||
* @param type what bot the server is requesting settings for
|
||||
* @param diffLevel difficulty level server requested settings for
|
||||
* @returns Difficulty object
|
||||
*/
|
||||
getBotDifficulty(type: string, diffLevel: string): Difficulty;
|
||||
getAllBotDifficulties(): Record<string, any>;
|
||||
/**
|
||||
* Generate bot profiles and store in cache
|
||||
* @param sessionId Session id
|
||||
|
@ -28,7 +28,7 @@ export declare class BuildController {
|
||||
saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void;
|
||||
/** Handle client/builds/delete*/
|
||||
removeBuild(sessionID: string, request: IRemoveBuildRequestData): void;
|
||||
protected removePlayerBuild(id: string, sessionID: string): void;
|
||||
protected removePlayerBuild(idToRemove: string, sessionID: string): void;
|
||||
/**
|
||||
* Handle client/builds/magazine/save
|
||||
*/
|
||||
|
@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService";
|
||||
import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService";
|
||||
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||
import { OpenZoneService } from "@spt-aki/services/OpenZoneService";
|
||||
import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService";
|
||||
import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService";
|
||||
import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService";
|
||||
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||
@ -55,6 +56,7 @@ export declare class GameController {
|
||||
protected itemBaseClassService: ItemBaseClassService;
|
||||
protected giftService: GiftService;
|
||||
protected raidTimeAdjustmentService: RaidTimeAdjustmentService;
|
||||
protected profileActivityService: ProfileActivityService;
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected configServer: ConfigServer;
|
||||
protected httpConfig: IHttpConfig;
|
||||
@ -65,12 +67,14 @@ export declare class GameController {
|
||||
protected pmcConfig: IPmcConfig;
|
||||
protected lootConfig: ILootConfig;
|
||||
protected botConfig: IBotConfig;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
load(): void;
|
||||
/**
|
||||
* Handle client/game/start
|
||||
*/
|
||||
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
|
||||
protected adjustHideoutCraftTimes(): void;
|
||||
protected adjustHideoutBuildTimes(): void;
|
||||
protected adjustLocationBotValues(): void;
|
||||
/**
|
||||
* Out of date/incorrectly made trader mods forget this data
|
||||
|
@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||
import { FenceService } from "@spt-aki/services/FenceService";
|
||||
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||
import { PlayerService } from "@spt-aki/services/PlayerService";
|
||||
import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
@ -57,13 +58,14 @@ export declare class HideoutController {
|
||||
protected hideoutHelper: HideoutHelper;
|
||||
protected scavCaseRewardGenerator: ScavCaseRewardGenerator;
|
||||
protected localisationService: LocalisationService;
|
||||
protected profileActivityService: ProfileActivityService;
|
||||
protected configServer: ConfigServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected fenceService: FenceService;
|
||||
/** Key used in TaskConditionCounters array */
|
||||
protected static nameTaskConditionCountersCrafting: string;
|
||||
protected hideoutConfig: IHideoutConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService);
|
||||
/**
|
||||
* Handle HideoutUpgrade event
|
||||
* Start a hideout area upgrade
|
||||
|
@ -44,6 +44,11 @@ export declare class LauncherController {
|
||||
protected formatID(timeStamp: number, counter: number): string;
|
||||
changeUsername(info: IChangeRequestData): string;
|
||||
changePassword(info: IChangeRequestData): string;
|
||||
/**
|
||||
* Handle launcher requesting profile be wiped
|
||||
* @param info IRegisterData
|
||||
* @returns Session id
|
||||
*/
|
||||
wipe(info: IRegisterData): string;
|
||||
getCompatibleTarkovVersion(): string;
|
||||
/**
|
||||
|
@ -80,9 +80,10 @@ export declare class BotGenerator {
|
||||
* @param botJsonTemplate x.json from database
|
||||
* @param botGenerationDetails
|
||||
* @param botRole role of bot e.g. assault
|
||||
* @param sessionId profile session id
|
||||
* @returns Nickname for bot
|
||||
*/
|
||||
protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string;
|
||||
protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string;
|
||||
/**
|
||||
* Log the number of PMCs generated to the debug console
|
||||
* @param output Generated bot array, ready to send to client
|
||||
|
@ -28,6 +28,18 @@ export declare class FenceBaseAssortGenerator {
|
||||
* Create base fence assorts dynamically and store in memory
|
||||
*/
|
||||
generateFenceBaseAssorts(): void;
|
||||
/**
|
||||
* Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit
|
||||
* @param rootItemDb Ammo box or ammo item from items.db
|
||||
* @returns True if penetration value is above limit set in config
|
||||
*/
|
||||
protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean;
|
||||
/**
|
||||
* Get the penetration power value of an ammo, works with ammo boxes and raw ammos
|
||||
* @param rootItemDb Ammo box or ammo item from items.db
|
||||
* @returns Penetration power of passed in item, null if it doesnt have a power
|
||||
*/
|
||||
protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number;
|
||||
protected getItemPrice(itemTpl: string, items: Item[]): number;
|
||||
protected getAmmoBoxPrice(items: Item[]): number;
|
||||
/**
|
||||
|
@ -41,10 +41,10 @@ export declare class LootGenerator {
|
||||
*/
|
||||
createRandomLoot(options: LootRequest): LootItem[];
|
||||
/**
|
||||
* Filter armor items by their main plates protection level
|
||||
* @param armor Armor preset
|
||||
* @param options Loot request options
|
||||
* @returns True item passes checks
|
||||
* Filter armor items by their front plates protection level - top if its a helmet
|
||||
* @param armor Armor preset to check
|
||||
* @param options Loot request options - armor level etc
|
||||
* @returns True if item has desired armor level
|
||||
*/
|
||||
protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean;
|
||||
/**
|
||||
@ -74,13 +74,13 @@ export declare class LootGenerator {
|
||||
protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number;
|
||||
/**
|
||||
* Find a random item in items.json and add to result array
|
||||
* @param globalDefaultPresets presets to choose from
|
||||
* @param itemTypeCounts item limit counts
|
||||
* @param itemBlacklist items to skip
|
||||
* @param result array to add found preset to
|
||||
* @param presetPool Presets to choose from
|
||||
* @param itemTypeCounts Item limit counts
|
||||
* @param itemBlacklist Items to skip
|
||||
* @param result Array to add chosen preset to
|
||||
* @returns true if preset was valid and added to pool
|
||||
*/
|
||||
protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record<string, {
|
||||
protected findAndAddRandomPresetToLoot(presetPool: IPreset[], itemTypeCounts: Record<string, {
|
||||
current: number;
|
||||
max: number;
|
||||
}>, itemBlacklist: string[], result: LootItem[]): boolean;
|
||||
|
@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator {
|
||||
* @param minPrice The minimum priced item to include
|
||||
* @returns True if any items remain in `rewardItems`, false otherwise
|
||||
*/
|
||||
protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean;
|
||||
protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[];
|
||||
/**
|
||||
* Get a randomised number a reward items stack size should be based on its handbook price
|
||||
* @param item Reward item to get stack size for
|
||||
|
20
TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts
vendored
Normal file
20
TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand";
|
||||
import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot {
|
||||
protected logger: ILogger;
|
||||
protected mailSendService: MailSendService;
|
||||
protected chatCommands: IChatCommand[] | ICommandoCommand[];
|
||||
constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]);
|
||||
/**
|
||||
* @deprecated As of v3.7.6. Use registerChatCommand.
|
||||
*/
|
||||
registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void;
|
||||
registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void;
|
||||
abstract getChatBot(): IUserDialogInfo;
|
||||
protected abstract getUnrecognizedCommandMessage(): string;
|
||||
handleMessage(sessionId: string, request: ISendMessageRequest): string;
|
||||
}
|
@ -1,6 +1,10 @@
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
export interface ICommandoCommand {
|
||||
/**
|
||||
* @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0.
|
||||
*/
|
||||
export type ICommandoCommand = IChatCommand;
|
||||
export interface IChatCommand {
|
||||
getCommandPrefix(): string;
|
||||
getCommandHelp(command: string): string;
|
||||
getCommands(): Set<string>;
|
@ -1,9 +1,9 @@
|
||||
import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand";
|
||||
import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||
export declare class SptCommandoCommands implements ICommandoCommand {
|
||||
export declare class SptCommandoCommands implements IChatCommand {
|
||||
protected configServer: ConfigServer;
|
||||
protected sptCommands: ISptCommand[];
|
||||
constructor(configServer: ConfigServer, sptCommands: ISptCommand[]);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user