From ef814a53e3198d1b101e93f6789f9c330a780889 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 25 Jul 2023 16:00:47 +0100 Subject: [PATCH] Update types for 3.6.0 - example #1 --- .../types/callbacks/DialogueCallbacks.d.ts | 2 +- .../types/callbacks/ProfileCallbacks.d.ts | 2 +- .../types/controllers/DialogueController.d.ts | 29 ++++- .../types/controllers/GameController.d.ts | 10 +- .../types/controllers/InraidController.d.ts | 3 +- .../controllers/InventoryController.d.ts | 6 - .../types/controllers/LocationController.d.ts | 10 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 6 +- .../types/controllers/RagfairController.d.ts | 2 +- .../types/generators/BotWeaponGenerator.d.ts | 7 ++ .../generators/FenceBaseAssortGenerator.d.ts | 4 +- .../generators/RagfairOfferGenerator.d.ts | 62 +++++++--- .../types/generators/WeatherGenerator.d.ts | 7 +- .../types/helpers/ContainerHelper.d.ts | 30 ++++- .../types/helpers/DialogueHelper.d.ts | 16 +-- .../types/helpers/DurabilityLimitsHelper.d.ts | 26 ++++ .../types/helpers/HandbookHelper.d.ts | 16 ++- .../types/helpers/HideoutHelper.d.ts | 5 + .../types/helpers/HttpServerHelper.d.ts | 9 ++ .../types/helpers/InRaidHelper.d.ts | 2 +- .../types/helpers/InventoryHelper.d.ts | 6 +- .../types/helpers/ItemHelper.d.ts | 17 ++- .../types/helpers/NotifierHelper.d.ts | 13 +- .../types/helpers/ProfileHelper.d.ts | 22 +++- .../types/helpers/QuestHelper.d.ts | 4 +- .../types/helpers/RagfairOfferHelper.d.ts | 4 +- .../types/helpers/RagfairServerHelper.d.ts | 36 +++++- .../types/helpers/TraderHelper.d.ts | 7 ++ .../types/loaders/PreAkiModLoader.d.ts | 4 +- .../types/models/eft/common/IGlobals.d.ts | 2 +- .../models/eft/common/ILocationBase.d.ts | 6 + .../dialog/IGetFriendListDataResponse.d.ts | 14 +-- .../eft/inRaid/ISaveProgressRequestData.d.ts | 3 +- .../eft/inventory/IAddItemTempObject.d.ts | 1 + .../types/models/eft/notifier/INotifier.d.ts | 7 +- .../types/models/eft/profile/IAkiProfile.d.ts | 9 +- .../types/models/enums/BaseClasses.d.ts | 8 +- .../types/models/enums/ConfigTypes.d.ts | 3 +- .../types/models/enums/GiftSenderType.d.ts | 5 + .../types/models/enums/GiftSentResult.d.ts | 6 + .../models/enums/PlayerRaidEndState.d.ts | 7 ++ .../types/models/enums/SeasonalEventType.d.ts | 4 +- .../types/models/spt/config/IGiftsConfig.d.ts | 28 +++++ .../models/spt/config/ITraderConfig.d.ts | 4 + .../spt/dialog/ISendMessageDetails.d.ts | 30 +++++ .../types/servers/http/AkiHttpListener.d.ts | 2 +- .../services/BotEquipmentModPoolService.d.ts | 4 +- .../types/services/FenceService.d.ts | 6 + .../types/services/GiftService.d.ts | 50 ++++++++ .../types/services/InsuranceService.d.ts | 63 ++++++++-- .../types/services/MailSendService.d.ts | 111 ++++++++++++++++++ .../services/MatchBotDetailsCacheService.d.ts | 4 +- .../types/services/RagfairPriceService.d.ts | 6 +- .../types/services/RepairService.d.ts | 4 +- .../types/services/SeasonalEventService.d.ts | 20 +++- .../TraderPurchasePersisterService.d.ts | 4 +- 57 files changed, 669 insertions(+), 115 deletions(-) create mode 100644 TypeScript/1LogToConsole/types/models/enums/GiftSenderType.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/enums/GiftSentResult.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/enums/PlayerRaidEndState.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/spt/config/IGiftsConfig.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts create mode 100644 TypeScript/1LogToConsole/types/services/GiftService.d.ts create mode 100644 TypeScript/1LogToConsole/types/services/MailSendService.d.ts diff --git a/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts index 3365636..23cb707 100644 --- a/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts @@ -87,7 +87,7 @@ export declare class DialogueCallbacks implements OnUpdate { ignoreFriend(url: string, request: { uid: string; }, sessionID: string): any; - /** Handle client/friend/ignore/set */ + /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; }, sessionID: string): any; diff --git a/TypeScript/1LogToConsole/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/ProfileCallbacks.d.ts index 9bcba88..77f6a27 100644 --- a/TypeScript/1LogToConsole/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/ProfileCallbacks.d.ts @@ -76,5 +76,5 @@ export declare class ProfileCallbacks { /** * Handle /launcher/profiles */ - getAllMiniProfiles(url: string, info: any, sessionID: string): string; + getAllMiniProfiles(url: string, info: IEmptyRequestData, sessionID: string): string; } diff --git a/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts b/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts index 9db517b..310b9e7 100644 --- a/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts @@ -5,13 +5,22 @@ import { IGetMailDialogViewRequestData } from "../models/eft/dialog/IGetMailDial import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDialogViewResponseData"; import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; +import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { SaveServer } from "../servers/SaveServer"; +import { GiftService } from "../services/GiftService"; +import { MailSendService } from "../services/MailSendService"; +import { HashUtil } from "../utils/HashUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class DialogueController { + protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - constructor(saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper); + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected hashUtil: HashUtil; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); /** Handle onUpdate spt event */ update(): void; /** @@ -34,6 +43,14 @@ export declare class DialogueController { * @returns DialogueInfo */ getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo; + /** + * Get the users involved in a dialog (player + other party) + * @param dialog The dialog to check for users + * @param messageType What type of message is being sent + * @param sessionID Player id + * @returns IUserDialogInfo array + */ + getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[]; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -51,7 +68,13 @@ export declare class DialogueController { * @returns Dialogue */ protected getDialogByIdFromProfile(profile: IAkiProfile, request: IGetMailDialogViewRequestData): Dialogue; - protected getProfilesForMail(pmcProfile: IAkiProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; + /** + * Get the users involved in a mail between two entities + * @param fullProfile Player profile + * @param dialogUsers The participants of the mail + * @returns IUserDialogInfo array + */ + protected getProfilesForMail(fullProfile: IAkiProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[]; /** * Get a count of messages with attachments from a particular dialog * @param sessionID Session id @@ -80,6 +103,8 @@ export declare class DialogueController { getAllAttachments(dialogueID: string, sessionID: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; + protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; + protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts index c8f13ff..6d0ce18 100644 --- a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts @@ -18,6 +18,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; +import { GiftService } from "../services/GiftService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -40,17 +41,19 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected os: any; protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** * Handle client/game/config @@ -95,6 +98,11 @@ export declare class GameController { * Make Rogues spawn later to allow for scavs to spawn first instead of rogues filling up all spawn positions */ protected fixRoguesSpawningInstantlyOnLighthouse(): void; + /** + * Send starting gifts to profile after x days + * @param pmcProfile Profile to add gifts to + */ + protected sendPraporGiftsToNewProfiles(pmcProfile: IPmcData): void; /** * Find and split waves with large numbers of bots into smaller waves - BSG appears to reduce the size of these waves to one bot when they're waiting to spawn for too long */ diff --git a/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts b/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts index fa22462..f224662 100644 --- a/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts @@ -10,6 +10,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { PlayerRaidEndState } from "../models/enums/PlayerRaidEndState"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -99,7 +100,7 @@ export declare class InraidController { * @param statusOnExit exit value from offraidData object * @returns true if dead */ - protected isPlayerDead(statusOnExit: string): boolean; + protected isPlayerDead(statusOnExit: PlayerRaidEndState): boolean; /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request diff --git a/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts b/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts index c28581c..3fe5b39 100644 --- a/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts @@ -6,7 +6,6 @@ import { PresetHelper } from "../helpers/PresetHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData"; import { IInventoryBindRequestData } from "../models/eft/inventory/IInventoryBindRequestData"; import { IInventoryCreateMarkerRequestData } from "../models/eft/inventory/IInventoryCreateMarkerRequestData"; import { IInventoryDeleteMarkerRequestData } from "../models/eft/inventory/IInventoryDeleteMarkerRequestData"; @@ -101,11 +100,6 @@ export declare class InventoryController { * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment */ swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Give Item - * its used for "add" item like gifts etc. - */ - addItem(pmcData: IPmcData, body: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: any, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/1LogToConsole/types/controllers/LocationController.d.ts b/TypeScript/1LogToConsole/types/controllers/LocationController.d.ts index d83894e..156936e 100644 --- a/TypeScript/1LogToConsole/types/controllers/LocationController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/LocationController.d.ts @@ -34,13 +34,19 @@ export declare class LocationController { * @returns ILocationBase */ get(location: string): ILocationBase; - private generate; + /** + * Generate a maps base location without loot + * @param name Map name + * @returns ILocationBase + */ + protected generate(name: string): ILocationBase; /** * Handle client/locations * Get all maps base location properties without loot data + * @param sessionId Players Id * @returns ILocationsGenerateAllResponse */ - generateAll(): ILocationsGenerateAllResponse; + generateAll(sessionId: string): ILocationsGenerateAllResponse; /** * Handle client/location/getAirdropLoot * Get loot for an airdop container diff --git a/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts b/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts index ea20498..ffccdaf 100644 --- a/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts @@ -18,6 +18,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; +import { LocalisationService } from "../services/LocalisationService"; +import { MailSendService } from "../services/MailSendService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { HashUtil } from "../utils/HashUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -29,13 +31,15 @@ export declare class ProfileController { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; + protected localisationService: LocalisationService; + protected mailSendService: MailSendService; protected playerScavGenerator: PlayerScavGenerator; protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ diff --git a/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts index a9129c2..27a5a1a 100644 --- a/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts @@ -3,6 +3,7 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; @@ -18,6 +19,7 @@ import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; import { LocalisationService } from "../services/LocalisationService"; +import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; @@ -30,7 +32,9 @@ export declare class QuestController { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; + protected mailSendService: MailSendService; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; protected questHelper: QuestHelper; protected questConditionHelper: QuestConditionHelper; protected playerService: PlayerService; @@ -39,7 +43,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player diff --git a/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts b/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts index b94ad20..4dcb4b2 100644 --- a/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts @@ -120,7 +120,7 @@ export declare class RagfairController { /** * List item(s) on flea for sale * @param pmcData Player profile - * @param offerRequest Flea list creatio offer + * @param offerRequest Flea list creation offer * @param sessionID Session id * @returns IItemEventRouterResponse */ diff --git a/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts index 3e9fe30..6c28462 100644 --- a/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts @@ -67,6 +67,13 @@ export declare class BotWeaponGenerator { * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; + /** + * Insert a cartridge into a weapon + * @param weaponWithModsArray Weapon and mods + * @param ammoTpl Cartridge to add to weapon + * @param desiredSlotId name of slot, e.g. patron_in_weapon + */ + protected addCartridgeToChamber(weaponWithModsArray: Item[], ammoTpl: string, desiredSlotId: string): void; /** * Create array with weapon base as only element and * add additional properties based on weapon type diff --git a/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts index 387df3a..486c4bd 100644 --- a/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts @@ -6,15 +6,17 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; +import { SeasonalEventService } from "../services/SeasonalEventService"; export declare class FenceBaseAssortGenerator { protected logger: ILogger; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemHelper: ItemHelper; protected itemFilterService: ItemFilterService; + protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Create base fence assorts dynamically and store in db */ diff --git a/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts index 35fceff..a627191 100644 --- a/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts @@ -48,7 +48,30 @@ export declare class RagfairOfferGenerator { price: number; }[]; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); - createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Create a flea offer and store it in the Ragfair server offers array + * @param userID Owner of the offer + * @param time Time offer is listed at + * @param items Items in the offer + * @param barterScheme Cost of item (currency or barter) + * @param loyalLevel Loyalty level needed to buy item + * @param price Price of offer + * @param sellInOnePiece Set StackObjectsCount to 1 + * @returns IRagfairOffer + */ + createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Create an offer object ready to send to ragfairOfferService.addOffer() + * @param userID Owner of the offer + * @param time Time offer is listed at + * @param items Items in the offer + * @param barterScheme Cost of item (currency or barter) + * @param loyalLevel Loyalty level needed to buy item + * @param price Price of offer + * @param sellInOnePiece Set StackObjectsCount to 1 + * @returns IRagfairOffer + */ + protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; /** * Calculate the offer price that's listed on the flea listing * @param offerRequirements barter requirements for offer @@ -69,8 +92,18 @@ export declare class RagfairOfferGenerator { * @returns count of roubles */ protected calculateRoublePrice(currencyCount: number, currencyType: string): number; - protected getTraderId(userID: string): string; - protected getRating(userID: string): number; + /** + * Check userId, if its a player, return their pmc _id, otherwise return userId parameter + * @param userId Users Id to check + * @returns Users Id + */ + protected getTraderId(userId: string): string; + /** + * Get a flea trading rating for the passed in user + * @param userId User to get flea rating of + * @returns Flea rating value + */ + protected getRating(userId: string): number; /** * Is the offers user rating growing * @param userID user to check rating of @@ -89,13 +122,20 @@ export declare class RagfairOfferGenerator { * @param expiredOffers optional, expired offers to regenerate */ generateDynamicOffers(expiredOffers?: Item[]): Promise; + /** + * + * @param assortItemIndex Index of assort item + * @param assortItemsToProcess Item array containing index + * @param expiredOffers Currently expired offers on flea + * @param config Ragfair dynamic config + */ protected createOffersForItems(assortItemIndex: string, assortItemsToProcess: Item[], expiredOffers: Item[], config: Dynamic): Promise; /** * Create one flea offer for a specific item * @param items Item to create offer for * @param isPreset Is item a weapon preset * @param itemDetails raw db item details - * @returns + * @returns Item array */ protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise; /** @@ -142,7 +182,7 @@ export declare class RagfairOfferGenerator { /** * Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based * @param offerItems Items for sale in offer - * @returns barter scheme + * @returns Barter scheme */ protected createBarterRequirement(offerItems: Item[]): IBarterScheme[]; /** @@ -159,16 +199,4 @@ export declare class RagfairOfferGenerator { * @returns Barter scheme for offer */ protected createCurrencyRequirement(offerItems: Item[]): IBarterScheme[]; - /** - * Create a flea offer and store it in the Ragfair server offers array - * @param userID owner of the offer - * @param time time offer is put up - * @param items items in the offer - * @param barterScheme cost of item (currency or barter) - * @param loyalLevel Loyalty level needed to buy item - * @param price price of offer - * @param sellInOnePiece - * @returns Ragfair offer - */ - createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; } diff --git a/TypeScript/1LogToConsole/types/generators/WeatherGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/WeatherGenerator.d.ts index 65d2c76..2e2403c 100644 --- a/TypeScript/1LogToConsole/types/generators/WeatherGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/WeatherGenerator.d.ts @@ -16,6 +16,11 @@ export declare class WeatherGenerator { protected configServer: ConfigServer; protected weatherConfig: IWeatherConfig; constructor(weightedRandomHelper: WeightedRandomHelper, logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, applicationContext: ApplicationContext, configServer: ConfigServer); + /** + * Get current + raid datetime and format into correct BSG format and return + * @param data Weather data + * @returns IWeatherData + */ calculateGameTime(data: IWeatherData): IWeatherData; /** * Get server uptime seconds multiplied by a multiplier and add to current time as seconds @@ -33,7 +38,7 @@ export declare class WeatherGenerator { /** * Get current time formatted to fit BSGs requirement * @param date date to format into bsg style - * @returns + * @returns Time formatted in BSG format */ protected getBSGFormattedTime(date: Date): string; /** diff --git a/TypeScript/1LogToConsole/types/helpers/ContainerHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ContainerHelper.d.ts index 84e8c41..125fbcb 100644 --- a/TypeScript/1LogToConsole/types/helpers/ContainerHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ContainerHelper.d.ts @@ -6,7 +6,35 @@ export declare class FindSlotResult { constructor(success?: boolean, x?: any, y?: any, rotation?: boolean); } export declare class ContainerHelper { - protected locateSlot(container2D: number[][], containerX: number, containerY: number, x: number, y: number, itemW: number, itemH: number): boolean; + /** + * Finds a slot for an item in a given 2D container map + * @param container2D Array of container with slots filled/free + * @param itemWidth Width of item + * @param itemHeight Height of item + * @returns Location to place item in container + */ findSlotForItem(container2D: number[][], itemWidth: number, itemHeight: number): FindSlotResult; + /** + * Find a slot inside a container an item can be placed in + * @param container2D Container to find space in + * @param containerX Container x size + * @param containerY Container y size + * @param x ??? + * @param y ??? + * @param itemW Items width + * @param itemH Items height + * @returns True - slot found + */ + protected locateSlot(container2D: number[][], containerX: number, containerY: number, x: number, y: number, itemW: number, itemH: number): boolean; + /** + * Find a free slot for an item to be placed at + * @param container2D Container to palce item in + * @param x Container x size + * @param y Container y size + * @param itemW Items width + * @param itemH Items height + * @param rotate is item rotated + * @returns Location to place item + */ fillContainerMapWithItem(container2D: number[][], x: number, y: number, itemW: number, itemH: number, rotate: boolean): number[][]; } diff --git a/TypeScript/1LogToConsole/types/helpers/DialogueHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/DialogueHelper.d.ts index 898bf8e..6a8adc5 100644 --- a/TypeScript/1LogToConsole/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/DialogueHelper.d.ts @@ -20,21 +20,13 @@ export declare class DialogueHelper { protected itemHelper: ItemHelper; constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** - * Create basic message context template - * @param templateId - * @param messageType - * @param maxStoreTime - * @returns + * @deprecated Use MailSendService.sendMessage() or helpers */ - createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; + createMessageContext(templateId: string, messageType: MessageType, maxStoreTime?: any): MessageContent; /** - * Add a templated message to the dialogue. - * @param dialogueID - * @param messageContent - * @param sessionID - * @param rewards + * @deprecated Use MailSendService.sendMessage() or helpers */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[], messageType?: MessageType): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/1LogToConsole/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/DurabilityLimitsHelper.d.ts index 7122376..671559f 100644 --- a/TypeScript/1LogToConsole/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/DurabilityLimitsHelper.d.ts @@ -9,9 +9,35 @@ export declare class DurabilityLimitsHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; constructor(randomUtil: RandomUtil, botHelper: BotHelper, configServer: ConfigServer); + /** + * Get max durability for a weapon based on bot role + * @param itemTemplate UNUSED - Item to get durability for + * @param botRole Role of bot to get max durability for + * @returns Max durability of weapon + */ getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + /** + * Get max durability value for armor based on bot role + * @param itemTemplate Item to get max durability for + * @param botRole Role of bot to get max durability for + * @returns max durability + */ getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + /** + * Get randomised current weapon durability by bot role + * @param itemTemplate Unused - Item to get current durability of + * @param botRole Role of bot to get current durability for + * @param maxDurability Max durability of weapon + * @returns Current weapon durability + */ getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + /** + * Get randomised current armor durability by bot role + * @param itemTemplate Unused - Item to get current durability of + * @param botRole Role of bot to get current durability for + * @param maxDurability Max durability of armor + * @returns Current armor durability + */ getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; protected generateMaxWeaponDurability(botRole: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; diff --git a/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts index dd9ce09..856c23a 100644 --- a/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts @@ -14,6 +14,9 @@ export declare class HandbookHelper { protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; constructor(databaseServer: DatabaseServer); + /** + * Create an in-memory cache of all items with associated handbook price in handbookPriceCache class + */ hydrateLookup(): void; /** * Get price from internal cache, if cache empty look up price directly in handbook (expensive) @@ -23,18 +26,23 @@ export declare class HandbookHelper { */ getTemplatePrice(tpl: string): number; /** - * all items in template with the given parent category - * @param x + * Get all items in template with the given parent category + * @param parentId * @returns string array */ - templatesWithParent(x: string): string[]; + templatesWithParent(parentId: string): string[]; /** * Does category exist in handbook cache * @param category * @returns true if exists in cache */ isCategory(category: string): boolean; - childrenCategories(x: string): string[]; + /** + * Get all items associated with a categories parent + * @param categoryParent + * @returns string array + */ + childrenCategories(categoryParent: string): string[]; /** * Convert non-roubles into roubles * @param nonRoubleCurrencyCount Currency count to convert diff --git a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts index 01539b8..e9d3746 100644 --- a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts @@ -52,6 +52,11 @@ export declare class HideoutHelper { * with all the constants. */ initProduction(recipeId: string, productionTime: number): Production; + /** + * Is the provided object a Production type + * @param productive + * @returns + */ isProductionType(productive: Productive): productive is Production; applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** diff --git a/TypeScript/1LogToConsole/types/helpers/HttpServerHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HttpServerHelper.d.ts index c6e5296..b05cbdf 100644 --- a/TypeScript/1LogToConsole/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HttpServerHelper.d.ts @@ -16,8 +16,17 @@ export declare class HttpServerHelper { }; constructor(configServer: ConfigServer); getMimeText(key: string): string; + /** + * Combine ip and port into url + * @returns url + */ buildUrl(): string; + /** + * Prepend http to the url:port + * @returns URI + */ getBackendUrl(): string; + /** Get websocket url + port */ getWebsocketUrl(): string; sendTextJson(resp: any, output: any): void; } diff --git a/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts index db56f82..baaf448 100644 --- a/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts @@ -27,7 +27,7 @@ export declare class InRaidHelper { protected lostOnDeathConfig: ILostOnDeathConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** - * Should quest items be removed from player inventory on death + * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory */ removeQuestItemsOnDeath(): boolean; diff --git a/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts index f4ead8c..ff96a23 100644 --- a/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts @@ -53,11 +53,12 @@ export declare class InventoryHelper { * @param callback Code to execute later (function) * @param foundInRaid Will results added to inventory be set as found in raid * @param addUpd Additional upd properties for items being added to inventory + * @param useSortingTable Allow items to go into sorting table when stash has no space * @returns IItemEventRouterResponse */ addItem(pmcData: IPmcData, request: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: { (): void; - }, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse; + }, foundInRaid?: boolean, addUpd?: any, useSortingTable?: boolean): IItemEventRouterResponse; /** * Add ammo to ammo boxes * @param itemToAdd Item to check is ammo box @@ -99,8 +100,9 @@ export declare class InventoryHelper { * @returns Array */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; - protected getStashType(sessionID: string): string; + protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; protected getPlayerStashSize(sessionID: string): Record; + protected getStashType(sessionID: string): string; /** * Internal helper function to transfer an item from one profile to another. * fromProfileData: Profile of the source. diff --git a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts index 78f5c30..47fe9ab 100644 --- a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts @@ -51,11 +51,22 @@ declare class ItemHelper { /** * Returns the item price based on the handbook or as a fallback from the prices.json if the item is not * found in the handbook. If the price can't be found at all return 0 - * - * @param {string} tpl the item template to check - * @returns {integer} The price of the item or 0 if not found + * @param tpl Item to look price up of + * @returns Price in roubles */ getItemPrice(tpl: string): number; + /** + * Get the static (handbook) price in roubles for an item by tpl + * @param tpl Items tpl id to look up price + * @returns Price in roubles (0 if not found) + */ + getStaticItemPrice(tpl: string): number; + /** + * Get the dynamic (flea) price in roubles for an item by tpl + * @param tpl Items tpl id to look up price + * @returns Price in roubles (undefined if not found) + */ + getDynamicItemPrice(tpl: string): number; fixItemStackCount(item: Item): Item; /** * AmmoBoxes contain StackSlots which need to be filled for the AmmoBox to have content. diff --git a/TypeScript/1LogToConsole/types/helpers/NotifierHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/NotifierHelper.d.ts index 738b69a..d824fb2 100644 --- a/TypeScript/1LogToConsole/types/helpers/NotifierHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/NotifierHelper.d.ts @@ -9,9 +9,18 @@ export declare class NotifierHelper { protected defaultNotification: INotification; constructor(httpServerHelper: HttpServerHelper); getDefaultNotification(): INotification; - /** Creates a new notification that displays the "Your offer was sold!" prompt and removes sold offer from "My Offers" on clientside */ + /** + * Create a new notification that displays the "Your offer was sold!" prompt and removes sold offer from "My Offers" on clientside + * @param dialogueMessage Message from dialog that was sent + * @param ragfairData Ragfair data to attach to notification + * @returns + */ createRagfairOfferSoldNotification(dialogueMessage: Message, ragfairData: MessageContentRagfair): INotification; - /** Creates a new notification with the specified dialogueMessage object. */ + /** + * Create a new notification with the specified dialogueMessage object + * @param dialogueMessage + * @returns + */ createNewMessageNotification(dialogueMessage: Message): INotification; getWebSocketServer(sessionID: string): string; } diff --git a/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts index 26bd7e9..a2fb099 100644 --- a/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Stats } from "../models/eft/common/tables/IBotBase"; +import { CounterKeyValue, Stats } from "../models/eft/common/tables/IBotBase"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -81,4 +81,24 @@ export declare class ProfileHelper { * @returns profile without secure container */ removeSecureContainer(profile: IPmcData): IPmcData; + /** + * Flag a profile as having received a gift + * Store giftid in profile aki object + * @param playerId Player to add gift flag to + * @param giftId Gift player received + */ + addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + /** + * Check if profile has recieved a gift by id + * @param playerId Player profile to check for gift + * @param giftId Gift to check for + * @returns True if player has recieved gift previously + */ + playerHasRecievedGift(playerId: string, giftId: string): boolean; + /** + * Find Stat in profile counters and increment by one + * @param counters Counters to search for key + * @param keyToIncrement Key + */ + incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; } diff --git a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts index 369e29d..dbee0a0 100644 --- a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts @@ -13,6 +13,7 @@ import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; import { LocalisationService } from "../services/LocalisationService"; +import { MailSendService } from "../services/MailSendService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -37,9 +38,10 @@ export declare class QuestHelper { protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; protected traderHelper: TraderHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, mailSendService: MailSendService, configServer: ConfigServer); /** * Get status of a quest in player profile by its id * @param pmcData Profile to search diff --git a/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts index 41e5f85..9392c82 100644 --- a/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts @@ -12,6 +12,7 @@ import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { LocaleService } from "../services/LocaleService"; +import { LocalisationService } from "../services/LocalisationService"; import { RagfairOfferService } from "../services/RagfairOfferService"; import { HashUtil } from "../utils/HashUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -42,11 +43,12 @@ export declare class RagfairOfferHelper { protected ragfairHelper: RagfairHelper; protected ragfairOfferService: RagfairOfferService; protected localeService: LocaleService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see * @param searchRequest diff --git a/TypeScript/1LogToConsole/types/helpers/RagfairServerHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RagfairServerHelper.d.ts index bfe6cc3..3d73605 100644 --- a/TypeScript/1LogToConsole/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RagfairServerHelper.d.ts @@ -8,41 +8,67 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocaleService } from "../services/LocaleService"; +import { MailSendService } from "../services/MailSendService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { DialogueHelper } from "./DialogueHelper"; import { ItemHelper } from "./ItemHelper"; import { ProfileHelper } from "./ProfileHelper"; +import { TraderHelper } from "./TraderHelper"; /** * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localeService: LocaleService; protected dialogueHelper: DialogueHelper; + protected traderHelper: TraderHelper; protected jsonUtil: JsonUtil; + protected mailSendService: MailSendService; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails * @returns boolean */ isItemValidRagfairItem(itemDetails: [boolean, ITemplateItem]): boolean; - protected isItemBlacklisted(itemTemplateId: string): boolean; - isTrader(userID: string): boolean; - isPlayer(userID: string): boolean; - returnItems(sessionID: string, items: Item[]): void; + /** + * Is supplied item tpl on the ragfair custom blacklist from configs/ragfair.json/dynamic + * @param itemTemplateId Item tpl to check is blacklisted + * @returns True if its blacklsited + */ + protected isItemOnCustomFleaBlacklist(itemTemplateId: string): boolean; + /** + * is supplied id a trader + * @param traderId + * @returns True if id was a trader + */ + isTrader(traderId: string): boolean; + /** + * Is this user id the logged in player + * @param userId Id to test + * @returns True is the current player + */ + isPlayer(userId: string): boolean; + /** + * Send items back to player + * @param sessionID Player to send items to + * @param returnedItems Items to send to player + */ + returnItems(sessionID: string, returnedItems: Item[]): void; calculateDynamicStackCount(tplId: string, isWeaponPreset: boolean): number; /** * Choose a currency at random with bias diff --git a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts index bef1511..4157c1c 100644 --- a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -106,4 +107,10 @@ export declare class TraderHelper { * @returns Rouble price */ getHighestSellToTraderPrice(tpl: string): number; + /** + * Get a trader enum key by its value + * @param traderId Traders id + * @returns Traders key + */ + getTraderById(traderId: string): Traders; } diff --git a/TypeScript/1LogToConsole/types/loaders/PreAkiModLoader.d.ts b/TypeScript/1LogToConsole/types/loaders/PreAkiModLoader.d.ts index 1949696..a67f1c9 100644 --- a/TypeScript/1LogToConsole/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/1LogToConsole/types/loaders/PreAkiModLoader.d.ts @@ -36,8 +36,8 @@ export declare class PreAkiModLoader implements IModLoader { getModPath(mod: string): string; protected importMods(): Promise; /** - * Check for duplciate mods loaded, show error if duplicate mod found - * @param modPackageData dictionary of mod package.json data + * Check for duplicate mods loaded, show error if any + * @param modPackageData Dictionary of mod package.json data */ protected checkForDuplicateMods(modPackageData: Record): void; /** diff --git a/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts index 19321db..1d3c754 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts @@ -661,7 +661,7 @@ export interface ICategories { kd: boolean; surviveRatio: boolean; avgEarnings: boolean; - kills: boolean; + pmcKills: boolean; raidCount: boolean; longestShot: boolean; timeOnline: boolean; diff --git a/TypeScript/1LogToConsole/types/models/eft/common/ILocationBase.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/ILocationBase.d.ts index c94f30e..f064225 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/ILocationBase.d.ts @@ -37,6 +37,7 @@ export interface ILocationBase { IsSecret: boolean; Locked: boolean; Loot: any[]; + MatchMakerMinPlayersByWaitTime: MinPlayerWaitTime[]; MaxBotPerZone: number; MaxDistToFreePoint: number; MaxPlayers: number; @@ -51,6 +52,7 @@ export interface ILocationBase { OldSpawn: boolean; OpenZones: string; Preview: Preview; + PlayersRequestCount: number; RequiredPlayerLevel?: number; RequiredPlayerLevelMin?: number; RequiredPlayerLevelMax?: number; @@ -143,6 +145,10 @@ export interface BotLocationModifier { export interface MinMaxBot extends MinMax { WildSpawnType: WildSpawnType | string; } +export interface MinPlayerWaitTime { + minPlayers: number; + time: number; +} export interface Preview { path: string; rcid: string; diff --git a/TypeScript/1LogToConsole/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/1LogToConsole/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index f8d700c..c558a41 100644 --- a/TypeScript/1LogToConsole/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -1,16 +1,6 @@ -import { MemberCategory } from "../../enums/MemberCategory"; +import { IUserDialogInfo } from "../profile/IAkiProfile"; export interface IGetFriendListDataResponse { - Friends: Friend[]; + Friends: IUserDialogInfo[]; Ignore: string[]; InIgnoreList: string[]; } -export interface Friend { - _id: string; - Info: Info; -} -export interface Info { - Nickname: string; - Side: string; - Level: number; - MemberCategory: MemberCategory; -} diff --git a/TypeScript/1LogToConsole/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index 6930261..0b6f091 100644 --- a/TypeScript/1LogToConsole/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,7 +1,8 @@ +import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; import { IPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; export interface ISaveProgressRequestData { - exit: string; + exit: PlayerRaidEndState; profile: IPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; diff --git a/TypeScript/1LogToConsole/types/models/eft/inventory/IAddItemTempObject.d.ts b/TypeScript/1LogToConsole/types/models/eft/inventory/IAddItemTempObject.d.ts index 62d4b64..12535ed 100644 --- a/TypeScript/1LogToConsole/types/models/eft/inventory/IAddItemTempObject.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/inventory/IAddItemTempObject.d.ts @@ -4,4 +4,5 @@ export interface IAddItemTempObject { count: number; isPreset: boolean; location?: Location; + containerId?: string; } diff --git a/TypeScript/1LogToConsole/types/models/eft/notifier/INotifier.d.ts b/TypeScript/1LogToConsole/types/models/eft/notifier/INotifier.d.ts index bdb021a..ce25dee 100644 --- a/TypeScript/1LogToConsole/types/models/eft/notifier/INotifier.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/notifier/INotifier.d.ts @@ -7,8 +7,13 @@ export interface INotifierChannel { ws: string; } export interface INotification { - type: "RagfairOfferSold" | "new_message" | "ping"; + type: NotificationType; eventId: string; dialogId?: string; message?: Message; } +export declare enum NotificationType { + RAGFAIR_OFFER_SOLD = "RagfairOfferSold", + NEW_MESSAGE = "new_message", + PING = "ping" +} diff --git a/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts index 466dd36..d08da6e 100644 --- a/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts @@ -62,7 +62,7 @@ export interface DialogueInfo { _id: string; type: MessageType; pinned: boolean; - Users?: any[]; + Users?: IUserDialogInfo[]; message: MessagePreview; } export interface Message { @@ -76,7 +76,7 @@ export interface Message { text?: string; hasRewards: boolean; rewardCollected: boolean; - items: MessageItems; + items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; profileChangeEvents?: any[]; @@ -116,6 +116,7 @@ export interface DateTime { export interface Aki { version: string; mods?: ModDetails[]; + receivedGifts: ReceivedGift[]; } export interface ModDetails { name: string; @@ -123,6 +124,10 @@ export interface ModDetails { author: string; dateAdded: number; } +export interface ReceivedGift { + giftId: string; + timestampAccepted: number; +} export interface Vitality { health: Health; effects: Effects; diff --git a/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts b/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts index 0551c56..cd7f5cd 100644 --- a/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts @@ -34,6 +34,7 @@ export declare enum BaseClasses { MAP = "567849dd4bdc2d150f8b456e", MONEY = "543be5dd4bdc2deb348b4569", NIGHTVISION = "5a2c3a9486f774688b05e574", + THERMAL_VISION = "5d21f59b6dbe99052b54ef83", KEY = "543be5e94bdc2df1348b4568", KEY_MECHANICAL = "5c99f98d86f7745c314214b3", KEYCARD = "5c164d2286f774194c5e69fa", @@ -91,5 +92,10 @@ export declare enum BaseClasses { SILENCER = "550aa4cd4bdc2dd8348b456c", PORTABLE_RANGE_FINDER = "61605ddea09d851a0a0c1bbc", ITEM = "54009119af1c881c07000029", - CYLINDER_MAGAZINE = "610720f290b75a49ff2e5e25" + CYLINDER_MAGAZINE = "610720f290b75a49ff2e5e25", + AUXILARY_MOD = "5a74651486f7744e73386dd1", + BIPOD = "55818afb4bdc2dde698b456d", + HEADPHONES = "5645bcb74bdc2ded0b8b4578", + RANDOM_LOOT_CONTAINER = "62f109593b54472778797866", + STACKABLE_ITEM = "5661632d4bdc2d903d8b456b" } diff --git a/TypeScript/1LogToConsole/types/models/enums/ConfigTypes.d.ts b/TypeScript/1LogToConsole/types/models/enums/ConfigTypes.d.ts index 2fe01c6..e01425c 100644 --- a/TypeScript/1LogToConsole/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/ConfigTypes.d.ts @@ -21,5 +21,6 @@ export declare enum ConfigTypes { TRADER = "aki-trader", WEATHER = "aki-weather", SEASONAL_EVENT = "aki-seasonalevents", - LOST_ON_DEATH = "aki-lostondeath" + LOST_ON_DEATH = "aki-lostondeath", + GIFTS = "aki-gifts" } diff --git a/TypeScript/1LogToConsole/types/models/enums/GiftSenderType.d.ts b/TypeScript/1LogToConsole/types/models/enums/GiftSenderType.d.ts new file mode 100644 index 0000000..fc695c8 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/enums/GiftSenderType.d.ts @@ -0,0 +1,5 @@ +export declare enum GiftSenderType { + SYSTEM = "System", + TRADER = "Trader", + USER = "User" +} diff --git a/TypeScript/1LogToConsole/types/models/enums/GiftSentResult.d.ts b/TypeScript/1LogToConsole/types/models/enums/GiftSentResult.d.ts new file mode 100644 index 0000000..08930c1 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/enums/GiftSentResult.d.ts @@ -0,0 +1,6 @@ +export declare enum GiftSentResult { + FAILED_UNKNOWN = 1, + FAILED_GIFT_ALREADY_RECEIVED = 2, + FAILED_GIFT_DOESNT_EXIST = 3, + SUCCESS = 4 +} diff --git a/TypeScript/1LogToConsole/types/models/enums/PlayerRaidEndState.d.ts b/TypeScript/1LogToConsole/types/models/enums/PlayerRaidEndState.d.ts new file mode 100644 index 0000000..d792259 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/enums/PlayerRaidEndState.d.ts @@ -0,0 +1,7 @@ +export declare enum PlayerRaidEndState { + SURVIVED = "survived", + LEFT = "left", + RUNNER = "runner", + MISSING_IN_ACTION = "missinginaction", + KILLED = "killed" +} diff --git a/TypeScript/1LogToConsole/types/models/enums/SeasonalEventType.d.ts b/TypeScript/1LogToConsole/types/models/enums/SeasonalEventType.d.ts index 03aa557..d7cf037 100644 --- a/TypeScript/1LogToConsole/types/models/enums/SeasonalEventType.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/SeasonalEventType.d.ts @@ -1,5 +1,7 @@ export declare enum SeasonalEventType { NONE = "None", CHRISTMAS = "Christmas", - HALLOWEEN = "Halloween" + HALLOWEEN = "Halloween", + NEW_YEARS = "NewYears", + PROMO = "Promo" } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IGiftsConfig.d.ts new file mode 100644 index 0000000..37a132d --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/spt/config/IGiftsConfig.d.ts @@ -0,0 +1,28 @@ +import { Item } from "../../../models/eft/common/tables/IItem"; +import { IUserDialogInfo } from "../../../models/eft/profile/IAkiProfile"; +import { GiftSenderType } from "../../../models/enums/GiftSenderType"; +import { SeasonalEventType } from "../../../models/enums/SeasonalEventType"; +import { Traders } from "../../../models/enums/Traders"; +import { IBaseConfig } from "./IBaseConfig"; +export interface IGiftsConfig extends IBaseConfig { + kind: "aki-gifts"; + gifts: Record; +} +export interface Gift { + /** Items to send to player */ + items: Item[]; + /** Who is sending the gift to player */ + sender: GiftSenderType; + /** Optinal - supply a users id to send from, not necessary when sending from SYSTEM or TRADER */ + senderId?: string; + senderDetails: IUserDialogInfo; + /** Optional - supply a trader type to send from, not necessary when sending from SYSTEM or USER */ + trader?: Traders; + messageText: string; + /** Optional - if sending text from the client locale file */ + localeTextId?: string; + /** Optional - Used by Seasonal events to send on specific day */ + timestampToSend?: number; + associatedEvent: SeasonalEventType; + collectionTimeHours: number; +} diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts index 145f98f..be6ab91 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts @@ -24,8 +24,12 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: MinMax; presetMaxDurabilityPercentMinMax: MinMax; + /** Key: item tpl */ + itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Block seasonal items from appearing when season is inactive */ + blacklistSeasonalItems: boolean; blacklist: string[]; } export interface DiscountOptions { diff --git a/TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts new file mode 100644 index 0000000..2f09733 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -0,0 +1,30 @@ +import { Item } from "../../../models/eft/common/tables/IItem"; +import { ISystemData, IUserDialogInfo, MessageContentRagfair } from "../../../models/eft/profile/IAkiProfile"; +import { MessageType } from "../../../models/enums/MessageType"; +import { Traders } from "../../../models/enums/Traders"; +export interface ISendMessageDetails { + /** Player id */ + recipientId: string; + /** Who is sending this message */ + sender: MessageType; + /** Optional - leave blank to use sender value */ + dialogType?: MessageType; + /** Optional - if sender is USER these details are used */ + senderDetails?: IUserDialogInfo; + /** Optional - the trader sending the message */ + trader?: Traders; + /** Optional - used in player/system messages, otherwise templateId is used */ + messageText?: string; + /** Optinal - Items to send to player */ + items?: Item[]; + /** Optional - How long items will be stored in mail before expiry */ + itemsMaxStorageLifetimeSeconds?: number; + /** Optional - Used when sending messages from traders who send text from locale json */ + templateId?: string; + /** Optional - ragfair related */ + systemData?: ISystemData; + /** Optional - Used by ragfair messages */ + ragfairDetails?: MessageContentRagfair; + /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ + profileChangeEvents?: any[]; +} diff --git a/TypeScript/1LogToConsole/types/servers/http/AkiHttpListener.d.ts b/TypeScript/1LogToConsole/types/servers/http/AkiHttpListener.d.ts index d02861e..c72e18f 100644 --- a/TypeScript/1LogToConsole/types/servers/http/AkiHttpListener.d.ts +++ b/TypeScript/1LogToConsole/types/servers/http/AkiHttpListener.d.ts @@ -24,7 +24,7 @@ export declare class AkiHttpListener implements IHttpListener { handle(sessionId: string, req: IncomingMessage, resp: ServerResponse): void; sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void; getResponse(sessionID: string, req: IncomingMessage, body: Buffer): string; - protected getBodyInfo(body: Buffer): any; + protected getBodyInfo(body: Buffer, requestUrl?: any): any; sendJson(resp: ServerResponse, output: string, sessionID: string): void; sendZlibJson(resp: ServerResponse, output: string, sessionID: string): void; } diff --git a/TypeScript/1LogToConsole/types/services/BotEquipmentModPoolService.d.ts b/TypeScript/1LogToConsole/types/services/BotEquipmentModPoolService.d.ts index adf59ff..b81ff01 100644 --- a/TypeScript/1LogToConsole/types/services/BotEquipmentModPoolService.d.ts +++ b/TypeScript/1LogToConsole/types/services/BotEquipmentModPoolService.d.ts @@ -6,19 +6,21 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { VFS } from "../utils/VFS"; +import { LocalisationService } from "./LocalisationService"; /** Store a mapping between weapons, their slots and the items that fit those slots */ export declare class BotEquipmentModPoolService { protected logger: ILogger; protected vfs: VFS; protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected weaponModPool: Mods; protected gearModPool: Mods; protected weaponPoolGenerated: boolean; protected armorPoolGenerated: boolean; - constructor(logger: ILogger, vfs: VFS, itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, vfs: VFS, itemHelper: ItemHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); /** * Store dictionary of mods for each item passed in * @param items items to find related mods and store in modPool diff --git a/TypeScript/1LogToConsole/types/services/FenceService.d.ts b/TypeScript/1LogToConsole/types/services/FenceService.d.ts index f5a6d76..3f0e01b 100644 --- a/TypeScript/1LogToConsole/types/services/FenceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/FenceService.d.ts @@ -139,6 +139,12 @@ export declare class FenceService { current: number; max: number; }>, loyaltyLevel: number): void; + /** + * Get stack size ofr a singular item (no mods) + * @param itemDbDetails item being added to fence + * @returns Stack size + */ + protected getSingleItemStackCount(itemDbDetails: ITemplateItem): number; /** * Add preset weapons to fence presets * @param assortCount how many assorts to add to assorts diff --git a/TypeScript/1LogToConsole/types/services/GiftService.d.ts b/TypeScript/1LogToConsole/types/services/GiftService.d.ts new file mode 100644 index 0000000..163635e --- /dev/null +++ b/TypeScript/1LogToConsole/types/services/GiftService.d.ts @@ -0,0 +1,50 @@ +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { GiftSentResult } from "../models/enums/GiftSentResult"; +import { MessageType } from "../models/enums/MessageType"; +import { Gift, IGiftsConfig } from "../models/spt/config/IGiftsConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { HashUtil } from "../utils/HashUtil"; +import { TimeUtil } from "../utils/TimeUtil"; +import { MailSendService } from "./MailSendService"; +export declare class GiftService { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected hashUtil: HashUtil; + protected timeUtil: TimeUtil; + protected profileHelper: ProfileHelper; + protected configServer: ConfigServer; + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, mailSendService: MailSendService, hashUtil: HashUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, configServer: ConfigServer); + /** + * Does a gift with a specific ID exist in db + * @param giftId Gift id to check for + * @returns True if it exists in db + */ + giftExists(giftId: string): boolean; + /** + * Send player a gift from a range of sources + * @param playerId Player to send gift to / sessionId + * @param giftId Id of gift in configs/gifts.json to send player + * @returns outcome of sending gift to player + */ + sendGiftToPlayer(playerId: string, giftId: string): GiftSentResult; + /** + * Get sender id based on gifts sender type enum + * @param giftData Gift to send player + * @returns trader/user/system id + */ + protected getSenderId(giftData: Gift): string; + /** + * Convert GiftSenderType into a dialog MessageType + * @param giftData Gift to send player + * @returns MessageType enum value + */ + protected getMessageType(giftData: Gift): MessageType; + /** + * Prapor sends gifts to player for first week after profile creation + * @param sessionId Player id + * @param day What day to give gift for + */ + sendPraporStartingGift(sessionId: string, day: number): void; +} diff --git a/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts b/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts index 32fffba..1d30f6d 100644 --- a/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts @@ -1,6 +1,7 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -22,6 +23,7 @@ export declare class InsuranceService { protected databaseServer: DatabaseServer; protected secureContainerHelper: SecureContainerHelper; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected traderHelper: TraderHelper; @@ -33,23 +35,25 @@ export declare class InsuranceService { protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; - insuranceTraderArrayExists(sessionId: string, traderId: string): boolean; + /** + * Get all insured items by all traders for a profile + * @param sessionId Profile id (session id) + * @returns Item array + */ getInsurance(sessionId: string): Record; + /** + * Get insured items by profile id + trader id + * @param sessionId Profile id (session id) + * @param traderId Trader items were insured with + * @returns Item array + */ getInsuranceItems(sessionId: string, traderId: string): Item[]; resetInsurance(sessionId: string): void; - resetInsuranceTraderArray(sessionId: string, traderId: string): void; - addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - /** - * Get the rouble price for an item by templateId - * @param itemTpl item tpl to get handbook price for - * @returns handbook price in roubles, Return 0 if not found - */ - getItemPrice(itemTpl: string): number; /** * Sends stored insured items as message to player - * @param pmcData profile to modify + * @param pmcData profile to send insured items to * @param sessionID SessionId of current player * @param mapId Id of the map player died/exited that caused the insurance to be issued on */ @@ -59,11 +63,17 @@ export declare class InsuranceService { * @param sessionID Session id */ sendLostInsuranceMessage(sessionID: string): void; + /** + * Check all root insured items and remove location property + set slotId to 'hideout' + * @param sessionId Session id + * @param traderId Trader id + */ protected removeLocationProperty(sessionId: string, traderId: string): void; /** - * Get a timestamp of what insurance items should be sent to player based on the type of trader used to insure + * Get a timestamp of when insurance items should be sent to player based on trader used to insure + * Apply insurance return bonus if found in profile * @param pmcData Player profile - * @param trader Trader used to insure items + * @param trader Trader base used to insure items * @returns Timestamp to return items to player in seconds */ protected getInsuranceReturnTimestamp(pmcData: IPmcData, trader: ITraderBase): number; @@ -90,5 +100,32 @@ export declare class InsuranceService { * @param sessionID Session id */ protected addGearToSend(pmcData: IPmcData, insuredItem: InsuredItem, actualItem: Item, sessionID: string): void; + /** + * Does insurance exist for a player and by trader + * @param sessionId Player id (session id) + * @param traderId Trader items insured with + * @returns True if exists + */ + protected insuranceTraderArrayExists(sessionId: string, traderId: string): boolean; + /** + * Empty out array holding insured items by sessionid + traderid + * @param sessionId Player id (session id) + * @param traderId Trader items insured with + */ + resetInsuranceTraderArray(sessionId: string, traderId: string): void; + /** + * Store insured item + * @param sessionId Player id (session id) + * @param traderId Trader item insured with + * @param itemToAdd Insured item + */ + addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: Item): void; + /** + * Get price of insurance * multiplier from config + * @param pmcData Player profile + * @param inventoryItem Item to be insured + * @param traderId Trader item is insured with + * @returns price in roubles + */ getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; } diff --git a/TypeScript/1LogToConsole/types/services/MailSendService.d.ts b/TypeScript/1LogToConsole/types/services/MailSendService.d.ts new file mode 100644 index 0000000..70b8e44 --- /dev/null +++ b/TypeScript/1LogToConsole/types/services/MailSendService.d.ts @@ -0,0 +1,111 @@ +import { ItemHelper } from "../helpers/ItemHelper"; +import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; +import { NotifierHelper } from "../helpers/NotifierHelper"; +import { Item } from "../models/eft/common/tables/IItem"; +import { Dialogue, IUserDialogInfo, Message, MessageItems } from "../models/eft/profile/IAkiProfile"; +import { MessageType } from "../models/enums/MessageType"; +import { Traders } from "../models/enums/Traders"; +import { ISendMessageDetails } from "../models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { SaveServer } from "../servers/SaveServer"; +import { HashUtil } from "../utils/HashUtil"; +import { TimeUtil } from "../utils/TimeUtil"; +import { LocalisationService } from "./LocalisationService"; +export declare class MailSendService { + protected logger: ILogger; + protected hashUtil: HashUtil; + protected timeUtil: TimeUtil; + protected saveServer: SaveServer; + protected databaseServer: DatabaseServer; + protected notifierHelper: NotifierHelper; + protected notificationSendHelper: NotificationSendHelper; + protected localisationService: LocalisationService; + protected itemHelper: ItemHelper; + protected readonly systemSenderId = "59e7125688a45068a6249071"; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + /** + * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale + * @param playerId Players id to send message to + * @param sender The trader sending the message + * @param messageType What type the message will assume (e.g. QUEST_SUCCESS) + * @param message Text to send to the player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendDirectNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from an NPC (e.g. prapor) to the player with or without items + * @param playerId Players id to send message to + * @param sender The trader sending the message + * @param messageType What type the message will assume (e.g. QUEST_SUCCESS) + * @param messageLocaleId The localised text to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items + * @param playerId Players id to send message to + * @param message The text to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a USER message to a player with or without items + * @param playerId Players id to send message to + * @param senderId Who is sending the message + * @param message The text to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendUserMessageToPlayer(playerId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) + * Helper functions in this class are availble to simplify common actions + * @param messageDetails Details needed to send a message to the player + */ + sendMessageToPlayer(messageDetails: ISendMessageDetails): void; + /** + * Send a message from the player to an NPC + * @param sessionId Player id + * @param targetNpcId NPC message is sent to + * @param message Text to send to NPC + */ + sendPlayerMessageToNpc(sessionId: string, targetNpcId: string, message: string): void; + /** + * Create a message for storage inside a dialog in the player profile + * @param senderDialog Id of dialog that will hold the message + * @param messageDetails Various details on what the message must contain/do + * @returns Message + */ + protected createDialogMessage(dialogId: string, messageDetails: ISendMessageDetails): Message; + /** + * Add items to message and adjust various properties to reflect the items being added + * @param message Message to add items to + * @param itemsToSendToPlayer Items to add to message + * @param maxStorageTimeSeconds total time items are stored in mail before being deleted + */ + protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems, maxStorageTimeSeconds: number): void; + /** + * perform various sanitising actions on the items before they're considered ready for insertion into message + * @param dialogType The type of the dialog that will hold the reward items being processed + * @param messageDetails + * @returns Sanitised items + */ + protected processItemsBeforeAddingToMail(dialogType: MessageType, messageDetails: ISendMessageDetails): MessageItems; + /** + * Get a dialog with a specified entity (user/trader) + * Create and store empty dialog if none exists in profile + * @param messageDetails Data on what message should do + * @returns Relevant Dialogue + */ + protected getDialog(messageDetails: ISendMessageDetails): Dialogue; + /** + * Get the appropriate sender id by the sender enum type + * @param messageDetails + * @returns gets an id of the individual sending it + */ + protected getMessageSenderIdByType(messageDetails: ISendMessageDetails): string; +} diff --git a/TypeScript/1LogToConsole/types/services/MatchBotDetailsCacheService.d.ts b/TypeScript/1LogToConsole/types/services/MatchBotDetailsCacheService.d.ts index 757f61f..eb365dd 100644 --- a/TypeScript/1LogToConsole/types/services/MatchBotDetailsCacheService.d.ts +++ b/TypeScript/1LogToConsole/types/services/MatchBotDetailsCacheService.d.ts @@ -1,10 +1,12 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { ILogger } from "../models/spt/utils/ILogger"; +import { LocalisationService } from "./LocalisationService"; /** Cache bots in a dictionary, keyed by the bots name, keying by name isnt idea as its not unique but this is used by the post-raid system which doesnt have any bot ids, only name */ export declare class MatchBotDetailsCacheService { protected logger: ILogger; + protected localisationService: LocalisationService; protected botDetailsCache: Record; - constructor(logger: ILogger); + constructor(logger: ILogger, localisationService: LocalisationService); /** * Store a bot in the cache, keyed by its name * @param botToCache Bot details to cache diff --git a/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts b/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts index 0af14a4..e245efa 100644 --- a/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts @@ -12,6 +12,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; +import { LocalisationService } from "./LocalisationService"; /** * Stores flea prices for items as well as methods to interact with them */ @@ -23,12 +24,13 @@ export declare class RagfairPriceService implements OnLoad { protected presetHelper: PresetHelper; protected traderHelper: TraderHelper; protected randomUtil: RandomUtil; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected generatedDynamicPrices: boolean; protected generatedStaticPrices: boolean; protected prices: IRagfairServerPrices; - constructor(handbookHelper: HandbookHelper, databaseServer: DatabaseServer, logger: ILogger, itemHelper: ItemHelper, presetHelper: PresetHelper, traderHelper: TraderHelper, randomUtil: RandomUtil, configServer: ConfigServer); + constructor(handbookHelper: HandbookHelper, databaseServer: DatabaseServer, logger: ILogger, itemHelper: ItemHelper, presetHelper: PresetHelper, traderHelper: TraderHelper, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate static (handbook) and dynamic (prices.json) flea prices, store inside class as dictionaries */ @@ -111,7 +113,7 @@ export declare class RagfairPriceService implements OnLoad { * @param item base weapon * @param items weapon plus mods * @param existingPrice price of existing base weapon - * @returns + * @returns price of weapon in roubles */ protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** diff --git a/TypeScript/1LogToConsole/types/services/RepairService.d.ts b/TypeScript/1LogToConsole/types/services/RepairService.d.ts index a3c6c7a..2f7d1db 100644 --- a/TypeScript/1LogToConsole/types/services/RepairService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RepairService.d.ts @@ -14,6 +14,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; +import { LocalisationService } from "./LocalisationService"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; @@ -25,9 +26,10 @@ export declare class RepairService { protected weightedRandomHelper: WeightedRandomHelper; protected paymentService: PaymentService; protected repairHelper: RepairHelper; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts b/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts index 0475c5c..9fb3454 100644 --- a/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts +++ b/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { IConfig } from "../models/eft/common/IGlobals"; import { Inventory } from "../models/eft/common/tables/IBotType"; import { SeasonalEventType } from "../models/enums/SeasonalEventType"; @@ -9,18 +10,21 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseImporter } from "../utils/DatabaseImporter"; +import { GiftService } from "./GiftService"; import { LocalisationService } from "./LocalisationService"; export declare class SeasonalEventService { protected logger: ILogger; protected databaseServer: DatabaseServer; protected databaseImporter: DatabaseImporter; + protected giftService: GiftService; protected localisationService: LocalisationService; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected seasonalEventConfig: ISeasonalEventConfig; protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; /** @@ -48,7 +52,7 @@ export declare class SeasonalEventService { */ getAllSeasonalEventItems(): string[]; /** - * Get an array of seasonal items that should be blocked as seasonal is not active + * Get an array of seasonal items that should be blocked as season is not currently active * @returns Array of tpl strings */ getSeasonalEventItemsToBlock(): string[]; @@ -92,8 +96,9 @@ export declare class SeasonalEventService { isQuestRelatedToEvent(questId: string, event: SeasonalEventType): boolean; /** * Check if current date falls inside any of the seasons events pased in, if so, handle them + * @param sessionId Players id */ - checkForAndEnableSeasonalEvents(): void; + checkForAndEnableSeasonalEvents(sessionId: string): void; /** * Iterate through bots inventory and loot to find and remove christmas items (as defined in SeasonalEventService) * @param nodeInventory Bots inventory to iterate over @@ -102,10 +107,11 @@ export declare class SeasonalEventService { removeChristmasItemsFromBotInventory(nodeInventory: Inventory, botRole: string): void; /** * Make adjusted to server code based on the name of the event passed in + * @param sessionId Player id * @param globalConfig globals.json * @param eventName Name of the event to enable. e.g. Christmas */ - protected updateGlobalEvents(globalConfig: IConfig, eventType: SeasonalEventType): void; + protected updateGlobalEvents(sessionId: string, globalConfig: IConfig, eventType: SeasonalEventType): void; /** * Change trader icons to be more event themed (Halloween only so far) * @param eventType What event is active @@ -129,4 +135,10 @@ export declare class SeasonalEventService { * Add santa to maps */ protected addGifterBotToMaps(): void; + /** + * Send gift to player if they'e not already received it + * @param playerId Player to send gift to + * @param giftkey Key of gift to give + */ + protected giveGift(playerId: string, giftkey: string): void; } diff --git a/TypeScript/1LogToConsole/types/services/TraderPurchasePersisterService.d.ts b/TypeScript/1LogToConsole/types/services/TraderPurchasePersisterService.d.ts index 7e7c88f..25b02ad 100644 --- a/TypeScript/1LogToConsole/types/services/TraderPurchasePersisterService.d.ts +++ b/TypeScript/1LogToConsole/types/services/TraderPurchasePersisterService.d.ts @@ -4,6 +4,7 @@ import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { TimeUtil } from "../utils/TimeUtil"; +import { LocalisationService } from "./LocalisationService"; /** * Help with storing limited item purchases from traders in profile to persist them over server restarts */ @@ -11,9 +12,10 @@ export declare class TraderPurchasePersisterService { protected logger: ILogger; protected timeUtil: TimeUtil; protected profileHelper: ProfileHelper; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, profileHelper: ProfileHelper, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Get the purchases made from a trader for this profile before the last trader reset * @param sessionId Session id