diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts index cfb1c16..04566ff 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts @@ -1,6 +1,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -18,7 +19,7 @@ export declare class DataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts index 06da1b5..5e4c240 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts @@ -1,8 +1,10 @@ import { GameController } from "../controllers/GameController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; @@ -17,8 +19,8 @@ declare class GameCallbacks { gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData; - getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/CustomizationController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/CustomizationController.d.ts index a6c4730..5fe51e3 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/CustomizationController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/CustomizationController.d.ts @@ -5,16 +5,16 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; export declare class CustomizationController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); getTraderSuits(traderID: string, sessionID: string): ISuit[]; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts index eec7dc5..3bfbdb1 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts @@ -3,7 +3,9 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { Config } from "../models/eft/common/IGlobals"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; @@ -37,6 +39,6 @@ export declare class GameController { protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; - getServer(): any[]; - getValidGameVersion(): any; + getServer(): IServerDetails[]; + getValidGameVersion(): ICheckVersionResponse; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/HealthController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/HealthController.d.ts index cc13603..ce67993 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/HealthController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/HealthController.d.ts @@ -8,16 +8,16 @@ import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestD import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; export declare class HealthController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile diff --git a/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts index dcd8894..ada5bd9 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts @@ -19,7 +19,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -40,7 +40,7 @@ export declare class HideoutController { protected playerService: PlayerService; protected presetHelper: PresetHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected hideoutHelper: HideoutHelper; @@ -49,7 +49,7 @@ export declare class HideoutController { protected jsonUtil: JsonUtil; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InraidController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InraidController.d.ts index 102a2fb..e84eea1 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InraidController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InraidController.d.ts @@ -8,6 +8,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -31,6 +32,7 @@ export declare class InraidController { protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; + protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; @@ -68,4 +70,5 @@ export declare class InraidController { protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void; + getAirdropConfig(): IAirdropConfig; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts index 6895383..14bf129 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; @@ -30,7 +30,7 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required + constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required insuranceService: InsuranceService, configServer: ConfigServer); processReturn(): void; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts index f564919..6a1a21e 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts @@ -1,3 +1,4 @@ +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { PaymentHelper } from "../helpers/PaymentHelper"; import { PresetHelper } from "../helpers/PresetHelper"; @@ -22,7 +23,6 @@ import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryT import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { RagfairOfferService } from "../services/RagfairOfferService"; @@ -39,8 +39,8 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/10ScopesAndTypes/types/controllers/NoteController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/NoteController.d.ts index ee70541..9e2e250 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/NoteController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/NoteController.d.ts @@ -1,10 +1,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; export declare class NoteController { - protected itemEventRouter: ItemEventRouter; - constructor(itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/PresetBuildController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/PresetBuildController.d.ts index adf4084..65ae0c4 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/PresetBuildController.d.ts @@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; export declare class PresetBuildController { protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); getUserBuilds(sessionID: string): WeaponBuild[]; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts index 282f50e..842207f 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts @@ -11,7 +11,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -20,7 +20,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; @@ -31,7 +31,7 @@ export declare class QuestController { protected localeService: LocaleService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts index fe1f472..5440458 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts @@ -24,7 +24,7 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RagfairServer } from "../servers/RagfairServer"; @@ -42,7 +42,7 @@ export declare class RagfairController { protected logger: ILogger; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; protected databaseServer: DatabaseServer; @@ -64,7 +64,7 @@ export declare class RagfairController { protected ragfairOfferGenerator: RagfairOfferGenerator; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RepairController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RepairController.d.ts index ae54a53..fd8ff72 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RepairController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RepairController.d.ts @@ -7,13 +7,13 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "../services/PaymentService"; import { RepairService } from "../services/RepairService"; export declare class RepairController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -21,7 +21,7 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected repairService: RepairService; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); /** * Repair with trader * @param sessionID session id diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts index 4c31a3d..7db5886 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,7 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ import { ELocationName } from "../models/enums/ELocationName"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -63,13 +63,13 @@ export declare class RepeatableQuestController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected ragfairServerHelper: RagfairServerHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts index c86745c..0ed0556 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts @@ -6,15 +6,15 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; declare class TradeController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/TraderController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/TraderController.d.ts index b79f55e..d7afe95 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/TraderController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/TraderController.d.ts @@ -1,3 +1,4 @@ +import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -17,8 +18,9 @@ export declare class TraderController { protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected fenceService: FenceService; + protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService diff --git a/TypeScript/10ScopesAndTypes/types/controllers/WishlistController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/WishlistController.d.ts index a96c522..83be4b3 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/WishlistController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/WishlistController.d.ts @@ -1,10 +1,10 @@ -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistController { - protected itemEvenRouter: ItemEventRouter; - constructor(itemEvenRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/10ScopesAndTypes/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/FenceBaseAssortGenerator.d.ts new file mode 100644 index 0000000..387df3a --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/generators/FenceBaseAssortGenerator.d.ts @@ -0,0 +1,28 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemFilterService } from "../services/ItemFilterService"; +export declare class FenceBaseAssortGenerator { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemHelper: ItemHelper; + protected itemFilterService: ItemFilterService; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + /** + * Create base fence assorts dynamically and store in db + */ + generateFenceBaseAssorts(): void; + /** + * Check if item is valid for being added to fence assorts + * @param item Item to check + * @returns true if valid fence item + */ + protected isValidFenceItem(item: ITemplateItem): boolean; +} diff --git a/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts index 66056c2..bc0d7ec 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts @@ -17,8 +17,8 @@ export declare class LootGenerator { protected itemFilterService: ItemFilterService; constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); /** - * Generate a list of items based on options passed in - * @param options parameters to adjust what loot is generated + * Generate a list of items based on configuration options parameter + * @param options parameters to adjust how loot is generated * @returns An array of loot items */ createRandomloot(options: LootRequest): LootItem[]; @@ -44,7 +44,13 @@ export declare class LootGenerator { max: number; }>, options: LootRequest, result: LootItem[]): boolean; /** - * + * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values + * @param item item to get stack count of + * @param options loot options + * @returns stack count + */ + protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + /** * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts diff --git a/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts index 0dc2d61..b64a7e7 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Get avatar url from trader table in db + * @param isTrader Is user we're getting avatar for a trader + * @param userId persons id to get avatar of + * @returns url of avatar + */ + protected getAvatarUrl(isTrader: boolean, userId: string): string; /** * Convert a count of currency into roubles * @param currencyCount amount of currency to convert into roubles diff --git a/TypeScript/10ScopesAndTypes/types/helpers/DialogueHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/DialogueHelper.d.ts index d2be04d..88a726e 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/DialogueHelper.d.ts @@ -1,6 +1,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; @@ -8,13 +9,14 @@ import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotifierHelper } from "./NotifierHelper"; export declare class DialogueHelper { + protected logger: ILogger; protected hashUtil: HashUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; protected itemHelper: ItemHelper; - constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. @@ -23,7 +25,7 @@ export declare class DialogueHelper { * @param sessionID * @param rewards */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HandbookHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HandbookHelper.d.ts index b47d466..1ab7800 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { DatabaseServer } from "../servers/DatabaseServer"; declare class LookupItem { byId: Record; byParent: Record; @@ -9,17 +10,35 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected lookup: LookupCollection; - hydrateLookup(lookup: LookupCollection): void; - getTemplatePrice(x: string): number; + protected databaseServer: DatabaseServer; + protected handbookPriceCache: LookupCollection; + constructor(databaseServer: DatabaseServer); + hydrateLookup(): void; + /** + * Get price from internal cache, if cache empty look up price directly in handbook (expensive) + * If no values found, return 1 + * @param tpl item tpl to look up price for + * @returns price in roubles + */ + getTemplatePrice(tpl: string): number; + /** + * all items in template with the given parent category + * @param x + * @returns string array + */ templatesWithParent(x: string): string[]; - isCategory(x: string): boolean; + /** + * Does category exist in handbook cache + * @param category + * @returns true if exists in cache + */ + isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Gets Currency to Ruble conversion Value + * Convert currency into roubles * @param {number} value * @param {string} currencyFrom - * @returns number + * @returns get rouble value of inputted currency */ inRUB(value: number, currencyFrom: string): number; /** diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts index 7495a6a..5f7e3b7 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts @@ -8,7 +8,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PlayerService } from "../services/PlayerService"; @@ -24,7 +24,7 @@ export declare class HideoutHelper { protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; @@ -35,7 +35,7 @@ export declare class HideoutHelper { static bitcoin: string; static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * This convinience function intialies new Production Object diff --git a/TypeScript/10ScopesAndTypes/types/helpers/NotificationSendHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/NotificationSendHelper.d.ts index 6c56006..014ac95 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/NotificationSendHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { HttpServer } from "../servers/HttpServer"; +import { WebSocketServer } from "../servers/WebSocketServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: HttpServer; + protected webSocketServer: WebSocketServer; protected notificationService: NotificationService; - constructor(httpServer: HttpServer, notificationService: NotificationService); + constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts index d66d150..a6b4892 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -25,7 +25,7 @@ export declare class QuestHelper { protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected ragfairServerHelper: RagfairServerHelper; @@ -35,7 +35,7 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, 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, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search diff --git a/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts index ea13aae..b73f786 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts @@ -6,7 +6,7 @@ import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -27,7 +27,7 @@ export declare class RagfairOfferHelper { protected logger: ILogger; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected traderHelper: TraderHelper; protected saveServer: SaveServer; @@ -45,9 +45,15 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if trader offers' BuyRestrictionMax value has been reached + * @param offer offer to check restriction properties of + * @returns true if restriction reached, false if no restrictions/not reached + */ + protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; /** * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check diff --git a/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts index 7ab9768..2a8f0b7 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts @@ -7,20 +7,20 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; export declare class TradeHelper { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); /** * Buy item from flea or trader * @param pmcData diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts index a349a6d..c5b1cb2 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,5 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -47,7 +48,7 @@ export interface AvailableForProps { compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; - status?: number[]; + status?: QuestStatus[]; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; @@ -99,7 +100,7 @@ export interface Rewards { FailRestartable: Reward[]; Expired: Reward[]; } -export interface Reward { +export interface Reward extends Item { value?: string | number; id: string; type: QuestRewardType; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 1d0c0e8..8a29319 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -2,7 +2,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; Ignore: any[]; - InIgnoreList: any[]; + InIgnoreList: string[]; } export interface Friend { _id: string; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/game/ICheckVersionResponse.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/game/ICheckVersionResponse.d.ts new file mode 100644 index 0000000..fa8aa6f --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/game/ICheckVersionResponse.d.ts @@ -0,0 +1,4 @@ +export interface ICheckVersionResponse { + isvalid: boolean; + latestVersion: string; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/game/IServerDetails.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/game/IServerDetails.d.ts new file mode 100644 index 0000000..101cf99 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/game/IServerDetails.d.ts @@ -0,0 +1,4 @@ +export interface IServerDetails { + ip: string; + port: number; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/profile/GetProfileStatusResponseData.d.ts index eee9b4f..cb7368c 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -4,6 +4,7 @@ export interface GetProfileStatusResponseData { } export interface ProfileData { profileid: string; + profileToken: string; status: string; sid: string; ip: string; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts index eaa66c1..cf28c12 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts @@ -37,12 +37,12 @@ export interface Dialogue { attachmentsNew: number; } export interface DialogueInfo { - _id: string; - type: MessageType; - message: MessagePreview; - pinned: boolean; - new: number; attachmentsNew: number; + new: number; + type: MessageType; + pinned: boolean; + message: MessagePreview; + _id: string; } export interface Message { _id: string; diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/BaseClasses.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/BaseClasses.d.ts index 36ebc71..4eb6f7e 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/BaseClasses.d.ts @@ -1,6 +1,9 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", ARMOR = "5448e54d4bdc2dcc718b4568", + ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", + HEADWEAR = "5a341c4086f77401f2541505", + FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", VISORS = "5448e5724bdc2ddf718b4568", diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IAirdropConfig.d.ts index 3edcbdd..53df991 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IAirdropConfig.d.ts @@ -25,6 +25,6 @@ export interface AirdropLoot { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts index 6b1c1e3..8342c99 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts @@ -17,5 +17,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + itemPriceMult: number; + regenerateAssortsOnRefresh: boolean; + itemTypeLimits: Record; blacklist: string[]; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/services/LootRequest.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/services/LootRequest.d.ts index 1da8770..8c197ee 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/services/LootRequest.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/services/LootRequest.d.ts @@ -6,6 +6,6 @@ export declare class LootRequest { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts b/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts new file mode 100644 index 0000000..7a2387b --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts @@ -0,0 +1,11 @@ +import { JsonUtil } from "../utils/JsonUtil"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +export declare class EventOutputHolder { + protected jsonUtil: JsonUtil; + protected profileHelper: ProfileHelper; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected output: IItemEventRouterResponse; + getOutput(sessionID: string): IItemEventRouterResponse; + resetOutput(sessionID: string): void; +} diff --git a/TypeScript/10ScopesAndTypes/types/routers/ItemEventRouter.d.ts b/TypeScript/10ScopesAndTypes/types/routers/ItemEventRouter.d.ts index b1ac5d9..e80d16c 100644 --- a/TypeScript/10ScopesAndTypes/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/10ScopesAndTypes/types/routers/ItemEventRouter.d.ts @@ -1,17 +1,14 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { ItemEventRouterDefinition } from "../di/Router"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; - protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[]); - protected output: IItemEventRouterResponse; + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; - getOutput(sessionID: string): IItemEventRouterResponse; - protected resetOutput(sessionID: string): void; } diff --git a/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts b/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts index f572a8f..bbca8af 100644 --- a/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts +++ b/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts @@ -1,34 +1,24 @@ /// import http, { IncomingMessage, ServerResponse } from "http"; -import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; -import { NotifierHelper } from "../helpers/NotifierHelper"; -import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; import { IHttpListener } from "./http/IHttpListener"; +import { WebSocketServer } from "./WebSocketServer"; export declare class HttpServer { protected logger: ILogger; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); + protected webSocketServer: WebSocketServer; + constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); protected httpConfig: IHttpConfig; - protected webSockets: {}; - protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - sendMessage(sessionID: string, output: INotification): void; - isConnectionWebSocket(sessionID: string): boolean; handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; - protected getRandomisedMessage(): string; - protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/TypeScript/10ScopesAndTypes/types/servers/WebSocketServer.d.ts b/TypeScript/10ScopesAndTypes/types/servers/WebSocketServer.d.ts new file mode 100644 index 0000000..f33d214 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/servers/WebSocketServer.d.ts @@ -0,0 +1,25 @@ +/// +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import WebSocket from "ws"; +import http, { IncomingMessage } from "http"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { RandomUtil } from "../utils/RandomUtil"; +import { INotification } from "../models/eft/notifier/INotifier"; +import { ConfigServer } from "./ConfigServer"; +import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +export declare class WebSocketServer { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected configServer: ConfigServer; + protected httpServerHelper: HttpServerHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, httpServerHelper: HttpServerHelper); + protected httpConfig: IHttpConfig; + protected defaultNotification: INotification; + protected webSockets: Record; + protected websocketPingHandler: any; + setupWebSocket(httpServer: http.Server): void; + sendMessage(sessionID: string, output: INotification): void; + protected getRandomisedMessage(): string; + isConnectionWebSocket(sessionID: string): boolean; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; +} diff --git a/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts index 23fbf52..bdcdeb2 100644 --- a/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts @@ -3,6 +3,8 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -41,6 +43,13 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item + * @param assort + * @param modifier + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -96,6 +105,21 @@ export declare class FenceService { * @param assorts object to add assorts to */ protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + /** + * Randomise items' upd properties e.g. med packs/weapons/armor + * @param itemDetails Item being randomised + * @param itemToAdjust Item being edited + */ + protected randomiseItemUpdProperties(itemDetails: ITemplateItem, itemToAdjust: Item): void; + /** + * Construct item limit record to hold max and current item count + * @param limits limits as defined in config + * @returns record, key: item tplId, value: current/max item count allowed + */ + protected initItemLimitCounter(limits: Record): Record; /** * Get the next update timestamp for fence * @returns future timestamp diff --git a/TypeScript/10ScopesAndTypes/types/services/ItemFilterService.d.ts b/TypeScript/10ScopesAndTypes/types/services/ItemFilterService.d.ts index c9c8ef3..b830d74 100644 --- a/TypeScript/10ScopesAndTypes/types/services/ItemFilterService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/ItemFilterService.d.ts @@ -2,7 +2,7 @@ import { IItemConfig } from "../models/spt/config/IItemConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */ +/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; protected databaseServer: DatabaseServer; diff --git a/TypeScript/10ScopesAndTypes/types/services/RagfairOfferService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RagfairOfferService.d.ts index f9e3a34..a6f6b6d 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RagfairOfferService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RagfairOfferService.d.ts @@ -5,7 +5,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -20,14 +20,14 @@ export declare class RagfairOfferService { protected ragfairServerHelper: RagfairServerHelper; protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; protected expiredOffers: Item[]; protected offers: IRagfairOffer[]; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts index 466c9e3..4ac7794 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts @@ -10,7 +10,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -export declare class RagfairPriceService { +import { OnLoad } from "../di/OnLoad"; +export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; @@ -19,21 +20,38 @@ export declare class RagfairPriceService { protected randomUtil: RandomUtil; 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, randomUtil: RandomUtil, configServer: ConfigServer); + onLoad(): void; + getRoute(): string; + /** + * Iterate over all items of type "Item" in db and get template price, store in cache + */ generateStaticPrices(): void; - generateDynamicPrices(): void; - hasDynamicPrices(): boolean; - getDynamicPrice(itemTpl: string): number; - getAllFleaPrices(): Record; + protected generateDynamicPrices(): void; + /** + * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * if no static value, return 1 + * @param tplId Item tpl id to get price for + * @returns price in roubles + */ getFleaPriceForItem(tplId: string): number; /** - * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json - * @param itemPrice price of item - * @param itemTpl item template Id being checked - * @returns adjusted price value in roubles + * get the dynamic (flea) price for an item + * Grabs prices from prices.json and stores in class if none currently exist + * @param itemTpl item template id to look up + * @returns price in roubles */ - protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; + getDynamicPriceForItem(itemTpl: string): number; + /** + * Grab the static (handbook) for an item by its tplId + * @param itemTpl item template id to look up + * @returns price in roubles + */ + getStaticPriceForItem(itemTpl: string): number; + getAllFleaPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -41,9 +59,15 @@ export declare class RagfairPriceService { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; - getStaticPriceForItem(tplId: string): number; getBarterPrice(barterScheme: IBarterScheme[]): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; + /** + * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json + * @param itemPrice price of item + * @param itemTpl item template Id being checked + * @returns adjusted price value in roubles + */ + protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; /** * Multiply the price by a randomised curve where n = 2, shift = 2 * @param existingPrice price to alter @@ -58,7 +82,7 @@ export declare class RagfairPriceService { * @param existingPrice price of existing base weapon * @returns */ - getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) diff --git a/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts index 3e6077c..d3f1b35 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts @@ -9,13 +9,11 @@ import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -23,7 +21,7 @@ export declare class RepairService { protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/DataCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/DataCallbacks.d.ts index cfb1c16..04566ff 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/DataCallbacks.d.ts @@ -1,6 +1,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -18,7 +19,7 @@ export declare class DataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts index 06da1b5..5e4c240 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts @@ -1,8 +1,10 @@ import { GameController } from "../controllers/GameController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; @@ -17,8 +19,8 @@ declare class GameCallbacks { gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData; - getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/CustomizationController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/CustomizationController.d.ts index a6c4730..5fe51e3 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/CustomizationController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/CustomizationController.d.ts @@ -5,16 +5,16 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; export declare class CustomizationController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); getTraderSuits(traderID: string, sessionID: string): ISuit[]; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts index eec7dc5..3bfbdb1 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts @@ -3,7 +3,9 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { Config } from "../models/eft/common/IGlobals"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; @@ -37,6 +39,6 @@ export declare class GameController { protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; - getServer(): any[]; - getValidGameVersion(): any; + getServer(): IServerDetails[]; + getValidGameVersion(): ICheckVersionResponse; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/HealthController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/HealthController.d.ts index cc13603..ce67993 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/HealthController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/HealthController.d.ts @@ -8,16 +8,16 @@ import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestD import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; export declare class HealthController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile diff --git a/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts index dcd8894..ada5bd9 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts @@ -19,7 +19,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -40,7 +40,7 @@ export declare class HideoutController { protected playerService: PlayerService; protected presetHelper: PresetHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected hideoutHelper: HideoutHelper; @@ -49,7 +49,7 @@ export declare class HideoutController { protected jsonUtil: JsonUtil; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InraidController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InraidController.d.ts index 102a2fb..e84eea1 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InraidController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InraidController.d.ts @@ -8,6 +8,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -31,6 +32,7 @@ export declare class InraidController { protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; + protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; @@ -68,4 +70,5 @@ export declare class InraidController { protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void; + getAirdropConfig(): IAirdropConfig; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts index 6895383..14bf129 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; @@ -30,7 +30,7 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required + constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required insuranceService: InsuranceService, configServer: ConfigServer); processReturn(): void; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts index f564919..6a1a21e 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts @@ -1,3 +1,4 @@ +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { PaymentHelper } from "../helpers/PaymentHelper"; import { PresetHelper } from "../helpers/PresetHelper"; @@ -22,7 +23,6 @@ import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryT import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { RagfairOfferService } from "../services/RagfairOfferService"; @@ -39,8 +39,8 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/11BundleLoadingSample/types/controllers/NoteController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/NoteController.d.ts index ee70541..9e2e250 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/NoteController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/NoteController.d.ts @@ -1,10 +1,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; export declare class NoteController { - protected itemEventRouter: ItemEventRouter; - constructor(itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/PresetBuildController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/PresetBuildController.d.ts index adf4084..65ae0c4 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/PresetBuildController.d.ts @@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; export declare class PresetBuildController { protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); getUserBuilds(sessionID: string): WeaponBuild[]; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts index 282f50e..842207f 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts @@ -11,7 +11,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -20,7 +20,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; @@ -31,7 +31,7 @@ export declare class QuestController { protected localeService: LocaleService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) diff --git a/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts index fe1f472..5440458 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts @@ -24,7 +24,7 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RagfairServer } from "../servers/RagfairServer"; @@ -42,7 +42,7 @@ export declare class RagfairController { protected logger: ILogger; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; protected databaseServer: DatabaseServer; @@ -64,7 +64,7 @@ export declare class RagfairController { protected ragfairOfferGenerator: RagfairOfferGenerator; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed diff --git a/TypeScript/11BundleLoadingSample/types/controllers/RepairController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/RepairController.d.ts index ae54a53..fd8ff72 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/RepairController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/RepairController.d.ts @@ -7,13 +7,13 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "../services/PaymentService"; import { RepairService } from "../services/RepairService"; export declare class RepairController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -21,7 +21,7 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected repairService: RepairService; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); /** * Repair with trader * @param sessionID session id diff --git a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts index 4c31a3d..7db5886 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,7 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ import { ELocationName } from "../models/enums/ELocationName"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -63,13 +63,13 @@ export declare class RepeatableQuestController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected ragfairServerHelper: RagfairServerHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts index c86745c..0ed0556 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts @@ -6,15 +6,15 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; declare class TradeController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/TraderController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/TraderController.d.ts index b79f55e..d7afe95 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/TraderController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/TraderController.d.ts @@ -1,3 +1,4 @@ +import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -17,8 +18,9 @@ export declare class TraderController { protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected fenceService: FenceService; + protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService diff --git a/TypeScript/11BundleLoadingSample/types/controllers/WishlistController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/WishlistController.d.ts index a96c522..83be4b3 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/WishlistController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/WishlistController.d.ts @@ -1,10 +1,10 @@ -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistController { - protected itemEvenRouter: ItemEventRouter; - constructor(itemEvenRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/11BundleLoadingSample/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/FenceBaseAssortGenerator.d.ts new file mode 100644 index 0000000..387df3a --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/generators/FenceBaseAssortGenerator.d.ts @@ -0,0 +1,28 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemFilterService } from "../services/ItemFilterService"; +export declare class FenceBaseAssortGenerator { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemHelper: ItemHelper; + protected itemFilterService: ItemFilterService; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + /** + * Create base fence assorts dynamically and store in db + */ + generateFenceBaseAssorts(): void; + /** + * Check if item is valid for being added to fence assorts + * @param item Item to check + * @returns true if valid fence item + */ + protected isValidFenceItem(item: ITemplateItem): boolean; +} diff --git a/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts index 66056c2..bc0d7ec 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts @@ -17,8 +17,8 @@ export declare class LootGenerator { protected itemFilterService: ItemFilterService; constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); /** - * Generate a list of items based on options passed in - * @param options parameters to adjust what loot is generated + * Generate a list of items based on configuration options parameter + * @param options parameters to adjust how loot is generated * @returns An array of loot items */ createRandomloot(options: LootRequest): LootItem[]; @@ -44,7 +44,13 @@ export declare class LootGenerator { max: number; }>, options: LootRequest, result: LootItem[]): boolean; /** - * + * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values + * @param item item to get stack count of + * @param options loot options + * @returns stack count + */ + protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + /** * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts diff --git a/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts index 0dc2d61..b64a7e7 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Get avatar url from trader table in db + * @param isTrader Is user we're getting avatar for a trader + * @param userId persons id to get avatar of + * @returns url of avatar + */ + protected getAvatarUrl(isTrader: boolean, userId: string): string; /** * Convert a count of currency into roubles * @param currencyCount amount of currency to convert into roubles diff --git a/TypeScript/11BundleLoadingSample/types/helpers/DialogueHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/DialogueHelper.d.ts index d2be04d..88a726e 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/DialogueHelper.d.ts @@ -1,6 +1,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; @@ -8,13 +9,14 @@ import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotifierHelper } from "./NotifierHelper"; export declare class DialogueHelper { + protected logger: ILogger; protected hashUtil: HashUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; protected itemHelper: ItemHelper; - constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. @@ -23,7 +25,7 @@ export declare class DialogueHelper { * @param sessionID * @param rewards */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/11BundleLoadingSample/types/helpers/HandbookHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/HandbookHelper.d.ts index b47d466..1ab7800 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { DatabaseServer } from "../servers/DatabaseServer"; declare class LookupItem { byId: Record; byParent: Record; @@ -9,17 +10,35 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected lookup: LookupCollection; - hydrateLookup(lookup: LookupCollection): void; - getTemplatePrice(x: string): number; + protected databaseServer: DatabaseServer; + protected handbookPriceCache: LookupCollection; + constructor(databaseServer: DatabaseServer); + hydrateLookup(): void; + /** + * Get price from internal cache, if cache empty look up price directly in handbook (expensive) + * If no values found, return 1 + * @param tpl item tpl to look up price for + * @returns price in roubles + */ + getTemplatePrice(tpl: string): number; + /** + * all items in template with the given parent category + * @param x + * @returns string array + */ templatesWithParent(x: string): string[]; - isCategory(x: string): boolean; + /** + * Does category exist in handbook cache + * @param category + * @returns true if exists in cache + */ + isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Gets Currency to Ruble conversion Value + * Convert currency into roubles * @param {number} value * @param {string} currencyFrom - * @returns number + * @returns get rouble value of inputted currency */ inRUB(value: number, currencyFrom: string): number; /** diff --git a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts index 7495a6a..5f7e3b7 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts @@ -8,7 +8,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PlayerService } from "../services/PlayerService"; @@ -24,7 +24,7 @@ export declare class HideoutHelper { protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; @@ -35,7 +35,7 @@ export declare class HideoutHelper { static bitcoin: string; static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * This convinience function intialies new Production Object diff --git a/TypeScript/11BundleLoadingSample/types/helpers/NotificationSendHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/NotificationSendHelper.d.ts index 6c56006..014ac95 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/NotificationSendHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { HttpServer } from "../servers/HttpServer"; +import { WebSocketServer } from "../servers/WebSocketServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: HttpServer; + protected webSocketServer: WebSocketServer; protected notificationService: NotificationService; - constructor(httpServer: HttpServer, notificationService: NotificationService); + constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts index d66d150..a6b4892 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -25,7 +25,7 @@ export declare class QuestHelper { protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected ragfairServerHelper: RagfairServerHelper; @@ -35,7 +35,7 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, 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, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search diff --git a/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts index ea13aae..b73f786 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts @@ -6,7 +6,7 @@ import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -27,7 +27,7 @@ export declare class RagfairOfferHelper { protected logger: ILogger; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected traderHelper: TraderHelper; protected saveServer: SaveServer; @@ -45,9 +45,15 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if trader offers' BuyRestrictionMax value has been reached + * @param offer offer to check restriction properties of + * @returns true if restriction reached, false if no restrictions/not reached + */ + protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; /** * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check diff --git a/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts index 7ab9768..2a8f0b7 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts @@ -7,20 +7,20 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; export declare class TradeHelper { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); /** * Buy item from flea or trader * @param pmcData diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts index a349a6d..c5b1cb2 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,5 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -47,7 +48,7 @@ export interface AvailableForProps { compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; - status?: number[]; + status?: QuestStatus[]; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; @@ -99,7 +100,7 @@ export interface Rewards { FailRestartable: Reward[]; Expired: Reward[]; } -export interface Reward { +export interface Reward extends Item { value?: string | number; id: string; type: QuestRewardType; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 1d0c0e8..8a29319 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -2,7 +2,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; Ignore: any[]; - InIgnoreList: any[]; + InIgnoreList: string[]; } export interface Friend { _id: string; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/game/ICheckVersionResponse.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/game/ICheckVersionResponse.d.ts new file mode 100644 index 0000000..fa8aa6f --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/eft/game/ICheckVersionResponse.d.ts @@ -0,0 +1,4 @@ +export interface ICheckVersionResponse { + isvalid: boolean; + latestVersion: string; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/game/IServerDetails.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/game/IServerDetails.d.ts new file mode 100644 index 0000000..101cf99 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/eft/game/IServerDetails.d.ts @@ -0,0 +1,4 @@ +export interface IServerDetails { + ip: string; + port: number; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/profile/GetProfileStatusResponseData.d.ts index eee9b4f..cb7368c 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -4,6 +4,7 @@ export interface GetProfileStatusResponseData { } export interface ProfileData { profileid: string; + profileToken: string; status: string; sid: string; ip: string; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts index eaa66c1..cf28c12 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts @@ -37,12 +37,12 @@ export interface Dialogue { attachmentsNew: number; } export interface DialogueInfo { - _id: string; - type: MessageType; - message: MessagePreview; - pinned: boolean; - new: number; attachmentsNew: number; + new: number; + type: MessageType; + pinned: boolean; + message: MessagePreview; + _id: string; } export interface Message { _id: string; diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/BaseClasses.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/BaseClasses.d.ts index 36ebc71..4eb6f7e 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/BaseClasses.d.ts @@ -1,6 +1,9 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", ARMOR = "5448e54d4bdc2dcc718b4568", + ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", + HEADWEAR = "5a341c4086f77401f2541505", + FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", VISORS = "5448e5724bdc2ddf718b4568", diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IAirdropConfig.d.ts index 3edcbdd..53df991 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IAirdropConfig.d.ts @@ -25,6 +25,6 @@ export interface AirdropLoot { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts index 6b1c1e3..8342c99 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts @@ -17,5 +17,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + itemPriceMult: number; + regenerateAssortsOnRefresh: boolean; + itemTypeLimits: Record; blacklist: string[]; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/services/LootRequest.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/services/LootRequest.d.ts index 1da8770..8c197ee 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/services/LootRequest.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/services/LootRequest.d.ts @@ -6,6 +6,6 @@ export declare class LootRequest { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/11BundleLoadingSample/types/routers/EventOutputHolder.d.ts b/TypeScript/11BundleLoadingSample/types/routers/EventOutputHolder.d.ts new file mode 100644 index 0000000..7a2387b --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/routers/EventOutputHolder.d.ts @@ -0,0 +1,11 @@ +import { JsonUtil } from "../utils/JsonUtil"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +export declare class EventOutputHolder { + protected jsonUtil: JsonUtil; + protected profileHelper: ProfileHelper; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected output: IItemEventRouterResponse; + getOutput(sessionID: string): IItemEventRouterResponse; + resetOutput(sessionID: string): void; +} diff --git a/TypeScript/11BundleLoadingSample/types/routers/ItemEventRouter.d.ts b/TypeScript/11BundleLoadingSample/types/routers/ItemEventRouter.d.ts index b1ac5d9..e80d16c 100644 --- a/TypeScript/11BundleLoadingSample/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/11BundleLoadingSample/types/routers/ItemEventRouter.d.ts @@ -1,17 +1,14 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { ItemEventRouterDefinition } from "../di/Router"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; - protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[]); - protected output: IItemEventRouterResponse; + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; - getOutput(sessionID: string): IItemEventRouterResponse; - protected resetOutput(sessionID: string): void; } diff --git a/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts b/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts index f572a8f..bbca8af 100644 --- a/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts +++ b/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts @@ -1,34 +1,24 @@ /// import http, { IncomingMessage, ServerResponse } from "http"; -import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; -import { NotifierHelper } from "../helpers/NotifierHelper"; -import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; import { IHttpListener } from "./http/IHttpListener"; +import { WebSocketServer } from "./WebSocketServer"; export declare class HttpServer { protected logger: ILogger; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); + protected webSocketServer: WebSocketServer; + constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); protected httpConfig: IHttpConfig; - protected webSockets: {}; - protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - sendMessage(sessionID: string, output: INotification): void; - isConnectionWebSocket(sessionID: string): boolean; handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; - protected getRandomisedMessage(): string; - protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/TypeScript/11BundleLoadingSample/types/servers/WebSocketServer.d.ts b/TypeScript/11BundleLoadingSample/types/servers/WebSocketServer.d.ts new file mode 100644 index 0000000..f33d214 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/servers/WebSocketServer.d.ts @@ -0,0 +1,25 @@ +/// +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import WebSocket from "ws"; +import http, { IncomingMessage } from "http"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { RandomUtil } from "../utils/RandomUtil"; +import { INotification } from "../models/eft/notifier/INotifier"; +import { ConfigServer } from "./ConfigServer"; +import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +export declare class WebSocketServer { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected configServer: ConfigServer; + protected httpServerHelper: HttpServerHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, httpServerHelper: HttpServerHelper); + protected httpConfig: IHttpConfig; + protected defaultNotification: INotification; + protected webSockets: Record; + protected websocketPingHandler: any; + setupWebSocket(httpServer: http.Server): void; + sendMessage(sessionID: string, output: INotification): void; + protected getRandomisedMessage(): string; + isConnectionWebSocket(sessionID: string): boolean; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; +} diff --git a/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts b/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts index 23fbf52..bdcdeb2 100644 --- a/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts @@ -3,6 +3,8 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -41,6 +43,13 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item + * @param assort + * @param modifier + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -96,6 +105,21 @@ export declare class FenceService { * @param assorts object to add assorts to */ protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + /** + * Randomise items' upd properties e.g. med packs/weapons/armor + * @param itemDetails Item being randomised + * @param itemToAdjust Item being edited + */ + protected randomiseItemUpdProperties(itemDetails: ITemplateItem, itemToAdjust: Item): void; + /** + * Construct item limit record to hold max and current item count + * @param limits limits as defined in config + * @returns record, key: item tplId, value: current/max item count allowed + */ + protected initItemLimitCounter(limits: Record): Record; /** * Get the next update timestamp for fence * @returns future timestamp diff --git a/TypeScript/11BundleLoadingSample/types/services/ItemFilterService.d.ts b/TypeScript/11BundleLoadingSample/types/services/ItemFilterService.d.ts index c9c8ef3..b830d74 100644 --- a/TypeScript/11BundleLoadingSample/types/services/ItemFilterService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/ItemFilterService.d.ts @@ -2,7 +2,7 @@ import { IItemConfig } from "../models/spt/config/IItemConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */ +/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; protected databaseServer: DatabaseServer; diff --git a/TypeScript/11BundleLoadingSample/types/services/RagfairOfferService.d.ts b/TypeScript/11BundleLoadingSample/types/services/RagfairOfferService.d.ts index f9e3a34..a6f6b6d 100644 --- a/TypeScript/11BundleLoadingSample/types/services/RagfairOfferService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/RagfairOfferService.d.ts @@ -5,7 +5,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -20,14 +20,14 @@ export declare class RagfairOfferService { protected ragfairServerHelper: RagfairServerHelper; protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; protected expiredOffers: Item[]; protected offers: IRagfairOffer[]; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts b/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts index 466c9e3..4ac7794 100644 --- a/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts @@ -10,7 +10,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -export declare class RagfairPriceService { +import { OnLoad } from "../di/OnLoad"; +export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; @@ -19,21 +20,38 @@ export declare class RagfairPriceService { protected randomUtil: RandomUtil; 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, randomUtil: RandomUtil, configServer: ConfigServer); + onLoad(): void; + getRoute(): string; + /** + * Iterate over all items of type "Item" in db and get template price, store in cache + */ generateStaticPrices(): void; - generateDynamicPrices(): void; - hasDynamicPrices(): boolean; - getDynamicPrice(itemTpl: string): number; - getAllFleaPrices(): Record; + protected generateDynamicPrices(): void; + /** + * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * if no static value, return 1 + * @param tplId Item tpl id to get price for + * @returns price in roubles + */ getFleaPriceForItem(tplId: string): number; /** - * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json - * @param itemPrice price of item - * @param itemTpl item template Id being checked - * @returns adjusted price value in roubles + * get the dynamic (flea) price for an item + * Grabs prices from prices.json and stores in class if none currently exist + * @param itemTpl item template id to look up + * @returns price in roubles */ - protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; + getDynamicPriceForItem(itemTpl: string): number; + /** + * Grab the static (handbook) for an item by its tplId + * @param itemTpl item template id to look up + * @returns price in roubles + */ + getStaticPriceForItem(itemTpl: string): number; + getAllFleaPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -41,9 +59,15 @@ export declare class RagfairPriceService { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; - getStaticPriceForItem(tplId: string): number; getBarterPrice(barterScheme: IBarterScheme[]): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; + /** + * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json + * @param itemPrice price of item + * @param itemTpl item template Id being checked + * @returns adjusted price value in roubles + */ + protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; /** * Multiply the price by a randomised curve where n = 2, shift = 2 * @param existingPrice price to alter @@ -58,7 +82,7 @@ export declare class RagfairPriceService { * @param existingPrice price of existing base weapon * @returns */ - getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) diff --git a/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts b/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts index 3e6077c..d3f1b35 100644 --- a/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts @@ -9,13 +9,11 @@ import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -23,7 +21,7 @@ export declare class RepairService { protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/DataCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/DataCallbacks.d.ts index cfb1c16..04566ff 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/DataCallbacks.d.ts @@ -1,6 +1,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -18,7 +19,7 @@ export declare class DataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts index 06da1b5..5e4c240 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts @@ -1,8 +1,10 @@ import { GameController } from "../controllers/GameController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; @@ -17,8 +19,8 @@ declare class GameCallbacks { gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData; - getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/CustomizationController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/CustomizationController.d.ts index a6c4730..5fe51e3 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/CustomizationController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/CustomizationController.d.ts @@ -5,16 +5,16 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; export declare class CustomizationController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); getTraderSuits(traderID: string, sessionID: string): ISuit[]; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts index eec7dc5..3bfbdb1 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts @@ -3,7 +3,9 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { Config } from "../models/eft/common/IGlobals"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; @@ -37,6 +39,6 @@ export declare class GameController { protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; - getServer(): any[]; - getValidGameVersion(): any; + getServer(): IServerDetails[]; + getValidGameVersion(): ICheckVersionResponse; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/HealthController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/HealthController.d.ts index cc13603..ce67993 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/HealthController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/HealthController.d.ts @@ -8,16 +8,16 @@ import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestD import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; export declare class HealthController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts index dcd8894..ada5bd9 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts @@ -19,7 +19,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -40,7 +40,7 @@ export declare class HideoutController { protected playerService: PlayerService; protected presetHelper: PresetHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected hideoutHelper: HideoutHelper; @@ -49,7 +49,7 @@ export declare class HideoutController { protected jsonUtil: JsonUtil; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InraidController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InraidController.d.ts index 102a2fb..e84eea1 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InraidController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InraidController.d.ts @@ -8,6 +8,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -31,6 +32,7 @@ export declare class InraidController { protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; + protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; @@ -68,4 +70,5 @@ export declare class InraidController { protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void; + getAirdropConfig(): IAirdropConfig; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts index 6895383..14bf129 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; @@ -30,7 +30,7 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required + constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required insuranceService: InsuranceService, configServer: ConfigServer); processReturn(): void; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts index f564919..6a1a21e 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts @@ -1,3 +1,4 @@ +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { PaymentHelper } from "../helpers/PaymentHelper"; import { PresetHelper } from "../helpers/PresetHelper"; @@ -22,7 +23,6 @@ import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryT import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { RagfairOfferService } from "../services/RagfairOfferService"; @@ -39,8 +39,8 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/NoteController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/NoteController.d.ts index ee70541..9e2e250 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/NoteController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/NoteController.d.ts @@ -1,10 +1,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; export declare class NoteController { - protected itemEventRouter: ItemEventRouter; - constructor(itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/PresetBuildController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/PresetBuildController.d.ts index adf4084..65ae0c4 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/PresetBuildController.d.ts @@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; export declare class PresetBuildController { protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); getUserBuilds(sessionID: string): WeaponBuild[]; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts index 282f50e..842207f 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts @@ -11,7 +11,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -20,7 +20,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; @@ -31,7 +31,7 @@ export declare class QuestController { protected localeService: LocaleService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts index fe1f472..5440458 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts @@ -24,7 +24,7 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RagfairServer } from "../servers/RagfairServer"; @@ -42,7 +42,7 @@ export declare class RagfairController { protected logger: ILogger; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; protected databaseServer: DatabaseServer; @@ -64,7 +64,7 @@ export declare class RagfairController { protected ragfairOfferGenerator: RagfairOfferGenerator; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/RepairController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/RepairController.d.ts index ae54a53..fd8ff72 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/RepairController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/RepairController.d.ts @@ -7,13 +7,13 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "../services/PaymentService"; import { RepairService } from "../services/RepairService"; export declare class RepairController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -21,7 +21,7 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected repairService: RepairService; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); /** * Repair with trader * @param sessionID session id diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts index 4c31a3d..7db5886 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,7 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ import { ELocationName } from "../models/enums/ELocationName"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -63,13 +63,13 @@ export declare class RepeatableQuestController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected ragfairServerHelper: RagfairServerHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts index c86745c..0ed0556 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts @@ -6,15 +6,15 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; declare class TradeController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/TraderController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/TraderController.d.ts index b79f55e..d7afe95 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/TraderController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/TraderController.d.ts @@ -1,3 +1,4 @@ +import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -17,8 +18,9 @@ export declare class TraderController { protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected fenceService: FenceService; + protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/WishlistController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/WishlistController.d.ts index a96c522..83be4b3 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/WishlistController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/WishlistController.d.ts @@ -1,10 +1,10 @@ -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistController { - protected itemEvenRouter: ItemEventRouter; - constructor(itemEvenRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/12ClassExtensionOverride/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/FenceBaseAssortGenerator.d.ts new file mode 100644 index 0000000..387df3a --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/generators/FenceBaseAssortGenerator.d.ts @@ -0,0 +1,28 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemFilterService } from "../services/ItemFilterService"; +export declare class FenceBaseAssortGenerator { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemHelper: ItemHelper; + protected itemFilterService: ItemFilterService; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + /** + * Create base fence assorts dynamically and store in db + */ + generateFenceBaseAssorts(): void; + /** + * Check if item is valid for being added to fence assorts + * @param item Item to check + * @returns true if valid fence item + */ + protected isValidFenceItem(item: ITemplateItem): boolean; +} diff --git a/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts index 66056c2..bc0d7ec 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts @@ -17,8 +17,8 @@ export declare class LootGenerator { protected itemFilterService: ItemFilterService; constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); /** - * Generate a list of items based on options passed in - * @param options parameters to adjust what loot is generated + * Generate a list of items based on configuration options parameter + * @param options parameters to adjust how loot is generated * @returns An array of loot items */ createRandomloot(options: LootRequest): LootItem[]; @@ -44,7 +44,13 @@ export declare class LootGenerator { max: number; }>, options: LootRequest, result: LootItem[]): boolean; /** - * + * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values + * @param item item to get stack count of + * @param options loot options + * @returns stack count + */ + protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + /** * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts diff --git a/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts index 0dc2d61..b64a7e7 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Get avatar url from trader table in db + * @param isTrader Is user we're getting avatar for a trader + * @param userId persons id to get avatar of + * @returns url of avatar + */ + protected getAvatarUrl(isTrader: boolean, userId: string): string; /** * Convert a count of currency into roubles * @param currencyCount amount of currency to convert into roubles diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/DialogueHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/DialogueHelper.d.ts index d2be04d..88a726e 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/DialogueHelper.d.ts @@ -1,6 +1,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; @@ -8,13 +9,14 @@ import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotifierHelper } from "./NotifierHelper"; export declare class DialogueHelper { + protected logger: ILogger; protected hashUtil: HashUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; protected itemHelper: ItemHelper; - constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. @@ -23,7 +25,7 @@ export declare class DialogueHelper { * @param sessionID * @param rewards */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/HandbookHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/HandbookHelper.d.ts index b47d466..1ab7800 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { DatabaseServer } from "../servers/DatabaseServer"; declare class LookupItem { byId: Record; byParent: Record; @@ -9,17 +10,35 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected lookup: LookupCollection; - hydrateLookup(lookup: LookupCollection): void; - getTemplatePrice(x: string): number; + protected databaseServer: DatabaseServer; + protected handbookPriceCache: LookupCollection; + constructor(databaseServer: DatabaseServer); + hydrateLookup(): void; + /** + * Get price from internal cache, if cache empty look up price directly in handbook (expensive) + * If no values found, return 1 + * @param tpl item tpl to look up price for + * @returns price in roubles + */ + getTemplatePrice(tpl: string): number; + /** + * all items in template with the given parent category + * @param x + * @returns string array + */ templatesWithParent(x: string): string[]; - isCategory(x: string): boolean; + /** + * Does category exist in handbook cache + * @param category + * @returns true if exists in cache + */ + isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Gets Currency to Ruble conversion Value + * Convert currency into roubles * @param {number} value * @param {string} currencyFrom - * @returns number + * @returns get rouble value of inputted currency */ inRUB(value: number, currencyFrom: string): number; /** diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts index 7495a6a..5f7e3b7 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts @@ -8,7 +8,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PlayerService } from "../services/PlayerService"; @@ -24,7 +24,7 @@ export declare class HideoutHelper { protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; @@ -35,7 +35,7 @@ export declare class HideoutHelper { static bitcoin: string; static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * This convinience function intialies new Production Object diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/NotificationSendHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/NotificationSendHelper.d.ts index 6c56006..014ac95 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/NotificationSendHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { HttpServer } from "../servers/HttpServer"; +import { WebSocketServer } from "../servers/WebSocketServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: HttpServer; + protected webSocketServer: WebSocketServer; protected notificationService: NotificationService; - constructor(httpServer: HttpServer, notificationService: NotificationService); + constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts index d66d150..a6b4892 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -25,7 +25,7 @@ export declare class QuestHelper { protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected ragfairServerHelper: RagfairServerHelper; @@ -35,7 +35,7 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, 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, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts index ea13aae..b73f786 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts @@ -6,7 +6,7 @@ import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -27,7 +27,7 @@ export declare class RagfairOfferHelper { protected logger: ILogger; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected traderHelper: TraderHelper; protected saveServer: SaveServer; @@ -45,9 +45,15 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if trader offers' BuyRestrictionMax value has been reached + * @param offer offer to check restriction properties of + * @returns true if restriction reached, false if no restrictions/not reached + */ + protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; /** * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts index 7ab9768..2a8f0b7 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts @@ -7,20 +7,20 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; export declare class TradeHelper { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); /** * Buy item from flea or trader * @param pmcData diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts index a349a6d..c5b1cb2 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,5 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -47,7 +48,7 @@ export interface AvailableForProps { compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; - status?: number[]; + status?: QuestStatus[]; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; @@ -99,7 +100,7 @@ export interface Rewards { FailRestartable: Reward[]; Expired: Reward[]; } -export interface Reward { +export interface Reward extends Item { value?: string | number; id: string; type: QuestRewardType; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 1d0c0e8..8a29319 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -2,7 +2,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; Ignore: any[]; - InIgnoreList: any[]; + InIgnoreList: string[]; } export interface Friend { _id: string; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/game/ICheckVersionResponse.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/game/ICheckVersionResponse.d.ts new file mode 100644 index 0000000..fa8aa6f --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/game/ICheckVersionResponse.d.ts @@ -0,0 +1,4 @@ +export interface ICheckVersionResponse { + isvalid: boolean; + latestVersion: string; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/game/IServerDetails.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/game/IServerDetails.d.ts new file mode 100644 index 0000000..101cf99 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/game/IServerDetails.d.ts @@ -0,0 +1,4 @@ +export interface IServerDetails { + ip: string; + port: number; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/GetProfileStatusResponseData.d.ts index eee9b4f..cb7368c 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -4,6 +4,7 @@ export interface GetProfileStatusResponseData { } export interface ProfileData { profileid: string; + profileToken: string; status: string; sid: string; ip: string; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts index eaa66c1..cf28c12 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts @@ -37,12 +37,12 @@ export interface Dialogue { attachmentsNew: number; } export interface DialogueInfo { - _id: string; - type: MessageType; - message: MessagePreview; - pinned: boolean; - new: number; attachmentsNew: number; + new: number; + type: MessageType; + pinned: boolean; + message: MessagePreview; + _id: string; } export interface Message { _id: string; diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/BaseClasses.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/BaseClasses.d.ts index 36ebc71..4eb6f7e 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/BaseClasses.d.ts @@ -1,6 +1,9 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", ARMOR = "5448e54d4bdc2dcc718b4568", + ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", + HEADWEAR = "5a341c4086f77401f2541505", + FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", VISORS = "5448e5724bdc2ddf718b4568", diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IAirdropConfig.d.ts index 3edcbdd..53df991 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IAirdropConfig.d.ts @@ -25,6 +25,6 @@ export interface AirdropLoot { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts index 6b1c1e3..8342c99 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts @@ -17,5 +17,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + itemPriceMult: number; + regenerateAssortsOnRefresh: boolean; + itemTypeLimits: Record; blacklist: string[]; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/services/LootRequest.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/services/LootRequest.d.ts index 1da8770..8c197ee 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/services/LootRequest.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/services/LootRequest.d.ts @@ -6,6 +6,6 @@ export declare class LootRequest { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/12ClassExtensionOverride/types/routers/EventOutputHolder.d.ts b/TypeScript/12ClassExtensionOverride/types/routers/EventOutputHolder.d.ts new file mode 100644 index 0000000..7a2387b --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/routers/EventOutputHolder.d.ts @@ -0,0 +1,11 @@ +import { JsonUtil } from "../utils/JsonUtil"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +export declare class EventOutputHolder { + protected jsonUtil: JsonUtil; + protected profileHelper: ProfileHelper; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected output: IItemEventRouterResponse; + getOutput(sessionID: string): IItemEventRouterResponse; + resetOutput(sessionID: string): void; +} diff --git a/TypeScript/12ClassExtensionOverride/types/routers/ItemEventRouter.d.ts b/TypeScript/12ClassExtensionOverride/types/routers/ItemEventRouter.d.ts index b1ac5d9..e80d16c 100644 --- a/TypeScript/12ClassExtensionOverride/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/routers/ItemEventRouter.d.ts @@ -1,17 +1,14 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { ItemEventRouterDefinition } from "../di/Router"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; - protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[]); - protected output: IItemEventRouterResponse; + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; - getOutput(sessionID: string): IItemEventRouterResponse; - protected resetOutput(sessionID: string): void; } diff --git a/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts b/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts index f572a8f..bbca8af 100644 --- a/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts @@ -1,34 +1,24 @@ /// import http, { IncomingMessage, ServerResponse } from "http"; -import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; -import { NotifierHelper } from "../helpers/NotifierHelper"; -import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; import { IHttpListener } from "./http/IHttpListener"; +import { WebSocketServer } from "./WebSocketServer"; export declare class HttpServer { protected logger: ILogger; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); + protected webSocketServer: WebSocketServer; + constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); protected httpConfig: IHttpConfig; - protected webSockets: {}; - protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - sendMessage(sessionID: string, output: INotification): void; - isConnectionWebSocket(sessionID: string): boolean; handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; - protected getRandomisedMessage(): string; - protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/TypeScript/12ClassExtensionOverride/types/servers/WebSocketServer.d.ts b/TypeScript/12ClassExtensionOverride/types/servers/WebSocketServer.d.ts new file mode 100644 index 0000000..f33d214 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/servers/WebSocketServer.d.ts @@ -0,0 +1,25 @@ +/// +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import WebSocket from "ws"; +import http, { IncomingMessage } from "http"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { RandomUtil } from "../utils/RandomUtil"; +import { INotification } from "../models/eft/notifier/INotifier"; +import { ConfigServer } from "./ConfigServer"; +import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +export declare class WebSocketServer { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected configServer: ConfigServer; + protected httpServerHelper: HttpServerHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, httpServerHelper: HttpServerHelper); + protected httpConfig: IHttpConfig; + protected defaultNotification: INotification; + protected webSockets: Record; + protected websocketPingHandler: any; + setupWebSocket(httpServer: http.Server): void; + sendMessage(sessionID: string, output: INotification): void; + protected getRandomisedMessage(): string; + isConnectionWebSocket(sessionID: string): boolean; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; +} diff --git a/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts index 23fbf52..bdcdeb2 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts @@ -3,6 +3,8 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -41,6 +43,13 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item + * @param assort + * @param modifier + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -96,6 +105,21 @@ export declare class FenceService { * @param assorts object to add assorts to */ protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + /** + * Randomise items' upd properties e.g. med packs/weapons/armor + * @param itemDetails Item being randomised + * @param itemToAdjust Item being edited + */ + protected randomiseItemUpdProperties(itemDetails: ITemplateItem, itemToAdjust: Item): void; + /** + * Construct item limit record to hold max and current item count + * @param limits limits as defined in config + * @returns record, key: item tplId, value: current/max item count allowed + */ + protected initItemLimitCounter(limits: Record): Record; /** * Get the next update timestamp for fence * @returns future timestamp diff --git a/TypeScript/12ClassExtensionOverride/types/services/ItemFilterService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/ItemFilterService.d.ts index c9c8ef3..b830d74 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/ItemFilterService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/ItemFilterService.d.ts @@ -2,7 +2,7 @@ import { IItemConfig } from "../models/spt/config/IItemConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */ +/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; protected databaseServer: DatabaseServer; diff --git a/TypeScript/12ClassExtensionOverride/types/services/RagfairOfferService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/RagfairOfferService.d.ts index f9e3a34..a6f6b6d 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/RagfairOfferService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/RagfairOfferService.d.ts @@ -5,7 +5,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -20,14 +20,14 @@ export declare class RagfairOfferService { protected ragfairServerHelper: RagfairServerHelper; protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; protected expiredOffers: Item[]; protected offers: IRagfairOffer[]; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts index 466c9e3..4ac7794 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts @@ -10,7 +10,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -export declare class RagfairPriceService { +import { OnLoad } from "../di/OnLoad"; +export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; @@ -19,21 +20,38 @@ export declare class RagfairPriceService { protected randomUtil: RandomUtil; 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, randomUtil: RandomUtil, configServer: ConfigServer); + onLoad(): void; + getRoute(): string; + /** + * Iterate over all items of type "Item" in db and get template price, store in cache + */ generateStaticPrices(): void; - generateDynamicPrices(): void; - hasDynamicPrices(): boolean; - getDynamicPrice(itemTpl: string): number; - getAllFleaPrices(): Record; + protected generateDynamicPrices(): void; + /** + * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * if no static value, return 1 + * @param tplId Item tpl id to get price for + * @returns price in roubles + */ getFleaPriceForItem(tplId: string): number; /** - * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json - * @param itemPrice price of item - * @param itemTpl item template Id being checked - * @returns adjusted price value in roubles + * get the dynamic (flea) price for an item + * Grabs prices from prices.json and stores in class if none currently exist + * @param itemTpl item template id to look up + * @returns price in roubles */ - protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; + getDynamicPriceForItem(itemTpl: string): number; + /** + * Grab the static (handbook) for an item by its tplId + * @param itemTpl item template id to look up + * @returns price in roubles + */ + getStaticPriceForItem(itemTpl: string): number; + getAllFleaPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -41,9 +59,15 @@ export declare class RagfairPriceService { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; - getStaticPriceForItem(tplId: string): number; getBarterPrice(barterScheme: IBarterScheme[]): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; + /** + * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json + * @param itemPrice price of item + * @param itemTpl item template Id being checked + * @returns adjusted price value in roubles + */ + protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; /** * Multiply the price by a randomised curve where n = 2, shift = 2 * @param existingPrice price to alter @@ -58,7 +82,7 @@ export declare class RagfairPriceService { * @param existingPrice price of existing base weapon * @returns */ - getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) diff --git a/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts index 3e6077c..d3f1b35 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts @@ -9,13 +9,11 @@ import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -23,7 +21,7 @@ export declare class RepairService { protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/TypeScript/13AddTrader/types/callbacks/DataCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/DataCallbacks.d.ts index cfb1c16..04566ff 100644 --- a/TypeScript/13AddTrader/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/DataCallbacks.d.ts @@ -1,6 +1,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -18,7 +19,7 @@ export declare class DataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; diff --git a/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts index 06da1b5..5e4c240 100644 --- a/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts @@ -1,8 +1,10 @@ import { GameController } from "../controllers/GameController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; @@ -17,8 +19,8 @@ declare class GameCallbacks { gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData; - getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/13AddTrader/types/controllers/CustomizationController.d.ts b/TypeScript/13AddTrader/types/controllers/CustomizationController.d.ts index a6c4730..5fe51e3 100644 --- a/TypeScript/13AddTrader/types/controllers/CustomizationController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/CustomizationController.d.ts @@ -5,16 +5,16 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; export declare class CustomizationController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); getTraderSuits(traderID: string, sessionID: string): ISuit[]; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/13AddTrader/types/controllers/GameController.d.ts b/TypeScript/13AddTrader/types/controllers/GameController.d.ts index eec7dc5..3bfbdb1 100644 --- a/TypeScript/13AddTrader/types/controllers/GameController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/GameController.d.ts @@ -3,7 +3,9 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { Config } from "../models/eft/common/IGlobals"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; @@ -37,6 +39,6 @@ export declare class GameController { protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; - getServer(): any[]; - getValidGameVersion(): any; + getServer(): IServerDetails[]; + getValidGameVersion(): ICheckVersionResponse; } diff --git a/TypeScript/13AddTrader/types/controllers/HealthController.d.ts b/TypeScript/13AddTrader/types/controllers/HealthController.d.ts index cc13603..ce67993 100644 --- a/TypeScript/13AddTrader/types/controllers/HealthController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/HealthController.d.ts @@ -8,16 +8,16 @@ import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestD import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; export declare class HealthController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile diff --git a/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts b/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts index dcd8894..ada5bd9 100644 --- a/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts @@ -19,7 +19,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -40,7 +40,7 @@ export declare class HideoutController { protected playerService: PlayerService; protected presetHelper: PresetHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected hideoutHelper: HideoutHelper; @@ -49,7 +49,7 @@ export declare class HideoutController { protected jsonUtil: JsonUtil; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/TypeScript/13AddTrader/types/controllers/InraidController.d.ts b/TypeScript/13AddTrader/types/controllers/InraidController.d.ts index 102a2fb..e84eea1 100644 --- a/TypeScript/13AddTrader/types/controllers/InraidController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InraidController.d.ts @@ -8,6 +8,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -31,6 +32,7 @@ export declare class InraidController { protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; + protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; @@ -68,4 +70,5 @@ export declare class InraidController { protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void; + getAirdropConfig(): IAirdropConfig; } diff --git a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts index 6895383..14bf129 100644 --- a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; @@ -30,7 +30,7 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required + constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required insuranceService: InsuranceService, configServer: ConfigServer); processReturn(): void; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts b/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts index f564919..6a1a21e 100644 --- a/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts @@ -1,3 +1,4 @@ +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { PaymentHelper } from "../helpers/PaymentHelper"; import { PresetHelper } from "../helpers/PresetHelper"; @@ -22,7 +23,6 @@ import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryT import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { RagfairOfferService } from "../services/RagfairOfferService"; @@ -39,8 +39,8 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/13AddTrader/types/controllers/NoteController.d.ts b/TypeScript/13AddTrader/types/controllers/NoteController.d.ts index ee70541..9e2e250 100644 --- a/TypeScript/13AddTrader/types/controllers/NoteController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/NoteController.d.ts @@ -1,10 +1,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; export declare class NoteController { - protected itemEventRouter: ItemEventRouter; - constructor(itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/13AddTrader/types/controllers/PresetBuildController.d.ts b/TypeScript/13AddTrader/types/controllers/PresetBuildController.d.ts index adf4084..65ae0c4 100644 --- a/TypeScript/13AddTrader/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/PresetBuildController.d.ts @@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; export declare class PresetBuildController { protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); getUserBuilds(sessionID: string): WeaponBuild[]; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/13AddTrader/types/controllers/QuestController.d.ts b/TypeScript/13AddTrader/types/controllers/QuestController.d.ts index 282f50e..842207f 100644 --- a/TypeScript/13AddTrader/types/controllers/QuestController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/QuestController.d.ts @@ -11,7 +11,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -20,7 +20,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; @@ -31,7 +31,7 @@ export declare class QuestController { protected localeService: LocaleService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) diff --git a/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts b/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts index fe1f472..5440458 100644 --- a/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts @@ -24,7 +24,7 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RagfairServer } from "../servers/RagfairServer"; @@ -42,7 +42,7 @@ export declare class RagfairController { protected logger: ILogger; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; protected databaseServer: DatabaseServer; @@ -64,7 +64,7 @@ export declare class RagfairController { protected ragfairOfferGenerator: RagfairOfferGenerator; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed diff --git a/TypeScript/13AddTrader/types/controllers/RepairController.d.ts b/TypeScript/13AddTrader/types/controllers/RepairController.d.ts index ae54a53..fd8ff72 100644 --- a/TypeScript/13AddTrader/types/controllers/RepairController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/RepairController.d.ts @@ -7,13 +7,13 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "../services/PaymentService"; import { RepairService } from "../services/RepairService"; export declare class RepairController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -21,7 +21,7 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected repairService: RepairService; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); /** * Repair with trader * @param sessionID session id diff --git a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts index 4c31a3d..7db5886 100644 --- a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,7 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ import { ELocationName } from "../models/enums/ELocationName"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -63,13 +63,13 @@ export declare class RepeatableQuestController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected ragfairServerHelper: RagfairServerHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/13AddTrader/types/controllers/TradeController.d.ts b/TypeScript/13AddTrader/types/controllers/TradeController.d.ts index c86745c..0ed0556 100644 --- a/TypeScript/13AddTrader/types/controllers/TradeController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/TradeController.d.ts @@ -6,15 +6,15 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; declare class TradeController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/13AddTrader/types/controllers/TraderController.d.ts b/TypeScript/13AddTrader/types/controllers/TraderController.d.ts index b79f55e..d7afe95 100644 --- a/TypeScript/13AddTrader/types/controllers/TraderController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/TraderController.d.ts @@ -1,3 +1,4 @@ +import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -17,8 +18,9 @@ export declare class TraderController { protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected fenceService: FenceService; + protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService diff --git a/TypeScript/13AddTrader/types/controllers/WishlistController.d.ts b/TypeScript/13AddTrader/types/controllers/WishlistController.d.ts index a96c522..83be4b3 100644 --- a/TypeScript/13AddTrader/types/controllers/WishlistController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/WishlistController.d.ts @@ -1,10 +1,10 @@ -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistController { - protected itemEvenRouter: ItemEventRouter; - constructor(itemEvenRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/13AddTrader/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/13AddTrader/types/generators/FenceBaseAssortGenerator.d.ts new file mode 100644 index 0000000..387df3a --- /dev/null +++ b/TypeScript/13AddTrader/types/generators/FenceBaseAssortGenerator.d.ts @@ -0,0 +1,28 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemFilterService } from "../services/ItemFilterService"; +export declare class FenceBaseAssortGenerator { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemHelper: ItemHelper; + protected itemFilterService: ItemFilterService; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + /** + * Create base fence assorts dynamically and store in db + */ + generateFenceBaseAssorts(): void; + /** + * Check if item is valid for being added to fence assorts + * @param item Item to check + * @returns true if valid fence item + */ + protected isValidFenceItem(item: ITemplateItem): boolean; +} diff --git a/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts b/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts index 66056c2..bc0d7ec 100644 --- a/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts @@ -17,8 +17,8 @@ export declare class LootGenerator { protected itemFilterService: ItemFilterService; constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); /** - * Generate a list of items based on options passed in - * @param options parameters to adjust what loot is generated + * Generate a list of items based on configuration options parameter + * @param options parameters to adjust how loot is generated * @returns An array of loot items */ createRandomloot(options: LootRequest): LootItem[]; @@ -44,7 +44,13 @@ export declare class LootGenerator { max: number; }>, options: LootRequest, result: LootItem[]): boolean; /** - * + * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values + * @param item item to get stack count of + * @param options loot options + * @returns stack count + */ + protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + /** * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts diff --git a/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts index 0dc2d61..b64a7e7 100644 --- a/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Get avatar url from trader table in db + * @param isTrader Is user we're getting avatar for a trader + * @param userId persons id to get avatar of + * @returns url of avatar + */ + protected getAvatarUrl(isTrader: boolean, userId: string): string; /** * Convert a count of currency into roubles * @param currencyCount amount of currency to convert into roubles diff --git a/TypeScript/13AddTrader/types/helpers/DialogueHelper.d.ts b/TypeScript/13AddTrader/types/helpers/DialogueHelper.d.ts index d2be04d..88a726e 100644 --- a/TypeScript/13AddTrader/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/DialogueHelper.d.ts @@ -1,6 +1,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; @@ -8,13 +9,14 @@ import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotifierHelper } from "./NotifierHelper"; export declare class DialogueHelper { + protected logger: ILogger; protected hashUtil: HashUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; protected itemHelper: ItemHelper; - constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. @@ -23,7 +25,7 @@ export declare class DialogueHelper { * @param sessionID * @param rewards */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/13AddTrader/types/helpers/HandbookHelper.d.ts b/TypeScript/13AddTrader/types/helpers/HandbookHelper.d.ts index b47d466..1ab7800 100644 --- a/TypeScript/13AddTrader/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { DatabaseServer } from "../servers/DatabaseServer"; declare class LookupItem { byId: Record; byParent: Record; @@ -9,17 +10,35 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected lookup: LookupCollection; - hydrateLookup(lookup: LookupCollection): void; - getTemplatePrice(x: string): number; + protected databaseServer: DatabaseServer; + protected handbookPriceCache: LookupCollection; + constructor(databaseServer: DatabaseServer); + hydrateLookup(): void; + /** + * Get price from internal cache, if cache empty look up price directly in handbook (expensive) + * If no values found, return 1 + * @param tpl item tpl to look up price for + * @returns price in roubles + */ + getTemplatePrice(tpl: string): number; + /** + * all items in template with the given parent category + * @param x + * @returns string array + */ templatesWithParent(x: string): string[]; - isCategory(x: string): boolean; + /** + * Does category exist in handbook cache + * @param category + * @returns true if exists in cache + */ + isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Gets Currency to Ruble conversion Value + * Convert currency into roubles * @param {number} value * @param {string} currencyFrom - * @returns number + * @returns get rouble value of inputted currency */ inRUB(value: number, currencyFrom: string): number; /** diff --git a/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts b/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts index 7495a6a..5f7e3b7 100644 --- a/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts @@ -8,7 +8,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PlayerService } from "../services/PlayerService"; @@ -24,7 +24,7 @@ export declare class HideoutHelper { protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; @@ -35,7 +35,7 @@ export declare class HideoutHelper { static bitcoin: string; static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * This convinience function intialies new Production Object diff --git a/TypeScript/13AddTrader/types/helpers/NotificationSendHelper.d.ts b/TypeScript/13AddTrader/types/helpers/NotificationSendHelper.d.ts index 6c56006..014ac95 100644 --- a/TypeScript/13AddTrader/types/helpers/NotificationSendHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { HttpServer } from "../servers/HttpServer"; +import { WebSocketServer } from "../servers/WebSocketServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: HttpServer; + protected webSocketServer: WebSocketServer; protected notificationService: NotificationService; - constructor(httpServer: HttpServer, notificationService: NotificationService); + constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts b/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts index d66d150..a6b4892 100644 --- a/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -25,7 +25,7 @@ export declare class QuestHelper { protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected ragfairServerHelper: RagfairServerHelper; @@ -35,7 +35,7 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, 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, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search diff --git a/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts index ea13aae..b73f786 100644 --- a/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts @@ -6,7 +6,7 @@ import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -27,7 +27,7 @@ export declare class RagfairOfferHelper { protected logger: ILogger; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected traderHelper: TraderHelper; protected saveServer: SaveServer; @@ -45,9 +45,15 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if trader offers' BuyRestrictionMax value has been reached + * @param offer offer to check restriction properties of + * @returns true if restriction reached, false if no restrictions/not reached + */ + protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; /** * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check diff --git a/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts b/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts index 7ab9768..2a8f0b7 100644 --- a/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts @@ -7,20 +7,20 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; export declare class TradeHelper { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); /** * Buy item from flea or trader * @param pmcData diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts index a349a6d..c5b1cb2 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,5 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -47,7 +48,7 @@ export interface AvailableForProps { compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; - status?: number[]; + status?: QuestStatus[]; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; @@ -99,7 +100,7 @@ export interface Rewards { FailRestartable: Reward[]; Expired: Reward[]; } -export interface Reward { +export interface Reward extends Item { value?: string | number; id: string; type: QuestRewardType; diff --git a/TypeScript/13AddTrader/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/13AddTrader/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 1d0c0e8..8a29319 100644 --- a/TypeScript/13AddTrader/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -2,7 +2,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; Ignore: any[]; - InIgnoreList: any[]; + InIgnoreList: string[]; } export interface Friend { _id: string; diff --git a/TypeScript/13AddTrader/types/models/eft/game/ICheckVersionResponse.d.ts b/TypeScript/13AddTrader/types/models/eft/game/ICheckVersionResponse.d.ts new file mode 100644 index 0000000..fa8aa6f --- /dev/null +++ b/TypeScript/13AddTrader/types/models/eft/game/ICheckVersionResponse.d.ts @@ -0,0 +1,4 @@ +export interface ICheckVersionResponse { + isvalid: boolean; + latestVersion: string; +} diff --git a/TypeScript/13AddTrader/types/models/eft/game/IServerDetails.d.ts b/TypeScript/13AddTrader/types/models/eft/game/IServerDetails.d.ts new file mode 100644 index 0000000..101cf99 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/eft/game/IServerDetails.d.ts @@ -0,0 +1,4 @@ +export interface IServerDetails { + ip: string; + port: number; +} diff --git a/TypeScript/13AddTrader/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/13AddTrader/types/models/eft/profile/GetProfileStatusResponseData.d.ts index eee9b4f..cb7368c 100644 --- a/TypeScript/13AddTrader/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -4,6 +4,7 @@ export interface GetProfileStatusResponseData { } export interface ProfileData { profileid: string; + profileToken: string; status: string; sid: string; ip: string; diff --git a/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts index eaa66c1..cf28c12 100644 --- a/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts @@ -37,12 +37,12 @@ export interface Dialogue { attachmentsNew: number; } export interface DialogueInfo { - _id: string; - type: MessageType; - message: MessagePreview; - pinned: boolean; - new: number; attachmentsNew: number; + new: number; + type: MessageType; + pinned: boolean; + message: MessagePreview; + _id: string; } export interface Message { _id: string; diff --git a/TypeScript/13AddTrader/types/models/enums/BaseClasses.d.ts b/TypeScript/13AddTrader/types/models/enums/BaseClasses.d.ts index 36ebc71..4eb6f7e 100644 --- a/TypeScript/13AddTrader/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/BaseClasses.d.ts @@ -1,6 +1,9 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", ARMOR = "5448e54d4bdc2dcc718b4568", + ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", + HEADWEAR = "5a341c4086f77401f2541505", + FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", VISORS = "5448e5724bdc2ddf718b4568", diff --git a/TypeScript/13AddTrader/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IAirdropConfig.d.ts index 3edcbdd..53df991 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IAirdropConfig.d.ts @@ -25,6 +25,6 @@ export interface AirdropLoot { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts index 6b1c1e3..8342c99 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts @@ -17,5 +17,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + itemPriceMult: number; + regenerateAssortsOnRefresh: boolean; + itemTypeLimits: Record; blacklist: string[]; } diff --git a/TypeScript/13AddTrader/types/models/spt/services/LootRequest.d.ts b/TypeScript/13AddTrader/types/models/spt/services/LootRequest.d.ts index 1da8770..8c197ee 100644 --- a/TypeScript/13AddTrader/types/models/spt/services/LootRequest.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/services/LootRequest.d.ts @@ -6,6 +6,6 @@ export declare class LootRequest { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/13AddTrader/types/routers/EventOutputHolder.d.ts b/TypeScript/13AddTrader/types/routers/EventOutputHolder.d.ts new file mode 100644 index 0000000..7a2387b --- /dev/null +++ b/TypeScript/13AddTrader/types/routers/EventOutputHolder.d.ts @@ -0,0 +1,11 @@ +import { JsonUtil } from "../utils/JsonUtil"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +export declare class EventOutputHolder { + protected jsonUtil: JsonUtil; + protected profileHelper: ProfileHelper; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected output: IItemEventRouterResponse; + getOutput(sessionID: string): IItemEventRouterResponse; + resetOutput(sessionID: string): void; +} diff --git a/TypeScript/13AddTrader/types/routers/ItemEventRouter.d.ts b/TypeScript/13AddTrader/types/routers/ItemEventRouter.d.ts index b1ac5d9..e80d16c 100644 --- a/TypeScript/13AddTrader/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/13AddTrader/types/routers/ItemEventRouter.d.ts @@ -1,17 +1,14 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { ItemEventRouterDefinition } from "../di/Router"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; - protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[]); - protected output: IItemEventRouterResponse; + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; - getOutput(sessionID: string): IItemEventRouterResponse; - protected resetOutput(sessionID: string): void; } diff --git a/TypeScript/13AddTrader/types/servers/HttpServer.d.ts b/TypeScript/13AddTrader/types/servers/HttpServer.d.ts index f572a8f..bbca8af 100644 --- a/TypeScript/13AddTrader/types/servers/HttpServer.d.ts +++ b/TypeScript/13AddTrader/types/servers/HttpServer.d.ts @@ -1,34 +1,24 @@ /// import http, { IncomingMessage, ServerResponse } from "http"; -import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; -import { NotifierHelper } from "../helpers/NotifierHelper"; -import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; import { IHttpListener } from "./http/IHttpListener"; +import { WebSocketServer } from "./WebSocketServer"; export declare class HttpServer { protected logger: ILogger; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); + protected webSocketServer: WebSocketServer; + constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); protected httpConfig: IHttpConfig; - protected webSockets: {}; - protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - sendMessage(sessionID: string, output: INotification): void; - isConnectionWebSocket(sessionID: string): boolean; handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; - protected getRandomisedMessage(): string; - protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/TypeScript/13AddTrader/types/servers/WebSocketServer.d.ts b/TypeScript/13AddTrader/types/servers/WebSocketServer.d.ts new file mode 100644 index 0000000..f33d214 --- /dev/null +++ b/TypeScript/13AddTrader/types/servers/WebSocketServer.d.ts @@ -0,0 +1,25 @@ +/// +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import WebSocket from "ws"; +import http, { IncomingMessage } from "http"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { RandomUtil } from "../utils/RandomUtil"; +import { INotification } from "../models/eft/notifier/INotifier"; +import { ConfigServer } from "./ConfigServer"; +import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +export declare class WebSocketServer { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected configServer: ConfigServer; + protected httpServerHelper: HttpServerHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, httpServerHelper: HttpServerHelper); + protected httpConfig: IHttpConfig; + protected defaultNotification: INotification; + protected webSockets: Record; + protected websocketPingHandler: any; + setupWebSocket(httpServer: http.Server): void; + sendMessage(sessionID: string, output: INotification): void; + protected getRandomisedMessage(): string; + isConnectionWebSocket(sessionID: string): boolean; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; +} diff --git a/TypeScript/13AddTrader/types/services/FenceService.d.ts b/TypeScript/13AddTrader/types/services/FenceService.d.ts index 23fbf52..bdcdeb2 100644 --- a/TypeScript/13AddTrader/types/services/FenceService.d.ts +++ b/TypeScript/13AddTrader/types/services/FenceService.d.ts @@ -3,6 +3,8 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -41,6 +43,13 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item + * @param assort + * @param modifier + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -96,6 +105,21 @@ export declare class FenceService { * @param assorts object to add assorts to */ protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + /** + * Randomise items' upd properties e.g. med packs/weapons/armor + * @param itemDetails Item being randomised + * @param itemToAdjust Item being edited + */ + protected randomiseItemUpdProperties(itemDetails: ITemplateItem, itemToAdjust: Item): void; + /** + * Construct item limit record to hold max and current item count + * @param limits limits as defined in config + * @returns record, key: item tplId, value: current/max item count allowed + */ + protected initItemLimitCounter(limits: Record): Record; /** * Get the next update timestamp for fence * @returns future timestamp diff --git a/TypeScript/13AddTrader/types/services/ItemFilterService.d.ts b/TypeScript/13AddTrader/types/services/ItemFilterService.d.ts index c9c8ef3..b830d74 100644 --- a/TypeScript/13AddTrader/types/services/ItemFilterService.d.ts +++ b/TypeScript/13AddTrader/types/services/ItemFilterService.d.ts @@ -2,7 +2,7 @@ import { IItemConfig } from "../models/spt/config/IItemConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */ +/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; protected databaseServer: DatabaseServer; diff --git a/TypeScript/13AddTrader/types/services/RagfairOfferService.d.ts b/TypeScript/13AddTrader/types/services/RagfairOfferService.d.ts index f9e3a34..a6f6b6d 100644 --- a/TypeScript/13AddTrader/types/services/RagfairOfferService.d.ts +++ b/TypeScript/13AddTrader/types/services/RagfairOfferService.d.ts @@ -5,7 +5,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -20,14 +20,14 @@ export declare class RagfairOfferService { protected ragfairServerHelper: RagfairServerHelper; protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; protected expiredOffers: Item[]; protected offers: IRagfairOffer[]; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts b/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts index 466c9e3..4ac7794 100644 --- a/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts +++ b/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts @@ -10,7 +10,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -export declare class RagfairPriceService { +import { OnLoad } from "../di/OnLoad"; +export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; @@ -19,21 +20,38 @@ export declare class RagfairPriceService { protected randomUtil: RandomUtil; 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, randomUtil: RandomUtil, configServer: ConfigServer); + onLoad(): void; + getRoute(): string; + /** + * Iterate over all items of type "Item" in db and get template price, store in cache + */ generateStaticPrices(): void; - generateDynamicPrices(): void; - hasDynamicPrices(): boolean; - getDynamicPrice(itemTpl: string): number; - getAllFleaPrices(): Record; + protected generateDynamicPrices(): void; + /** + * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * if no static value, return 1 + * @param tplId Item tpl id to get price for + * @returns price in roubles + */ getFleaPriceForItem(tplId: string): number; /** - * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json - * @param itemPrice price of item - * @param itemTpl item template Id being checked - * @returns adjusted price value in roubles + * get the dynamic (flea) price for an item + * Grabs prices from prices.json and stores in class if none currently exist + * @param itemTpl item template id to look up + * @returns price in roubles */ - protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; + getDynamicPriceForItem(itemTpl: string): number; + /** + * Grab the static (handbook) for an item by its tplId + * @param itemTpl item template id to look up + * @returns price in roubles + */ + getStaticPriceForItem(itemTpl: string): number; + getAllFleaPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -41,9 +59,15 @@ export declare class RagfairPriceService { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; - getStaticPriceForItem(tplId: string): number; getBarterPrice(barterScheme: IBarterScheme[]): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; + /** + * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json + * @param itemPrice price of item + * @param itemTpl item template Id being checked + * @returns adjusted price value in roubles + */ + protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; /** * Multiply the price by a randomised curve where n = 2, shift = 2 * @param existingPrice price to alter @@ -58,7 +82,7 @@ export declare class RagfairPriceService { * @param existingPrice price of existing base weapon * @returns */ - getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) diff --git a/TypeScript/13AddTrader/types/services/RepairService.d.ts b/TypeScript/13AddTrader/types/services/RepairService.d.ts index 3e6077c..d3f1b35 100644 --- a/TypeScript/13AddTrader/types/services/RepairService.d.ts +++ b/TypeScript/13AddTrader/types/services/RepairService.d.ts @@ -9,13 +9,11 @@ import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -23,7 +21,7 @@ export declare class RepairService { protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/DataCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/DataCallbacks.d.ts index cfb1c16..04566ff 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/DataCallbacks.d.ts @@ -1,6 +1,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -18,7 +19,7 @@ export declare class DataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts index 06da1b5..5e4c240 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts @@ -1,8 +1,10 @@ import { GameController } from "../controllers/GameController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; @@ -17,8 +19,8 @@ declare class GameCallbacks { gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData; - getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/CustomizationController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/CustomizationController.d.ts index a6c4730..5fe51e3 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/CustomizationController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/CustomizationController.d.ts @@ -5,16 +5,16 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; export declare class CustomizationController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); getTraderSuits(traderID: string, sessionID: string): ISuit[]; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts index eec7dc5..3bfbdb1 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts @@ -3,7 +3,9 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { Config } from "../models/eft/common/IGlobals"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; @@ -37,6 +39,6 @@ export declare class GameController { protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; - getServer(): any[]; - getValidGameVersion(): any; + getServer(): IServerDetails[]; + getValidGameVersion(): ICheckVersionResponse; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/HealthController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/HealthController.d.ts index cc13603..ce67993 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/HealthController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/HealthController.d.ts @@ -8,16 +8,16 @@ import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestD import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; export declare class HealthController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts index dcd8894..ada5bd9 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts @@ -19,7 +19,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -40,7 +40,7 @@ export declare class HideoutController { protected playerService: PlayerService; protected presetHelper: PresetHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected hideoutHelper: HideoutHelper; @@ -49,7 +49,7 @@ export declare class HideoutController { protected jsonUtil: JsonUtil; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InraidController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InraidController.d.ts index 102a2fb..e84eea1 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InraidController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InraidController.d.ts @@ -8,6 +8,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -31,6 +32,7 @@ export declare class InraidController { protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; + protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; @@ -68,4 +70,5 @@ export declare class InraidController { protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void; + getAirdropConfig(): IAirdropConfig; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts index 6895383..14bf129 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; @@ -30,7 +30,7 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required + constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required insuranceService: InsuranceService, configServer: ConfigServer); processReturn(): void; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts index f564919..6a1a21e 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts @@ -1,3 +1,4 @@ +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { PaymentHelper } from "../helpers/PaymentHelper"; import { PresetHelper } from "../helpers/PresetHelper"; @@ -22,7 +23,6 @@ import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryT import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { RagfairOfferService } from "../services/RagfairOfferService"; @@ -39,8 +39,8 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/NoteController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/NoteController.d.ts index ee70541..9e2e250 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/NoteController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/NoteController.d.ts @@ -1,10 +1,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; export declare class NoteController { - protected itemEventRouter: ItemEventRouter; - constructor(itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/PresetBuildController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/PresetBuildController.d.ts index adf4084..65ae0c4 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/PresetBuildController.d.ts @@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; export declare class PresetBuildController { protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); getUserBuilds(sessionID: string): WeaponBuild[]; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts index 282f50e..842207f 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts @@ -11,7 +11,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -20,7 +20,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; @@ -31,7 +31,7 @@ export declare class QuestController { protected localeService: LocaleService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts index fe1f472..5440458 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts @@ -24,7 +24,7 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RagfairServer } from "../servers/RagfairServer"; @@ -42,7 +42,7 @@ export declare class RagfairController { protected logger: ILogger; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; protected databaseServer: DatabaseServer; @@ -64,7 +64,7 @@ export declare class RagfairController { protected ragfairOfferGenerator: RagfairOfferGenerator; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/RepairController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/RepairController.d.ts index ae54a53..fd8ff72 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/RepairController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/RepairController.d.ts @@ -7,13 +7,13 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "../services/PaymentService"; import { RepairService } from "../services/RepairService"; export declare class RepairController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -21,7 +21,7 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected repairService: RepairService; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); /** * Repair with trader * @param sessionID session id diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts index 4c31a3d..7db5886 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,7 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ import { ELocationName } from "../models/enums/ELocationName"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -63,13 +63,13 @@ export declare class RepeatableQuestController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected ragfairServerHelper: RagfairServerHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts index c86745c..0ed0556 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts @@ -6,15 +6,15 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; declare class TradeController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/TraderController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/TraderController.d.ts index b79f55e..d7afe95 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/TraderController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/TraderController.d.ts @@ -1,3 +1,4 @@ +import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -17,8 +18,9 @@ export declare class TraderController { protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected fenceService: FenceService; + protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/WishlistController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/WishlistController.d.ts index a96c522..83be4b3 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/WishlistController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/WishlistController.d.ts @@ -1,10 +1,10 @@ -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistController { - protected itemEvenRouter: ItemEventRouter; - constructor(itemEvenRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/14AfterDBLoadHook/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/FenceBaseAssortGenerator.d.ts new file mode 100644 index 0000000..387df3a --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/generators/FenceBaseAssortGenerator.d.ts @@ -0,0 +1,28 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemFilterService } from "../services/ItemFilterService"; +export declare class FenceBaseAssortGenerator { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemHelper: ItemHelper; + protected itemFilterService: ItemFilterService; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + /** + * Create base fence assorts dynamically and store in db + */ + generateFenceBaseAssorts(): void; + /** + * Check if item is valid for being added to fence assorts + * @param item Item to check + * @returns true if valid fence item + */ + protected isValidFenceItem(item: ITemplateItem): boolean; +} diff --git a/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts index 66056c2..bc0d7ec 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts @@ -17,8 +17,8 @@ export declare class LootGenerator { protected itemFilterService: ItemFilterService; constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); /** - * Generate a list of items based on options passed in - * @param options parameters to adjust what loot is generated + * Generate a list of items based on configuration options parameter + * @param options parameters to adjust how loot is generated * @returns An array of loot items */ createRandomloot(options: LootRequest): LootItem[]; @@ -44,7 +44,13 @@ export declare class LootGenerator { max: number; }>, options: LootRequest, result: LootItem[]): boolean; /** - * + * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values + * @param item item to get stack count of + * @param options loot options + * @returns stack count + */ + protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + /** * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts diff --git a/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts index 0dc2d61..b64a7e7 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Get avatar url from trader table in db + * @param isTrader Is user we're getting avatar for a trader + * @param userId persons id to get avatar of + * @returns url of avatar + */ + protected getAvatarUrl(isTrader: boolean, userId: string): string; /** * Convert a count of currency into roubles * @param currencyCount amount of currency to convert into roubles diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/DialogueHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/DialogueHelper.d.ts index d2be04d..88a726e 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/DialogueHelper.d.ts @@ -1,6 +1,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; @@ -8,13 +9,14 @@ import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotifierHelper } from "./NotifierHelper"; export declare class DialogueHelper { + protected logger: ILogger; protected hashUtil: HashUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; protected itemHelper: ItemHelper; - constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. @@ -23,7 +25,7 @@ export declare class DialogueHelper { * @param sessionID * @param rewards */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/HandbookHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/HandbookHelper.d.ts index b47d466..1ab7800 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { DatabaseServer } from "../servers/DatabaseServer"; declare class LookupItem { byId: Record; byParent: Record; @@ -9,17 +10,35 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected lookup: LookupCollection; - hydrateLookup(lookup: LookupCollection): void; - getTemplatePrice(x: string): number; + protected databaseServer: DatabaseServer; + protected handbookPriceCache: LookupCollection; + constructor(databaseServer: DatabaseServer); + hydrateLookup(): void; + /** + * Get price from internal cache, if cache empty look up price directly in handbook (expensive) + * If no values found, return 1 + * @param tpl item tpl to look up price for + * @returns price in roubles + */ + getTemplatePrice(tpl: string): number; + /** + * all items in template with the given parent category + * @param x + * @returns string array + */ templatesWithParent(x: string): string[]; - isCategory(x: string): boolean; + /** + * Does category exist in handbook cache + * @param category + * @returns true if exists in cache + */ + isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Gets Currency to Ruble conversion Value + * Convert currency into roubles * @param {number} value * @param {string} currencyFrom - * @returns number + * @returns get rouble value of inputted currency */ inRUB(value: number, currencyFrom: string): number; /** diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts index 7495a6a..5f7e3b7 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts @@ -8,7 +8,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PlayerService } from "../services/PlayerService"; @@ -24,7 +24,7 @@ export declare class HideoutHelper { protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; @@ -35,7 +35,7 @@ export declare class HideoutHelper { static bitcoin: string; static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * This convinience function intialies new Production Object diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/NotificationSendHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/NotificationSendHelper.d.ts index 6c56006..014ac95 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/NotificationSendHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { HttpServer } from "../servers/HttpServer"; +import { WebSocketServer } from "../servers/WebSocketServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: HttpServer; + protected webSocketServer: WebSocketServer; protected notificationService: NotificationService; - constructor(httpServer: HttpServer, notificationService: NotificationService); + constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts index d66d150..a6b4892 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -25,7 +25,7 @@ export declare class QuestHelper { protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected ragfairServerHelper: RagfairServerHelper; @@ -35,7 +35,7 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, 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, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts index ea13aae..b73f786 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts @@ -6,7 +6,7 @@ import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -27,7 +27,7 @@ export declare class RagfairOfferHelper { protected logger: ILogger; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected traderHelper: TraderHelper; protected saveServer: SaveServer; @@ -45,9 +45,15 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if trader offers' BuyRestrictionMax value has been reached + * @param offer offer to check restriction properties of + * @returns true if restriction reached, false if no restrictions/not reached + */ + protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; /** * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts index 7ab9768..2a8f0b7 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts @@ -7,20 +7,20 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; export declare class TradeHelper { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); /** * Buy item from flea or trader * @param pmcData diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts index a349a6d..c5b1cb2 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,5 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -47,7 +48,7 @@ export interface AvailableForProps { compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; - status?: number[]; + status?: QuestStatus[]; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; @@ -99,7 +100,7 @@ export interface Rewards { FailRestartable: Reward[]; Expired: Reward[]; } -export interface Reward { +export interface Reward extends Item { value?: string | number; id: string; type: QuestRewardType; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 1d0c0e8..8a29319 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -2,7 +2,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; Ignore: any[]; - InIgnoreList: any[]; + InIgnoreList: string[]; } export interface Friend { _id: string; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/game/ICheckVersionResponse.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/game/ICheckVersionResponse.d.ts new file mode 100644 index 0000000..fa8aa6f --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/game/ICheckVersionResponse.d.ts @@ -0,0 +1,4 @@ +export interface ICheckVersionResponse { + isvalid: boolean; + latestVersion: string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/game/IServerDetails.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/game/IServerDetails.d.ts new file mode 100644 index 0000000..101cf99 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/game/IServerDetails.d.ts @@ -0,0 +1,4 @@ +export interface IServerDetails { + ip: string; + port: number; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/GetProfileStatusResponseData.d.ts index eee9b4f..cb7368c 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -4,6 +4,7 @@ export interface GetProfileStatusResponseData { } export interface ProfileData { profileid: string; + profileToken: string; status: string; sid: string; ip: string; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts index eaa66c1..cf28c12 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts @@ -37,12 +37,12 @@ export interface Dialogue { attachmentsNew: number; } export interface DialogueInfo { - _id: string; - type: MessageType; - message: MessagePreview; - pinned: boolean; - new: number; attachmentsNew: number; + new: number; + type: MessageType; + pinned: boolean; + message: MessagePreview; + _id: string; } export interface Message { _id: string; diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/BaseClasses.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/BaseClasses.d.ts index 36ebc71..4eb6f7e 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/BaseClasses.d.ts @@ -1,6 +1,9 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", ARMOR = "5448e54d4bdc2dcc718b4568", + ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", + HEADWEAR = "5a341c4086f77401f2541505", + FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", VISORS = "5448e5724bdc2ddf718b4568", diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IAirdropConfig.d.ts index 3edcbdd..53df991 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IAirdropConfig.d.ts @@ -25,6 +25,6 @@ export interface AirdropLoot { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts index 6b1c1e3..8342c99 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts @@ -17,5 +17,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + itemPriceMult: number; + regenerateAssortsOnRefresh: boolean; + itemTypeLimits: Record; blacklist: string[]; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/services/LootRequest.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/services/LootRequest.d.ts index 1da8770..8c197ee 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/services/LootRequest.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/services/LootRequest.d.ts @@ -6,6 +6,6 @@ export declare class LootRequest { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/14AfterDBLoadHook/types/routers/EventOutputHolder.d.ts b/TypeScript/14AfterDBLoadHook/types/routers/EventOutputHolder.d.ts new file mode 100644 index 0000000..7a2387b --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/routers/EventOutputHolder.d.ts @@ -0,0 +1,11 @@ +import { JsonUtil } from "../utils/JsonUtil"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +export declare class EventOutputHolder { + protected jsonUtil: JsonUtil; + protected profileHelper: ProfileHelper; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected output: IItemEventRouterResponse; + getOutput(sessionID: string): IItemEventRouterResponse; + resetOutput(sessionID: string): void; +} diff --git a/TypeScript/14AfterDBLoadHook/types/routers/ItemEventRouter.d.ts b/TypeScript/14AfterDBLoadHook/types/routers/ItemEventRouter.d.ts index b1ac5d9..e80d16c 100644 --- a/TypeScript/14AfterDBLoadHook/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/routers/ItemEventRouter.d.ts @@ -1,17 +1,14 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { ItemEventRouterDefinition } from "../di/Router"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; - protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[]); - protected output: IItemEventRouterResponse; + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; - getOutput(sessionID: string): IItemEventRouterResponse; - protected resetOutput(sessionID: string): void; } diff --git a/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts b/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts index f572a8f..bbca8af 100644 --- a/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts @@ -1,34 +1,24 @@ /// import http, { IncomingMessage, ServerResponse } from "http"; -import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; -import { NotifierHelper } from "../helpers/NotifierHelper"; -import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; import { IHttpListener } from "./http/IHttpListener"; +import { WebSocketServer } from "./WebSocketServer"; export declare class HttpServer { protected logger: ILogger; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); + protected webSocketServer: WebSocketServer; + constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); protected httpConfig: IHttpConfig; - protected webSockets: {}; - protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - sendMessage(sessionID: string, output: INotification): void; - isConnectionWebSocket(sessionID: string): boolean; handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; - protected getRandomisedMessage(): string; - protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/TypeScript/14AfterDBLoadHook/types/servers/WebSocketServer.d.ts b/TypeScript/14AfterDBLoadHook/types/servers/WebSocketServer.d.ts new file mode 100644 index 0000000..f33d214 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/servers/WebSocketServer.d.ts @@ -0,0 +1,25 @@ +/// +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import WebSocket from "ws"; +import http, { IncomingMessage } from "http"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { RandomUtil } from "../utils/RandomUtil"; +import { INotification } from "../models/eft/notifier/INotifier"; +import { ConfigServer } from "./ConfigServer"; +import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +export declare class WebSocketServer { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected configServer: ConfigServer; + protected httpServerHelper: HttpServerHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, httpServerHelper: HttpServerHelper); + protected httpConfig: IHttpConfig; + protected defaultNotification: INotification; + protected webSockets: Record; + protected websocketPingHandler: any; + setupWebSocket(httpServer: http.Server): void; + sendMessage(sessionID: string, output: INotification): void; + protected getRandomisedMessage(): string; + isConnectionWebSocket(sessionID: string): boolean; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; +} diff --git a/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts index 23fbf52..bdcdeb2 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts @@ -3,6 +3,8 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -41,6 +43,13 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item + * @param assort + * @param modifier + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -96,6 +105,21 @@ export declare class FenceService { * @param assorts object to add assorts to */ protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + /** + * Randomise items' upd properties e.g. med packs/weapons/armor + * @param itemDetails Item being randomised + * @param itemToAdjust Item being edited + */ + protected randomiseItemUpdProperties(itemDetails: ITemplateItem, itemToAdjust: Item): void; + /** + * Construct item limit record to hold max and current item count + * @param limits limits as defined in config + * @returns record, key: item tplId, value: current/max item count allowed + */ + protected initItemLimitCounter(limits: Record): Record; /** * Get the next update timestamp for fence * @returns future timestamp diff --git a/TypeScript/14AfterDBLoadHook/types/services/ItemFilterService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/ItemFilterService.d.ts index c9c8ef3..b830d74 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/ItemFilterService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/ItemFilterService.d.ts @@ -2,7 +2,7 @@ import { IItemConfig } from "../models/spt/config/IItemConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */ +/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; protected databaseServer: DatabaseServer; diff --git a/TypeScript/14AfterDBLoadHook/types/services/RagfairOfferService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/RagfairOfferService.d.ts index f9e3a34..a6f6b6d 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/RagfairOfferService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/RagfairOfferService.d.ts @@ -5,7 +5,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -20,14 +20,14 @@ export declare class RagfairOfferService { protected ragfairServerHelper: RagfairServerHelper; protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; protected expiredOffers: Item[]; protected offers: IRagfairOffer[]; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts index 466c9e3..4ac7794 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts @@ -10,7 +10,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -export declare class RagfairPriceService { +import { OnLoad } from "../di/OnLoad"; +export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; @@ -19,21 +20,38 @@ export declare class RagfairPriceService { protected randomUtil: RandomUtil; 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, randomUtil: RandomUtil, configServer: ConfigServer); + onLoad(): void; + getRoute(): string; + /** + * Iterate over all items of type "Item" in db and get template price, store in cache + */ generateStaticPrices(): void; - generateDynamicPrices(): void; - hasDynamicPrices(): boolean; - getDynamicPrice(itemTpl: string): number; - getAllFleaPrices(): Record; + protected generateDynamicPrices(): void; + /** + * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * if no static value, return 1 + * @param tplId Item tpl id to get price for + * @returns price in roubles + */ getFleaPriceForItem(tplId: string): number; /** - * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json - * @param itemPrice price of item - * @param itemTpl item template Id being checked - * @returns adjusted price value in roubles + * get the dynamic (flea) price for an item + * Grabs prices from prices.json and stores in class if none currently exist + * @param itemTpl item template id to look up + * @returns price in roubles */ - protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; + getDynamicPriceForItem(itemTpl: string): number; + /** + * Grab the static (handbook) for an item by its tplId + * @param itemTpl item template id to look up + * @returns price in roubles + */ + getStaticPriceForItem(itemTpl: string): number; + getAllFleaPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -41,9 +59,15 @@ export declare class RagfairPriceService { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; - getStaticPriceForItem(tplId: string): number; getBarterPrice(barterScheme: IBarterScheme[]): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; + /** + * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json + * @param itemPrice price of item + * @param itemTpl item template Id being checked + * @returns adjusted price value in roubles + */ + protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; /** * Multiply the price by a randomised curve where n = 2, shift = 2 * @param existingPrice price to alter @@ -58,7 +82,7 @@ export declare class RagfairPriceService { * @param existingPrice price of existing base weapon * @returns */ - getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) diff --git a/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts index 3e6077c..d3f1b35 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts @@ -9,13 +9,11 @@ import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -23,7 +21,7 @@ export declare class RepairService { protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/TypeScript/15HttpListenerExample/types/callbacks/DataCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/DataCallbacks.d.ts index cfb1c16..04566ff 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/DataCallbacks.d.ts @@ -1,6 +1,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -18,7 +19,7 @@ export declare class DataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; diff --git a/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts index 06da1b5..5e4c240 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts @@ -1,8 +1,10 @@ import { GameController } from "../controllers/GameController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; @@ -17,8 +19,8 @@ declare class GameCallbacks { gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData; - getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/15HttpListenerExample/types/controllers/CustomizationController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/CustomizationController.d.ts index a6c4730..5fe51e3 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/CustomizationController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/CustomizationController.d.ts @@ -5,16 +5,16 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; export declare class CustomizationController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); getTraderSuits(traderID: string, sessionID: string): ISuit[]; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts index eec7dc5..3bfbdb1 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts @@ -3,7 +3,9 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { Config } from "../models/eft/common/IGlobals"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; @@ -37,6 +39,6 @@ export declare class GameController { protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; - getServer(): any[]; - getValidGameVersion(): any; + getServer(): IServerDetails[]; + getValidGameVersion(): ICheckVersionResponse; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/HealthController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/HealthController.d.ts index cc13603..ce67993 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/HealthController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/HealthController.d.ts @@ -8,16 +8,16 @@ import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestD import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; export declare class HealthController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile diff --git a/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts index dcd8894..ada5bd9 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts @@ -19,7 +19,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -40,7 +40,7 @@ export declare class HideoutController { protected playerService: PlayerService; protected presetHelper: PresetHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected hideoutHelper: HideoutHelper; @@ -49,7 +49,7 @@ export declare class HideoutController { protected jsonUtil: JsonUtil; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/TypeScript/15HttpListenerExample/types/controllers/InraidController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/InraidController.d.ts index 102a2fb..e84eea1 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/InraidController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/InraidController.d.ts @@ -8,6 +8,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -31,6 +32,7 @@ export declare class InraidController { protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; + protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; @@ -68,4 +70,5 @@ export declare class InraidController { protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void; + getAirdropConfig(): IAirdropConfig; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts index 6895383..14bf129 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; @@ -30,7 +30,7 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required + constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required insuranceService: InsuranceService, configServer: ConfigServer); processReturn(): void; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts index f564919..6a1a21e 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts @@ -1,3 +1,4 @@ +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { PaymentHelper } from "../helpers/PaymentHelper"; import { PresetHelper } from "../helpers/PresetHelper"; @@ -22,7 +23,6 @@ import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryT import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { RagfairOfferService } from "../services/RagfairOfferService"; @@ -39,8 +39,8 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/15HttpListenerExample/types/controllers/NoteController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/NoteController.d.ts index ee70541..9e2e250 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/NoteController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/NoteController.d.ts @@ -1,10 +1,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; export declare class NoteController { - protected itemEventRouter: ItemEventRouter; - constructor(itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/15HttpListenerExample/types/controllers/PresetBuildController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/PresetBuildController.d.ts index adf4084..65ae0c4 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/PresetBuildController.d.ts @@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; export declare class PresetBuildController { protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); getUserBuilds(sessionID: string): WeaponBuild[]; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts index 282f50e..842207f 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts @@ -11,7 +11,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -20,7 +20,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; @@ -31,7 +31,7 @@ export declare class QuestController { protected localeService: LocaleService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) diff --git a/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts index fe1f472..5440458 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts @@ -24,7 +24,7 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RagfairServer } from "../servers/RagfairServer"; @@ -42,7 +42,7 @@ export declare class RagfairController { protected logger: ILogger; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; protected databaseServer: DatabaseServer; @@ -64,7 +64,7 @@ export declare class RagfairController { protected ragfairOfferGenerator: RagfairOfferGenerator; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed diff --git a/TypeScript/15HttpListenerExample/types/controllers/RepairController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/RepairController.d.ts index ae54a53..fd8ff72 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/RepairController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/RepairController.d.ts @@ -7,13 +7,13 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "../services/PaymentService"; import { RepairService } from "../services/RepairService"; export declare class RepairController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -21,7 +21,7 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected repairService: RepairService; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); /** * Repair with trader * @param sessionID session id diff --git a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts index 4c31a3d..7db5886 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,7 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ import { ELocationName } from "../models/enums/ELocationName"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -63,13 +63,13 @@ export declare class RepeatableQuestController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected ragfairServerHelper: RagfairServerHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts index c86745c..0ed0556 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts @@ -6,15 +6,15 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; declare class TradeController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/TraderController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/TraderController.d.ts index b79f55e..d7afe95 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/TraderController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/TraderController.d.ts @@ -1,3 +1,4 @@ +import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -17,8 +18,9 @@ export declare class TraderController { protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected fenceService: FenceService; + protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService diff --git a/TypeScript/15HttpListenerExample/types/controllers/WishlistController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/WishlistController.d.ts index a96c522..83be4b3 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/WishlistController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/WishlistController.d.ts @@ -1,10 +1,10 @@ -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistController { - protected itemEvenRouter: ItemEventRouter; - constructor(itemEvenRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/15HttpListenerExample/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/FenceBaseAssortGenerator.d.ts new file mode 100644 index 0000000..387df3a --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/generators/FenceBaseAssortGenerator.d.ts @@ -0,0 +1,28 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemFilterService } from "../services/ItemFilterService"; +export declare class FenceBaseAssortGenerator { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemHelper: ItemHelper; + protected itemFilterService: ItemFilterService; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + /** + * Create base fence assorts dynamically and store in db + */ + generateFenceBaseAssorts(): void; + /** + * Check if item is valid for being added to fence assorts + * @param item Item to check + * @returns true if valid fence item + */ + protected isValidFenceItem(item: ITemplateItem): boolean; +} diff --git a/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts index 66056c2..bc0d7ec 100644 --- a/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts @@ -17,8 +17,8 @@ export declare class LootGenerator { protected itemFilterService: ItemFilterService; constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); /** - * Generate a list of items based on options passed in - * @param options parameters to adjust what loot is generated + * Generate a list of items based on configuration options parameter + * @param options parameters to adjust how loot is generated * @returns An array of loot items */ createRandomloot(options: LootRequest): LootItem[]; @@ -44,7 +44,13 @@ export declare class LootGenerator { max: number; }>, options: LootRequest, result: LootItem[]): boolean; /** - * + * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values + * @param item item to get stack count of + * @param options loot options + * @returns stack count + */ + protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + /** * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts diff --git a/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts index 0dc2d61..b64a7e7 100644 --- a/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Get avatar url from trader table in db + * @param isTrader Is user we're getting avatar for a trader + * @param userId persons id to get avatar of + * @returns url of avatar + */ + protected getAvatarUrl(isTrader: boolean, userId: string): string; /** * Convert a count of currency into roubles * @param currencyCount amount of currency to convert into roubles diff --git a/TypeScript/15HttpListenerExample/types/helpers/DialogueHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/DialogueHelper.d.ts index d2be04d..88a726e 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/DialogueHelper.d.ts @@ -1,6 +1,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; @@ -8,13 +9,14 @@ import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotifierHelper } from "./NotifierHelper"; export declare class DialogueHelper { + protected logger: ILogger; protected hashUtil: HashUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; protected itemHelper: ItemHelper; - constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. @@ -23,7 +25,7 @@ export declare class DialogueHelper { * @param sessionID * @param rewards */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/15HttpListenerExample/types/helpers/HandbookHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/HandbookHelper.d.ts index b47d466..1ab7800 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { DatabaseServer } from "../servers/DatabaseServer"; declare class LookupItem { byId: Record; byParent: Record; @@ -9,17 +10,35 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected lookup: LookupCollection; - hydrateLookup(lookup: LookupCollection): void; - getTemplatePrice(x: string): number; + protected databaseServer: DatabaseServer; + protected handbookPriceCache: LookupCollection; + constructor(databaseServer: DatabaseServer); + hydrateLookup(): void; + /** + * Get price from internal cache, if cache empty look up price directly in handbook (expensive) + * If no values found, return 1 + * @param tpl item tpl to look up price for + * @returns price in roubles + */ + getTemplatePrice(tpl: string): number; + /** + * all items in template with the given parent category + * @param x + * @returns string array + */ templatesWithParent(x: string): string[]; - isCategory(x: string): boolean; + /** + * Does category exist in handbook cache + * @param category + * @returns true if exists in cache + */ + isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Gets Currency to Ruble conversion Value + * Convert currency into roubles * @param {number} value * @param {string} currencyFrom - * @returns number + * @returns get rouble value of inputted currency */ inRUB(value: number, currencyFrom: string): number; /** diff --git a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts index 7495a6a..5f7e3b7 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts @@ -8,7 +8,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PlayerService } from "../services/PlayerService"; @@ -24,7 +24,7 @@ export declare class HideoutHelper { protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; @@ -35,7 +35,7 @@ export declare class HideoutHelper { static bitcoin: string; static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * This convinience function intialies new Production Object diff --git a/TypeScript/15HttpListenerExample/types/helpers/NotificationSendHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/NotificationSendHelper.d.ts index 6c56006..014ac95 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/NotificationSendHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { HttpServer } from "../servers/HttpServer"; +import { WebSocketServer } from "../servers/WebSocketServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: HttpServer; + protected webSocketServer: WebSocketServer; protected notificationService: NotificationService; - constructor(httpServer: HttpServer, notificationService: NotificationService); + constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts index d66d150..a6b4892 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -25,7 +25,7 @@ export declare class QuestHelper { protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected ragfairServerHelper: RagfairServerHelper; @@ -35,7 +35,7 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, 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, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search diff --git a/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts index ea13aae..b73f786 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts @@ -6,7 +6,7 @@ import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -27,7 +27,7 @@ export declare class RagfairOfferHelper { protected logger: ILogger; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected traderHelper: TraderHelper; protected saveServer: SaveServer; @@ -45,9 +45,15 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if trader offers' BuyRestrictionMax value has been reached + * @param offer offer to check restriction properties of + * @returns true if restriction reached, false if no restrictions/not reached + */ + protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; /** * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check diff --git a/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts index 7ab9768..2a8f0b7 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts @@ -7,20 +7,20 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; export declare class TradeHelper { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); /** * Buy item from flea or trader * @param pmcData diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts index a349a6d..c5b1cb2 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,5 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -47,7 +48,7 @@ export interface AvailableForProps { compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; - status?: number[]; + status?: QuestStatus[]; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; @@ -99,7 +100,7 @@ export interface Rewards { FailRestartable: Reward[]; Expired: Reward[]; } -export interface Reward { +export interface Reward extends Item { value?: string | number; id: string; type: QuestRewardType; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 1d0c0e8..8a29319 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -2,7 +2,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; Ignore: any[]; - InIgnoreList: any[]; + InIgnoreList: string[]; } export interface Friend { _id: string; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/game/ICheckVersionResponse.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/game/ICheckVersionResponse.d.ts new file mode 100644 index 0000000..fa8aa6f --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/eft/game/ICheckVersionResponse.d.ts @@ -0,0 +1,4 @@ +export interface ICheckVersionResponse { + isvalid: boolean; + latestVersion: string; +} diff --git a/TypeScript/15HttpListenerExample/types/models/eft/game/IServerDetails.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/game/IServerDetails.d.ts new file mode 100644 index 0000000..101cf99 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/eft/game/IServerDetails.d.ts @@ -0,0 +1,4 @@ +export interface IServerDetails { + ip: string; + port: number; +} diff --git a/TypeScript/15HttpListenerExample/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/profile/GetProfileStatusResponseData.d.ts index eee9b4f..cb7368c 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -4,6 +4,7 @@ export interface GetProfileStatusResponseData { } export interface ProfileData { profileid: string; + profileToken: string; status: string; sid: string; ip: string; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts index eaa66c1..cf28c12 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts @@ -37,12 +37,12 @@ export interface Dialogue { attachmentsNew: number; } export interface DialogueInfo { - _id: string; - type: MessageType; - message: MessagePreview; - pinned: boolean; - new: number; attachmentsNew: number; + new: number; + type: MessageType; + pinned: boolean; + message: MessagePreview; + _id: string; } export interface Message { _id: string; diff --git a/TypeScript/15HttpListenerExample/types/models/enums/BaseClasses.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/BaseClasses.d.ts index 36ebc71..4eb6f7e 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/BaseClasses.d.ts @@ -1,6 +1,9 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", ARMOR = "5448e54d4bdc2dcc718b4568", + ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", + HEADWEAR = "5a341c4086f77401f2541505", + FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", VISORS = "5448e5724bdc2ddf718b4568", diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IAirdropConfig.d.ts index 3edcbdd..53df991 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IAirdropConfig.d.ts @@ -25,6 +25,6 @@ export interface AirdropLoot { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts index 6b1c1e3..8342c99 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts @@ -17,5 +17,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + itemPriceMult: number; + regenerateAssortsOnRefresh: boolean; + itemTypeLimits: Record; blacklist: string[]; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/services/LootRequest.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/services/LootRequest.d.ts index 1da8770..8c197ee 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/services/LootRequest.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/services/LootRequest.d.ts @@ -6,6 +6,6 @@ export declare class LootRequest { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/15HttpListenerExample/types/routers/EventOutputHolder.d.ts b/TypeScript/15HttpListenerExample/types/routers/EventOutputHolder.d.ts new file mode 100644 index 0000000..7a2387b --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/routers/EventOutputHolder.d.ts @@ -0,0 +1,11 @@ +import { JsonUtil } from "../utils/JsonUtil"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +export declare class EventOutputHolder { + protected jsonUtil: JsonUtil; + protected profileHelper: ProfileHelper; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected output: IItemEventRouterResponse; + getOutput(sessionID: string): IItemEventRouterResponse; + resetOutput(sessionID: string): void; +} diff --git a/TypeScript/15HttpListenerExample/types/routers/ItemEventRouter.d.ts b/TypeScript/15HttpListenerExample/types/routers/ItemEventRouter.d.ts index b1ac5d9..e80d16c 100644 --- a/TypeScript/15HttpListenerExample/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/15HttpListenerExample/types/routers/ItemEventRouter.d.ts @@ -1,17 +1,14 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { ItemEventRouterDefinition } from "../di/Router"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; - protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[]); - protected output: IItemEventRouterResponse; + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; - getOutput(sessionID: string): IItemEventRouterResponse; - protected resetOutput(sessionID: string): void; } diff --git a/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts b/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts index f572a8f..bbca8af 100644 --- a/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts +++ b/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts @@ -1,34 +1,24 @@ /// import http, { IncomingMessage, ServerResponse } from "http"; -import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; -import { NotifierHelper } from "../helpers/NotifierHelper"; -import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; import { IHttpListener } from "./http/IHttpListener"; +import { WebSocketServer } from "./WebSocketServer"; export declare class HttpServer { protected logger: ILogger; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); + protected webSocketServer: WebSocketServer; + constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); protected httpConfig: IHttpConfig; - protected webSockets: {}; - protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - sendMessage(sessionID: string, output: INotification): void; - isConnectionWebSocket(sessionID: string): boolean; handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; - protected getRandomisedMessage(): string; - protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/TypeScript/15HttpListenerExample/types/servers/WebSocketServer.d.ts b/TypeScript/15HttpListenerExample/types/servers/WebSocketServer.d.ts new file mode 100644 index 0000000..f33d214 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/servers/WebSocketServer.d.ts @@ -0,0 +1,25 @@ +/// +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import WebSocket from "ws"; +import http, { IncomingMessage } from "http"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { RandomUtil } from "../utils/RandomUtil"; +import { INotification } from "../models/eft/notifier/INotifier"; +import { ConfigServer } from "./ConfigServer"; +import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +export declare class WebSocketServer { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected configServer: ConfigServer; + protected httpServerHelper: HttpServerHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, httpServerHelper: HttpServerHelper); + protected httpConfig: IHttpConfig; + protected defaultNotification: INotification; + protected webSockets: Record; + protected websocketPingHandler: any; + setupWebSocket(httpServer: http.Server): void; + sendMessage(sessionID: string, output: INotification): void; + protected getRandomisedMessage(): string; + isConnectionWebSocket(sessionID: string): boolean; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; +} diff --git a/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts b/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts index 23fbf52..bdcdeb2 100644 --- a/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts @@ -3,6 +3,8 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -41,6 +43,13 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item + * @param assort + * @param modifier + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -96,6 +105,21 @@ export declare class FenceService { * @param assorts object to add assorts to */ protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + /** + * Randomise items' upd properties e.g. med packs/weapons/armor + * @param itemDetails Item being randomised + * @param itemToAdjust Item being edited + */ + protected randomiseItemUpdProperties(itemDetails: ITemplateItem, itemToAdjust: Item): void; + /** + * Construct item limit record to hold max and current item count + * @param limits limits as defined in config + * @returns record, key: item tplId, value: current/max item count allowed + */ + protected initItemLimitCounter(limits: Record): Record; /** * Get the next update timestamp for fence * @returns future timestamp diff --git a/TypeScript/15HttpListenerExample/types/services/ItemFilterService.d.ts b/TypeScript/15HttpListenerExample/types/services/ItemFilterService.d.ts index c9c8ef3..b830d74 100644 --- a/TypeScript/15HttpListenerExample/types/services/ItemFilterService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/ItemFilterService.d.ts @@ -2,7 +2,7 @@ import { IItemConfig } from "../models/spt/config/IItemConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */ +/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; protected databaseServer: DatabaseServer; diff --git a/TypeScript/15HttpListenerExample/types/services/RagfairOfferService.d.ts b/TypeScript/15HttpListenerExample/types/services/RagfairOfferService.d.ts index f9e3a34..a6f6b6d 100644 --- a/TypeScript/15HttpListenerExample/types/services/RagfairOfferService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/RagfairOfferService.d.ts @@ -5,7 +5,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -20,14 +20,14 @@ export declare class RagfairOfferService { protected ragfairServerHelper: RagfairServerHelper; protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; protected expiredOffers: Item[]; protected offers: IRagfairOffer[]; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts b/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts index 466c9e3..4ac7794 100644 --- a/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts @@ -10,7 +10,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -export declare class RagfairPriceService { +import { OnLoad } from "../di/OnLoad"; +export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; @@ -19,21 +20,38 @@ export declare class RagfairPriceService { protected randomUtil: RandomUtil; 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, randomUtil: RandomUtil, configServer: ConfigServer); + onLoad(): void; + getRoute(): string; + /** + * Iterate over all items of type "Item" in db and get template price, store in cache + */ generateStaticPrices(): void; - generateDynamicPrices(): void; - hasDynamicPrices(): boolean; - getDynamicPrice(itemTpl: string): number; - getAllFleaPrices(): Record; + protected generateDynamicPrices(): void; + /** + * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * if no static value, return 1 + * @param tplId Item tpl id to get price for + * @returns price in roubles + */ getFleaPriceForItem(tplId: string): number; /** - * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json - * @param itemPrice price of item - * @param itemTpl item template Id being checked - * @returns adjusted price value in roubles + * get the dynamic (flea) price for an item + * Grabs prices from prices.json and stores in class if none currently exist + * @param itemTpl item template id to look up + * @returns price in roubles */ - protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; + getDynamicPriceForItem(itemTpl: string): number; + /** + * Grab the static (handbook) for an item by its tplId + * @param itemTpl item template id to look up + * @returns price in roubles + */ + getStaticPriceForItem(itemTpl: string): number; + getAllFleaPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -41,9 +59,15 @@ export declare class RagfairPriceService { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; - getStaticPriceForItem(tplId: string): number; getBarterPrice(barterScheme: IBarterScheme[]): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; + /** + * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json + * @param itemPrice price of item + * @param itemTpl item template Id being checked + * @returns adjusted price value in roubles + */ + protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; /** * Multiply the price by a randomised curve where n = 2, shift = 2 * @param existingPrice price to alter @@ -58,7 +82,7 @@ export declare class RagfairPriceService { * @param existingPrice price of existing base weapon * @returns */ - getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) diff --git a/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts b/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts index 3e6077c..d3f1b35 100644 --- a/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts @@ -9,13 +9,11 @@ import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -23,7 +21,7 @@ export declare class RepairService { protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/TypeScript/1LogToConsole/types/callbacks/DataCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/DataCallbacks.d.ts index cfb1c16..04566ff 100644 --- a/TypeScript/1LogToConsole/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/DataCallbacks.d.ts @@ -1,6 +1,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -18,7 +19,7 @@ export declare class DataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; diff --git a/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts index 06da1b5..5e4c240 100644 --- a/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts @@ -1,8 +1,10 @@ import { GameController } from "../controllers/GameController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; @@ -17,8 +19,8 @@ declare class GameCallbacks { gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData; - getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/1LogToConsole/types/controllers/CustomizationController.d.ts b/TypeScript/1LogToConsole/types/controllers/CustomizationController.d.ts index a6c4730..5fe51e3 100644 --- a/TypeScript/1LogToConsole/types/controllers/CustomizationController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/CustomizationController.d.ts @@ -5,16 +5,16 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; export declare class CustomizationController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); getTraderSuits(traderID: string, sessionID: string): ISuit[]; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts index eec7dc5..3bfbdb1 100644 --- a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts @@ -3,7 +3,9 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { Config } from "../models/eft/common/IGlobals"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; @@ -37,6 +39,6 @@ export declare class GameController { protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; - getServer(): any[]; - getValidGameVersion(): any; + getServer(): IServerDetails[]; + getValidGameVersion(): ICheckVersionResponse; } diff --git a/TypeScript/1LogToConsole/types/controllers/HealthController.d.ts b/TypeScript/1LogToConsole/types/controllers/HealthController.d.ts index cc13603..ce67993 100644 --- a/TypeScript/1LogToConsole/types/controllers/HealthController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/HealthController.d.ts @@ -8,16 +8,16 @@ import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestD import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; export declare class HealthController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile diff --git a/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts b/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts index dcd8894..ada5bd9 100644 --- a/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts @@ -19,7 +19,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -40,7 +40,7 @@ export declare class HideoutController { protected playerService: PlayerService; protected presetHelper: PresetHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected hideoutHelper: HideoutHelper; @@ -49,7 +49,7 @@ export declare class HideoutController { protected jsonUtil: JsonUtil; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts b/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts index 102a2fb..e84eea1 100644 --- a/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts @@ -8,6 +8,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -31,6 +32,7 @@ export declare class InraidController { protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; + protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; @@ -68,4 +70,5 @@ export declare class InraidController { protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void; + getAirdropConfig(): IAirdropConfig; } diff --git a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts index 6895383..14bf129 100644 --- a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; @@ -30,7 +30,7 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required + constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required insuranceService: InsuranceService, configServer: ConfigServer); processReturn(): void; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts b/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts index f564919..6a1a21e 100644 --- a/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts @@ -1,3 +1,4 @@ +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { PaymentHelper } from "../helpers/PaymentHelper"; import { PresetHelper } from "../helpers/PresetHelper"; @@ -22,7 +23,6 @@ import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryT import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { RagfairOfferService } from "../services/RagfairOfferService"; @@ -39,8 +39,8 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/1LogToConsole/types/controllers/NoteController.d.ts b/TypeScript/1LogToConsole/types/controllers/NoteController.d.ts index ee70541..9e2e250 100644 --- a/TypeScript/1LogToConsole/types/controllers/NoteController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/NoteController.d.ts @@ -1,10 +1,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; export declare class NoteController { - protected itemEventRouter: ItemEventRouter; - constructor(itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/1LogToConsole/types/controllers/PresetBuildController.d.ts b/TypeScript/1LogToConsole/types/controllers/PresetBuildController.d.ts index adf4084..65ae0c4 100644 --- a/TypeScript/1LogToConsole/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/PresetBuildController.d.ts @@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; export declare class PresetBuildController { protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); getUserBuilds(sessionID: string): WeaponBuild[]; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts index 282f50e..842207f 100644 --- a/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts @@ -11,7 +11,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -20,7 +20,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; @@ -31,7 +31,7 @@ export declare class QuestController { protected localeService: LocaleService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) diff --git a/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts b/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts index fe1f472..5440458 100644 --- a/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts @@ -24,7 +24,7 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RagfairServer } from "../servers/RagfairServer"; @@ -42,7 +42,7 @@ export declare class RagfairController { protected logger: ILogger; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; protected databaseServer: DatabaseServer; @@ -64,7 +64,7 @@ export declare class RagfairController { protected ragfairOfferGenerator: RagfairOfferGenerator; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed diff --git a/TypeScript/1LogToConsole/types/controllers/RepairController.d.ts b/TypeScript/1LogToConsole/types/controllers/RepairController.d.ts index ae54a53..fd8ff72 100644 --- a/TypeScript/1LogToConsole/types/controllers/RepairController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RepairController.d.ts @@ -7,13 +7,13 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "../services/PaymentService"; import { RepairService } from "../services/RepairService"; export declare class RepairController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -21,7 +21,7 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected repairService: RepairService; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); /** * Repair with trader * @param sessionID session id diff --git a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts index 4c31a3d..7db5886 100644 --- a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,7 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ import { ELocationName } from "../models/enums/ELocationName"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -63,13 +63,13 @@ export declare class RepeatableQuestController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected ragfairServerHelper: RagfairServerHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts b/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts index c86745c..0ed0556 100644 --- a/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts @@ -6,15 +6,15 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; declare class TradeController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/1LogToConsole/types/controllers/TraderController.d.ts b/TypeScript/1LogToConsole/types/controllers/TraderController.d.ts index b79f55e..d7afe95 100644 --- a/TypeScript/1LogToConsole/types/controllers/TraderController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/TraderController.d.ts @@ -1,3 +1,4 @@ +import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -17,8 +18,9 @@ export declare class TraderController { protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected fenceService: FenceService; + protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService diff --git a/TypeScript/1LogToConsole/types/controllers/WishlistController.d.ts b/TypeScript/1LogToConsole/types/controllers/WishlistController.d.ts index a96c522..83be4b3 100644 --- a/TypeScript/1LogToConsole/types/controllers/WishlistController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/WishlistController.d.ts @@ -1,10 +1,10 @@ -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistController { - protected itemEvenRouter: ItemEventRouter; - constructor(itemEvenRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts new file mode 100644 index 0000000..387df3a --- /dev/null +++ b/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts @@ -0,0 +1,28 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemFilterService } from "../services/ItemFilterService"; +export declare class FenceBaseAssortGenerator { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemHelper: ItemHelper; + protected itemFilterService: ItemFilterService; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + /** + * Create base fence assorts dynamically and store in db + */ + generateFenceBaseAssorts(): void; + /** + * Check if item is valid for being added to fence assorts + * @param item Item to check + * @returns true if valid fence item + */ + protected isValidFenceItem(item: ITemplateItem): boolean; +} diff --git a/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts index 66056c2..bc0d7ec 100644 --- a/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts @@ -17,8 +17,8 @@ export declare class LootGenerator { protected itemFilterService: ItemFilterService; constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); /** - * Generate a list of items based on options passed in - * @param options parameters to adjust what loot is generated + * Generate a list of items based on configuration options parameter + * @param options parameters to adjust how loot is generated * @returns An array of loot items */ createRandomloot(options: LootRequest): LootItem[]; @@ -44,7 +44,13 @@ export declare class LootGenerator { max: number; }>, options: LootRequest, result: LootItem[]): boolean; /** - * + * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values + * @param item item to get stack count of + * @param options loot options + * @returns stack count + */ + protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + /** * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts diff --git a/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts index 0dc2d61..b64a7e7 100644 --- a/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Get avatar url from trader table in db + * @param isTrader Is user we're getting avatar for a trader + * @param userId persons id to get avatar of + * @returns url of avatar + */ + protected getAvatarUrl(isTrader: boolean, userId: string): string; /** * Convert a count of currency into roubles * @param currencyCount amount of currency to convert into roubles diff --git a/TypeScript/1LogToConsole/types/helpers/DialogueHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/DialogueHelper.d.ts index d2be04d..88a726e 100644 --- a/TypeScript/1LogToConsole/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/DialogueHelper.d.ts @@ -1,6 +1,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; @@ -8,13 +9,14 @@ import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotifierHelper } from "./NotifierHelper"; export declare class DialogueHelper { + protected logger: ILogger; protected hashUtil: HashUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; protected itemHelper: ItemHelper; - constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. @@ -23,7 +25,7 @@ export declare class DialogueHelper { * @param sessionID * @param rewards */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts index b47d466..1ab7800 100644 --- a/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { DatabaseServer } from "../servers/DatabaseServer"; declare class LookupItem { byId: Record; byParent: Record; @@ -9,17 +10,35 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected lookup: LookupCollection; - hydrateLookup(lookup: LookupCollection): void; - getTemplatePrice(x: string): number; + protected databaseServer: DatabaseServer; + protected handbookPriceCache: LookupCollection; + constructor(databaseServer: DatabaseServer); + hydrateLookup(): void; + /** + * Get price from internal cache, if cache empty look up price directly in handbook (expensive) + * If no values found, return 1 + * @param tpl item tpl to look up price for + * @returns price in roubles + */ + getTemplatePrice(tpl: string): number; + /** + * all items in template with the given parent category + * @param x + * @returns string array + */ templatesWithParent(x: string): string[]; - isCategory(x: string): boolean; + /** + * Does category exist in handbook cache + * @param category + * @returns true if exists in cache + */ + isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Gets Currency to Ruble conversion Value + * Convert currency into roubles * @param {number} value * @param {string} currencyFrom - * @returns number + * @returns get rouble value of inputted currency */ inRUB(value: number, currencyFrom: string): number; /** diff --git a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts index 7495a6a..5f7e3b7 100644 --- a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts @@ -8,7 +8,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PlayerService } from "../services/PlayerService"; @@ -24,7 +24,7 @@ export declare class HideoutHelper { protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; @@ -35,7 +35,7 @@ export declare class HideoutHelper { static bitcoin: string; static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * This convinience function intialies new Production Object diff --git a/TypeScript/1LogToConsole/types/helpers/NotificationSendHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/NotificationSendHelper.d.ts index 6c56006..014ac95 100644 --- a/TypeScript/1LogToConsole/types/helpers/NotificationSendHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { HttpServer } from "../servers/HttpServer"; +import { WebSocketServer } from "../servers/WebSocketServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: HttpServer; + protected webSocketServer: WebSocketServer; protected notificationService: NotificationService; - constructor(httpServer: HttpServer, notificationService: NotificationService); + constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts index d66d150..a6b4892 100644 --- a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -25,7 +25,7 @@ export declare class QuestHelper { protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected ragfairServerHelper: RagfairServerHelper; @@ -35,7 +35,7 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, 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, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest 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 ea13aae..b73f786 100644 --- a/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts @@ -6,7 +6,7 @@ import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -27,7 +27,7 @@ export declare class RagfairOfferHelper { protected logger: ILogger; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected traderHelper: TraderHelper; protected saveServer: SaveServer; @@ -45,9 +45,15 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if trader offers' BuyRestrictionMax value has been reached + * @param offer offer to check restriction properties of + * @returns true if restriction reached, false if no restrictions/not reached + */ + protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; /** * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check diff --git a/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts index 7ab9768..2a8f0b7 100644 --- a/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts @@ -7,20 +7,20 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; export declare class TradeHelper { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); /** * Buy item from flea or trader * @param pmcData diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts index a349a6d..c5b1cb2 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,5 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -47,7 +48,7 @@ export interface AvailableForProps { compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; - status?: number[]; + status?: QuestStatus[]; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; @@ -99,7 +100,7 @@ export interface Rewards { FailRestartable: Reward[]; Expired: Reward[]; } -export interface Reward { +export interface Reward extends Item { value?: string | number; id: string; type: QuestRewardType; diff --git a/TypeScript/1LogToConsole/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/1LogToConsole/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 1d0c0e8..8a29319 100644 --- a/TypeScript/1LogToConsole/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -2,7 +2,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; Ignore: any[]; - InIgnoreList: any[]; + InIgnoreList: string[]; } export interface Friend { _id: string; diff --git a/TypeScript/1LogToConsole/types/models/eft/game/ICheckVersionResponse.d.ts b/TypeScript/1LogToConsole/types/models/eft/game/ICheckVersionResponse.d.ts new file mode 100644 index 0000000..fa8aa6f --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/eft/game/ICheckVersionResponse.d.ts @@ -0,0 +1,4 @@ +export interface ICheckVersionResponse { + isvalid: boolean; + latestVersion: string; +} diff --git a/TypeScript/1LogToConsole/types/models/eft/game/IServerDetails.d.ts b/TypeScript/1LogToConsole/types/models/eft/game/IServerDetails.d.ts new file mode 100644 index 0000000..101cf99 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/eft/game/IServerDetails.d.ts @@ -0,0 +1,4 @@ +export interface IServerDetails { + ip: string; + port: number; +} diff --git a/TypeScript/1LogToConsole/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/1LogToConsole/types/models/eft/profile/GetProfileStatusResponseData.d.ts index eee9b4f..cb7368c 100644 --- a/TypeScript/1LogToConsole/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -4,6 +4,7 @@ export interface GetProfileStatusResponseData { } export interface ProfileData { profileid: string; + profileToken: string; status: string; sid: string; ip: string; diff --git a/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts index eaa66c1..cf28c12 100644 --- a/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts @@ -37,12 +37,12 @@ export interface Dialogue { attachmentsNew: number; } export interface DialogueInfo { - _id: string; - type: MessageType; - message: MessagePreview; - pinned: boolean; - new: number; attachmentsNew: number; + new: number; + type: MessageType; + pinned: boolean; + message: MessagePreview; + _id: string; } export interface Message { _id: string; diff --git a/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts b/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts index 36ebc71..4eb6f7e 100644 --- a/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts @@ -1,6 +1,9 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", ARMOR = "5448e54d4bdc2dcc718b4568", + ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", + HEADWEAR = "5a341c4086f77401f2541505", + FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", VISORS = "5448e5724bdc2ddf718b4568", diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IAirdropConfig.d.ts index 3edcbdd..53df991 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IAirdropConfig.d.ts @@ -25,6 +25,6 @@ export interface AirdropLoot { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts index 6b1c1e3..8342c99 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts @@ -17,5 +17,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + itemPriceMult: number; + regenerateAssortsOnRefresh: boolean; + itemTypeLimits: Record; blacklist: string[]; } diff --git a/TypeScript/1LogToConsole/types/models/spt/services/LootRequest.d.ts b/TypeScript/1LogToConsole/types/models/spt/services/LootRequest.d.ts index 1da8770..8c197ee 100644 --- a/TypeScript/1LogToConsole/types/models/spt/services/LootRequest.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/services/LootRequest.d.ts @@ -6,6 +6,6 @@ export declare class LootRequest { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts b/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts new file mode 100644 index 0000000..7a2387b --- /dev/null +++ b/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts @@ -0,0 +1,11 @@ +import { JsonUtil } from "../utils/JsonUtil"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +export declare class EventOutputHolder { + protected jsonUtil: JsonUtil; + protected profileHelper: ProfileHelper; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected output: IItemEventRouterResponse; + getOutput(sessionID: string): IItemEventRouterResponse; + resetOutput(sessionID: string): void; +} diff --git a/TypeScript/1LogToConsole/types/routers/ItemEventRouter.d.ts b/TypeScript/1LogToConsole/types/routers/ItemEventRouter.d.ts index b1ac5d9..e80d16c 100644 --- a/TypeScript/1LogToConsole/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/1LogToConsole/types/routers/ItemEventRouter.d.ts @@ -1,17 +1,14 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { ItemEventRouterDefinition } from "../di/Router"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; - protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[]); - protected output: IItemEventRouterResponse; + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; - getOutput(sessionID: string): IItemEventRouterResponse; - protected resetOutput(sessionID: string): void; } diff --git a/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts b/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts index f572a8f..bbca8af 100644 --- a/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts +++ b/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts @@ -1,34 +1,24 @@ /// import http, { IncomingMessage, ServerResponse } from "http"; -import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; -import { NotifierHelper } from "../helpers/NotifierHelper"; -import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; import { IHttpListener } from "./http/IHttpListener"; +import { WebSocketServer } from "./WebSocketServer"; export declare class HttpServer { protected logger: ILogger; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); + protected webSocketServer: WebSocketServer; + constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); protected httpConfig: IHttpConfig; - protected webSockets: {}; - protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - sendMessage(sessionID: string, output: INotification): void; - isConnectionWebSocket(sessionID: string): boolean; handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; - protected getRandomisedMessage(): string; - protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/TypeScript/1LogToConsole/types/servers/WebSocketServer.d.ts b/TypeScript/1LogToConsole/types/servers/WebSocketServer.d.ts new file mode 100644 index 0000000..f33d214 --- /dev/null +++ b/TypeScript/1LogToConsole/types/servers/WebSocketServer.d.ts @@ -0,0 +1,25 @@ +/// +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import WebSocket from "ws"; +import http, { IncomingMessage } from "http"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { RandomUtil } from "../utils/RandomUtil"; +import { INotification } from "../models/eft/notifier/INotifier"; +import { ConfigServer } from "./ConfigServer"; +import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +export declare class WebSocketServer { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected configServer: ConfigServer; + protected httpServerHelper: HttpServerHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, httpServerHelper: HttpServerHelper); + protected httpConfig: IHttpConfig; + protected defaultNotification: INotification; + protected webSockets: Record; + protected websocketPingHandler: any; + setupWebSocket(httpServer: http.Server): void; + sendMessage(sessionID: string, output: INotification): void; + protected getRandomisedMessage(): string; + isConnectionWebSocket(sessionID: string): boolean; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; +} diff --git a/TypeScript/1LogToConsole/types/services/FenceService.d.ts b/TypeScript/1LogToConsole/types/services/FenceService.d.ts index 23fbf52..bdcdeb2 100644 --- a/TypeScript/1LogToConsole/types/services/FenceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/FenceService.d.ts @@ -3,6 +3,8 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -41,6 +43,13 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item + * @param assort + * @param modifier + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -96,6 +105,21 @@ export declare class FenceService { * @param assorts object to add assorts to */ protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + /** + * Randomise items' upd properties e.g. med packs/weapons/armor + * @param itemDetails Item being randomised + * @param itemToAdjust Item being edited + */ + protected randomiseItemUpdProperties(itemDetails: ITemplateItem, itemToAdjust: Item): void; + /** + * Construct item limit record to hold max and current item count + * @param limits limits as defined in config + * @returns record, key: item tplId, value: current/max item count allowed + */ + protected initItemLimitCounter(limits: Record): Record; /** * Get the next update timestamp for fence * @returns future timestamp diff --git a/TypeScript/1LogToConsole/types/services/ItemFilterService.d.ts b/TypeScript/1LogToConsole/types/services/ItemFilterService.d.ts index c9c8ef3..b830d74 100644 --- a/TypeScript/1LogToConsole/types/services/ItemFilterService.d.ts +++ b/TypeScript/1LogToConsole/types/services/ItemFilterService.d.ts @@ -2,7 +2,7 @@ import { IItemConfig } from "../models/spt/config/IItemConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */ +/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; protected databaseServer: DatabaseServer; diff --git a/TypeScript/1LogToConsole/types/services/RagfairOfferService.d.ts b/TypeScript/1LogToConsole/types/services/RagfairOfferService.d.ts index f9e3a34..a6f6b6d 100644 --- a/TypeScript/1LogToConsole/types/services/RagfairOfferService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RagfairOfferService.d.ts @@ -5,7 +5,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -20,14 +20,14 @@ export declare class RagfairOfferService { protected ragfairServerHelper: RagfairServerHelper; protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; protected expiredOffers: Item[]; protected offers: IRagfairOffer[]; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts b/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts index 466c9e3..4ac7794 100644 --- a/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts @@ -10,7 +10,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -export declare class RagfairPriceService { +import { OnLoad } from "../di/OnLoad"; +export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; @@ -19,21 +20,38 @@ export declare class RagfairPriceService { protected randomUtil: RandomUtil; 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, randomUtil: RandomUtil, configServer: ConfigServer); + onLoad(): void; + getRoute(): string; + /** + * Iterate over all items of type "Item" in db and get template price, store in cache + */ generateStaticPrices(): void; - generateDynamicPrices(): void; - hasDynamicPrices(): boolean; - getDynamicPrice(itemTpl: string): number; - getAllFleaPrices(): Record; + protected generateDynamicPrices(): void; + /** + * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * if no static value, return 1 + * @param tplId Item tpl id to get price for + * @returns price in roubles + */ getFleaPriceForItem(tplId: string): number; /** - * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json - * @param itemPrice price of item - * @param itemTpl item template Id being checked - * @returns adjusted price value in roubles + * get the dynamic (flea) price for an item + * Grabs prices from prices.json and stores in class if none currently exist + * @param itemTpl item template id to look up + * @returns price in roubles */ - protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; + getDynamicPriceForItem(itemTpl: string): number; + /** + * Grab the static (handbook) for an item by its tplId + * @param itemTpl item template id to look up + * @returns price in roubles + */ + getStaticPriceForItem(itemTpl: string): number; + getAllFleaPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -41,9 +59,15 @@ export declare class RagfairPriceService { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; - getStaticPriceForItem(tplId: string): number; getBarterPrice(barterScheme: IBarterScheme[]): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; + /** + * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json + * @param itemPrice price of item + * @param itemTpl item template Id being checked + * @returns adjusted price value in roubles + */ + protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; /** * Multiply the price by a randomised curve where n = 2, shift = 2 * @param existingPrice price to alter @@ -58,7 +82,7 @@ export declare class RagfairPriceService { * @param existingPrice price of existing base weapon * @returns */ - getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) diff --git a/TypeScript/1LogToConsole/types/services/RepairService.d.ts b/TypeScript/1LogToConsole/types/services/RepairService.d.ts index 3e6077c..d3f1b35 100644 --- a/TypeScript/1LogToConsole/types/services/RepairService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RepairService.d.ts @@ -9,13 +9,11 @@ import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -23,7 +21,7 @@ export declare class RepairService { protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/TypeScript/2EditDatabase/types/callbacks/DataCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/DataCallbacks.d.ts index cfb1c16..04566ff 100644 --- a/TypeScript/2EditDatabase/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/DataCallbacks.d.ts @@ -1,6 +1,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -18,7 +19,7 @@ export declare class DataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; diff --git a/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts index 06da1b5..5e4c240 100644 --- a/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts @@ -1,8 +1,10 @@ import { GameController } from "../controllers/GameController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; @@ -17,8 +19,8 @@ declare class GameCallbacks { gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData; - getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/2EditDatabase/types/controllers/CustomizationController.d.ts b/TypeScript/2EditDatabase/types/controllers/CustomizationController.d.ts index a6c4730..5fe51e3 100644 --- a/TypeScript/2EditDatabase/types/controllers/CustomizationController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/CustomizationController.d.ts @@ -5,16 +5,16 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; export declare class CustomizationController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); getTraderSuits(traderID: string, sessionID: string): ISuit[]; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/2EditDatabase/types/controllers/GameController.d.ts b/TypeScript/2EditDatabase/types/controllers/GameController.d.ts index eec7dc5..3bfbdb1 100644 --- a/TypeScript/2EditDatabase/types/controllers/GameController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/GameController.d.ts @@ -3,7 +3,9 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { Config } from "../models/eft/common/IGlobals"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; @@ -37,6 +39,6 @@ export declare class GameController { protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; - getServer(): any[]; - getValidGameVersion(): any; + getServer(): IServerDetails[]; + getValidGameVersion(): ICheckVersionResponse; } diff --git a/TypeScript/2EditDatabase/types/controllers/HealthController.d.ts b/TypeScript/2EditDatabase/types/controllers/HealthController.d.ts index cc13603..ce67993 100644 --- a/TypeScript/2EditDatabase/types/controllers/HealthController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/HealthController.d.ts @@ -8,16 +8,16 @@ import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestD import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; export declare class HealthController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile diff --git a/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts b/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts index dcd8894..ada5bd9 100644 --- a/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts @@ -19,7 +19,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -40,7 +40,7 @@ export declare class HideoutController { protected playerService: PlayerService; protected presetHelper: PresetHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected hideoutHelper: HideoutHelper; @@ -49,7 +49,7 @@ export declare class HideoutController { protected jsonUtil: JsonUtil; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/TypeScript/2EditDatabase/types/controllers/InraidController.d.ts b/TypeScript/2EditDatabase/types/controllers/InraidController.d.ts index 102a2fb..e84eea1 100644 --- a/TypeScript/2EditDatabase/types/controllers/InraidController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InraidController.d.ts @@ -8,6 +8,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -31,6 +32,7 @@ export declare class InraidController { protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; + protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; @@ -68,4 +70,5 @@ export declare class InraidController { protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void; + getAirdropConfig(): IAirdropConfig; } diff --git a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts index 6895383..14bf129 100644 --- a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; @@ -30,7 +30,7 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required + constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required insuranceService: InsuranceService, configServer: ConfigServer); processReturn(): void; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts b/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts index f564919..6a1a21e 100644 --- a/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts @@ -1,3 +1,4 @@ +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { PaymentHelper } from "../helpers/PaymentHelper"; import { PresetHelper } from "../helpers/PresetHelper"; @@ -22,7 +23,6 @@ import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryT import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { RagfairOfferService } from "../services/RagfairOfferService"; @@ -39,8 +39,8 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/2EditDatabase/types/controllers/NoteController.d.ts b/TypeScript/2EditDatabase/types/controllers/NoteController.d.ts index ee70541..9e2e250 100644 --- a/TypeScript/2EditDatabase/types/controllers/NoteController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/NoteController.d.ts @@ -1,10 +1,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; export declare class NoteController { - protected itemEventRouter: ItemEventRouter; - constructor(itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/2EditDatabase/types/controllers/PresetBuildController.d.ts b/TypeScript/2EditDatabase/types/controllers/PresetBuildController.d.ts index adf4084..65ae0c4 100644 --- a/TypeScript/2EditDatabase/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/PresetBuildController.d.ts @@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; export declare class PresetBuildController { protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); getUserBuilds(sessionID: string): WeaponBuild[]; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts b/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts index 282f50e..842207f 100644 --- a/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts @@ -11,7 +11,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -20,7 +20,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; @@ -31,7 +31,7 @@ export declare class QuestController { protected localeService: LocaleService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) diff --git a/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts b/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts index fe1f472..5440458 100644 --- a/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts @@ -24,7 +24,7 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RagfairServer } from "../servers/RagfairServer"; @@ -42,7 +42,7 @@ export declare class RagfairController { protected logger: ILogger; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; protected databaseServer: DatabaseServer; @@ -64,7 +64,7 @@ export declare class RagfairController { protected ragfairOfferGenerator: RagfairOfferGenerator; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed diff --git a/TypeScript/2EditDatabase/types/controllers/RepairController.d.ts b/TypeScript/2EditDatabase/types/controllers/RepairController.d.ts index ae54a53..fd8ff72 100644 --- a/TypeScript/2EditDatabase/types/controllers/RepairController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/RepairController.d.ts @@ -7,13 +7,13 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "../services/PaymentService"; import { RepairService } from "../services/RepairService"; export declare class RepairController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -21,7 +21,7 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected repairService: RepairService; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); /** * Repair with trader * @param sessionID session id diff --git a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts index 4c31a3d..7db5886 100644 --- a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,7 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ import { ELocationName } from "../models/enums/ELocationName"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -63,13 +63,13 @@ export declare class RepeatableQuestController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected ragfairServerHelper: RagfairServerHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts b/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts index c86745c..0ed0556 100644 --- a/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts @@ -6,15 +6,15 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; declare class TradeController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/2EditDatabase/types/controllers/TraderController.d.ts b/TypeScript/2EditDatabase/types/controllers/TraderController.d.ts index b79f55e..d7afe95 100644 --- a/TypeScript/2EditDatabase/types/controllers/TraderController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/TraderController.d.ts @@ -1,3 +1,4 @@ +import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -17,8 +18,9 @@ export declare class TraderController { protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected fenceService: FenceService; + protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService diff --git a/TypeScript/2EditDatabase/types/controllers/WishlistController.d.ts b/TypeScript/2EditDatabase/types/controllers/WishlistController.d.ts index a96c522..83be4b3 100644 --- a/TypeScript/2EditDatabase/types/controllers/WishlistController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/WishlistController.d.ts @@ -1,10 +1,10 @@ -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistController { - protected itemEvenRouter: ItemEventRouter; - constructor(itemEvenRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/2EditDatabase/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/FenceBaseAssortGenerator.d.ts new file mode 100644 index 0000000..387df3a --- /dev/null +++ b/TypeScript/2EditDatabase/types/generators/FenceBaseAssortGenerator.d.ts @@ -0,0 +1,28 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemFilterService } from "../services/ItemFilterService"; +export declare class FenceBaseAssortGenerator { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemHelper: ItemHelper; + protected itemFilterService: ItemFilterService; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + /** + * Create base fence assorts dynamically and store in db + */ + generateFenceBaseAssorts(): void; + /** + * Check if item is valid for being added to fence assorts + * @param item Item to check + * @returns true if valid fence item + */ + protected isValidFenceItem(item: ITemplateItem): boolean; +} diff --git a/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts index 66056c2..bc0d7ec 100644 --- a/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts @@ -17,8 +17,8 @@ export declare class LootGenerator { protected itemFilterService: ItemFilterService; constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); /** - * Generate a list of items based on options passed in - * @param options parameters to adjust what loot is generated + * Generate a list of items based on configuration options parameter + * @param options parameters to adjust how loot is generated * @returns An array of loot items */ createRandomloot(options: LootRequest): LootItem[]; @@ -44,7 +44,13 @@ export declare class LootGenerator { max: number; }>, options: LootRequest, result: LootItem[]): boolean; /** - * + * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values + * @param item item to get stack count of + * @param options loot options + * @returns stack count + */ + protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + /** * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts diff --git a/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts index 0dc2d61..b64a7e7 100644 --- a/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Get avatar url from trader table in db + * @param isTrader Is user we're getting avatar for a trader + * @param userId persons id to get avatar of + * @returns url of avatar + */ + protected getAvatarUrl(isTrader: boolean, userId: string): string; /** * Convert a count of currency into roubles * @param currencyCount amount of currency to convert into roubles diff --git a/TypeScript/2EditDatabase/types/helpers/DialogueHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/DialogueHelper.d.ts index d2be04d..88a726e 100644 --- a/TypeScript/2EditDatabase/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/DialogueHelper.d.ts @@ -1,6 +1,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; @@ -8,13 +9,14 @@ import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotifierHelper } from "./NotifierHelper"; export declare class DialogueHelper { + protected logger: ILogger; protected hashUtil: HashUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; protected itemHelper: ItemHelper; - constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. @@ -23,7 +25,7 @@ export declare class DialogueHelper { * @param sessionID * @param rewards */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/2EditDatabase/types/helpers/HandbookHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/HandbookHelper.d.ts index b47d466..1ab7800 100644 --- a/TypeScript/2EditDatabase/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { DatabaseServer } from "../servers/DatabaseServer"; declare class LookupItem { byId: Record; byParent: Record; @@ -9,17 +10,35 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected lookup: LookupCollection; - hydrateLookup(lookup: LookupCollection): void; - getTemplatePrice(x: string): number; + protected databaseServer: DatabaseServer; + protected handbookPriceCache: LookupCollection; + constructor(databaseServer: DatabaseServer); + hydrateLookup(): void; + /** + * Get price from internal cache, if cache empty look up price directly in handbook (expensive) + * If no values found, return 1 + * @param tpl item tpl to look up price for + * @returns price in roubles + */ + getTemplatePrice(tpl: string): number; + /** + * all items in template with the given parent category + * @param x + * @returns string array + */ templatesWithParent(x: string): string[]; - isCategory(x: string): boolean; + /** + * Does category exist in handbook cache + * @param category + * @returns true if exists in cache + */ + isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Gets Currency to Ruble conversion Value + * Convert currency into roubles * @param {number} value * @param {string} currencyFrom - * @returns number + * @returns get rouble value of inputted currency */ inRUB(value: number, currencyFrom: string): number; /** diff --git a/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts index 7495a6a..5f7e3b7 100644 --- a/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts @@ -8,7 +8,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PlayerService } from "../services/PlayerService"; @@ -24,7 +24,7 @@ export declare class HideoutHelper { protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; @@ -35,7 +35,7 @@ export declare class HideoutHelper { static bitcoin: string; static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * This convinience function intialies new Production Object diff --git a/TypeScript/2EditDatabase/types/helpers/NotificationSendHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/NotificationSendHelper.d.ts index 6c56006..014ac95 100644 --- a/TypeScript/2EditDatabase/types/helpers/NotificationSendHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { HttpServer } from "../servers/HttpServer"; +import { WebSocketServer } from "../servers/WebSocketServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: HttpServer; + protected webSocketServer: WebSocketServer; protected notificationService: NotificationService; - constructor(httpServer: HttpServer, notificationService: NotificationService); + constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts index d66d150..a6b4892 100644 --- a/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -25,7 +25,7 @@ export declare class QuestHelper { protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected ragfairServerHelper: RagfairServerHelper; @@ -35,7 +35,7 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, 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, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search diff --git a/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts index ea13aae..b73f786 100644 --- a/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts @@ -6,7 +6,7 @@ import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -27,7 +27,7 @@ export declare class RagfairOfferHelper { protected logger: ILogger; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected traderHelper: TraderHelper; protected saveServer: SaveServer; @@ -45,9 +45,15 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if trader offers' BuyRestrictionMax value has been reached + * @param offer offer to check restriction properties of + * @returns true if restriction reached, false if no restrictions/not reached + */ + protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; /** * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check diff --git a/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts index 7ab9768..2a8f0b7 100644 --- a/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts @@ -7,20 +7,20 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; export declare class TradeHelper { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); /** * Buy item from flea or trader * @param pmcData diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts index a349a6d..c5b1cb2 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,5 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -47,7 +48,7 @@ export interface AvailableForProps { compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; - status?: number[]; + status?: QuestStatus[]; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; @@ -99,7 +100,7 @@ export interface Rewards { FailRestartable: Reward[]; Expired: Reward[]; } -export interface Reward { +export interface Reward extends Item { value?: string | number; id: string; type: QuestRewardType; diff --git a/TypeScript/2EditDatabase/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/2EditDatabase/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 1d0c0e8..8a29319 100644 --- a/TypeScript/2EditDatabase/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -2,7 +2,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; Ignore: any[]; - InIgnoreList: any[]; + InIgnoreList: string[]; } export interface Friend { _id: string; diff --git a/TypeScript/2EditDatabase/types/models/eft/game/ICheckVersionResponse.d.ts b/TypeScript/2EditDatabase/types/models/eft/game/ICheckVersionResponse.d.ts new file mode 100644 index 0000000..fa8aa6f --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/eft/game/ICheckVersionResponse.d.ts @@ -0,0 +1,4 @@ +export interface ICheckVersionResponse { + isvalid: boolean; + latestVersion: string; +} diff --git a/TypeScript/2EditDatabase/types/models/eft/game/IServerDetails.d.ts b/TypeScript/2EditDatabase/types/models/eft/game/IServerDetails.d.ts new file mode 100644 index 0000000..101cf99 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/eft/game/IServerDetails.d.ts @@ -0,0 +1,4 @@ +export interface IServerDetails { + ip: string; + port: number; +} diff --git a/TypeScript/2EditDatabase/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/2EditDatabase/types/models/eft/profile/GetProfileStatusResponseData.d.ts index eee9b4f..cb7368c 100644 --- a/TypeScript/2EditDatabase/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -4,6 +4,7 @@ export interface GetProfileStatusResponseData { } export interface ProfileData { profileid: string; + profileToken: string; status: string; sid: string; ip: string; diff --git a/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts index eaa66c1..cf28c12 100644 --- a/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts @@ -37,12 +37,12 @@ export interface Dialogue { attachmentsNew: number; } export interface DialogueInfo { - _id: string; - type: MessageType; - message: MessagePreview; - pinned: boolean; - new: number; attachmentsNew: number; + new: number; + type: MessageType; + pinned: boolean; + message: MessagePreview; + _id: string; } export interface Message { _id: string; diff --git a/TypeScript/2EditDatabase/types/models/enums/BaseClasses.d.ts b/TypeScript/2EditDatabase/types/models/enums/BaseClasses.d.ts index 36ebc71..4eb6f7e 100644 --- a/TypeScript/2EditDatabase/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/BaseClasses.d.ts @@ -1,6 +1,9 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", ARMOR = "5448e54d4bdc2dcc718b4568", + ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", + HEADWEAR = "5a341c4086f77401f2541505", + FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", VISORS = "5448e5724bdc2ddf718b4568", diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IAirdropConfig.d.ts index 3edcbdd..53df991 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IAirdropConfig.d.ts @@ -25,6 +25,6 @@ export interface AirdropLoot { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts index 6b1c1e3..8342c99 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts @@ -17,5 +17,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + itemPriceMult: number; + regenerateAssortsOnRefresh: boolean; + itemTypeLimits: Record; blacklist: string[]; } diff --git a/TypeScript/2EditDatabase/types/models/spt/services/LootRequest.d.ts b/TypeScript/2EditDatabase/types/models/spt/services/LootRequest.d.ts index 1da8770..8c197ee 100644 --- a/TypeScript/2EditDatabase/types/models/spt/services/LootRequest.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/services/LootRequest.d.ts @@ -6,6 +6,6 @@ export declare class LootRequest { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/2EditDatabase/types/routers/EventOutputHolder.d.ts b/TypeScript/2EditDatabase/types/routers/EventOutputHolder.d.ts new file mode 100644 index 0000000..7a2387b --- /dev/null +++ b/TypeScript/2EditDatabase/types/routers/EventOutputHolder.d.ts @@ -0,0 +1,11 @@ +import { JsonUtil } from "../utils/JsonUtil"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +export declare class EventOutputHolder { + protected jsonUtil: JsonUtil; + protected profileHelper: ProfileHelper; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected output: IItemEventRouterResponse; + getOutput(sessionID: string): IItemEventRouterResponse; + resetOutput(sessionID: string): void; +} diff --git a/TypeScript/2EditDatabase/types/routers/ItemEventRouter.d.ts b/TypeScript/2EditDatabase/types/routers/ItemEventRouter.d.ts index b1ac5d9..e80d16c 100644 --- a/TypeScript/2EditDatabase/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/2EditDatabase/types/routers/ItemEventRouter.d.ts @@ -1,17 +1,14 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { ItemEventRouterDefinition } from "../di/Router"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; - protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[]); - protected output: IItemEventRouterResponse; + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; - getOutput(sessionID: string): IItemEventRouterResponse; - protected resetOutput(sessionID: string): void; } diff --git a/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts b/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts index f572a8f..bbca8af 100644 --- a/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts +++ b/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts @@ -1,34 +1,24 @@ /// import http, { IncomingMessage, ServerResponse } from "http"; -import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; -import { NotifierHelper } from "../helpers/NotifierHelper"; -import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; import { IHttpListener } from "./http/IHttpListener"; +import { WebSocketServer } from "./WebSocketServer"; export declare class HttpServer { protected logger: ILogger; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); + protected webSocketServer: WebSocketServer; + constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); protected httpConfig: IHttpConfig; - protected webSockets: {}; - protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - sendMessage(sessionID: string, output: INotification): void; - isConnectionWebSocket(sessionID: string): boolean; handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; - protected getRandomisedMessage(): string; - protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/TypeScript/2EditDatabase/types/servers/WebSocketServer.d.ts b/TypeScript/2EditDatabase/types/servers/WebSocketServer.d.ts new file mode 100644 index 0000000..f33d214 --- /dev/null +++ b/TypeScript/2EditDatabase/types/servers/WebSocketServer.d.ts @@ -0,0 +1,25 @@ +/// +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import WebSocket from "ws"; +import http, { IncomingMessage } from "http"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { RandomUtil } from "../utils/RandomUtil"; +import { INotification } from "../models/eft/notifier/INotifier"; +import { ConfigServer } from "./ConfigServer"; +import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +export declare class WebSocketServer { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected configServer: ConfigServer; + protected httpServerHelper: HttpServerHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, httpServerHelper: HttpServerHelper); + protected httpConfig: IHttpConfig; + protected defaultNotification: INotification; + protected webSockets: Record; + protected websocketPingHandler: any; + setupWebSocket(httpServer: http.Server): void; + sendMessage(sessionID: string, output: INotification): void; + protected getRandomisedMessage(): string; + isConnectionWebSocket(sessionID: string): boolean; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; +} diff --git a/TypeScript/2EditDatabase/types/services/FenceService.d.ts b/TypeScript/2EditDatabase/types/services/FenceService.d.ts index 23fbf52..bdcdeb2 100644 --- a/TypeScript/2EditDatabase/types/services/FenceService.d.ts +++ b/TypeScript/2EditDatabase/types/services/FenceService.d.ts @@ -3,6 +3,8 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -41,6 +43,13 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item + * @param assort + * @param modifier + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -96,6 +105,21 @@ export declare class FenceService { * @param assorts object to add assorts to */ protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + /** + * Randomise items' upd properties e.g. med packs/weapons/armor + * @param itemDetails Item being randomised + * @param itemToAdjust Item being edited + */ + protected randomiseItemUpdProperties(itemDetails: ITemplateItem, itemToAdjust: Item): void; + /** + * Construct item limit record to hold max and current item count + * @param limits limits as defined in config + * @returns record, key: item tplId, value: current/max item count allowed + */ + protected initItemLimitCounter(limits: Record): Record; /** * Get the next update timestamp for fence * @returns future timestamp diff --git a/TypeScript/2EditDatabase/types/services/ItemFilterService.d.ts b/TypeScript/2EditDatabase/types/services/ItemFilterService.d.ts index c9c8ef3..b830d74 100644 --- a/TypeScript/2EditDatabase/types/services/ItemFilterService.d.ts +++ b/TypeScript/2EditDatabase/types/services/ItemFilterService.d.ts @@ -2,7 +2,7 @@ import { IItemConfig } from "../models/spt/config/IItemConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */ +/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; protected databaseServer: DatabaseServer; diff --git a/TypeScript/2EditDatabase/types/services/RagfairOfferService.d.ts b/TypeScript/2EditDatabase/types/services/RagfairOfferService.d.ts index f9e3a34..a6f6b6d 100644 --- a/TypeScript/2EditDatabase/types/services/RagfairOfferService.d.ts +++ b/TypeScript/2EditDatabase/types/services/RagfairOfferService.d.ts @@ -5,7 +5,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -20,14 +20,14 @@ export declare class RagfairOfferService { protected ragfairServerHelper: RagfairServerHelper; protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; protected expiredOffers: Item[]; protected offers: IRagfairOffer[]; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts b/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts index 466c9e3..4ac7794 100644 --- a/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts +++ b/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts @@ -10,7 +10,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -export declare class RagfairPriceService { +import { OnLoad } from "../di/OnLoad"; +export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; @@ -19,21 +20,38 @@ export declare class RagfairPriceService { protected randomUtil: RandomUtil; 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, randomUtil: RandomUtil, configServer: ConfigServer); + onLoad(): void; + getRoute(): string; + /** + * Iterate over all items of type "Item" in db and get template price, store in cache + */ generateStaticPrices(): void; - generateDynamicPrices(): void; - hasDynamicPrices(): boolean; - getDynamicPrice(itemTpl: string): number; - getAllFleaPrices(): Record; + protected generateDynamicPrices(): void; + /** + * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * if no static value, return 1 + * @param tplId Item tpl id to get price for + * @returns price in roubles + */ getFleaPriceForItem(tplId: string): number; /** - * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json - * @param itemPrice price of item - * @param itemTpl item template Id being checked - * @returns adjusted price value in roubles + * get the dynamic (flea) price for an item + * Grabs prices from prices.json and stores in class if none currently exist + * @param itemTpl item template id to look up + * @returns price in roubles */ - protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; + getDynamicPriceForItem(itemTpl: string): number; + /** + * Grab the static (handbook) for an item by its tplId + * @param itemTpl item template id to look up + * @returns price in roubles + */ + getStaticPriceForItem(itemTpl: string): number; + getAllFleaPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -41,9 +59,15 @@ export declare class RagfairPriceService { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; - getStaticPriceForItem(tplId: string): number; getBarterPrice(barterScheme: IBarterScheme[]): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; + /** + * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json + * @param itemPrice price of item + * @param itemTpl item template Id being checked + * @returns adjusted price value in roubles + */ + protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; /** * Multiply the price by a randomised curve where n = 2, shift = 2 * @param existingPrice price to alter @@ -58,7 +82,7 @@ export declare class RagfairPriceService { * @param existingPrice price of existing base weapon * @returns */ - getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) diff --git a/TypeScript/2EditDatabase/types/services/RepairService.d.ts b/TypeScript/2EditDatabase/types/services/RepairService.d.ts index 3e6077c..d3f1b35 100644 --- a/TypeScript/2EditDatabase/types/services/RepairService.d.ts +++ b/TypeScript/2EditDatabase/types/services/RepairService.d.ts @@ -9,13 +9,11 @@ import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -23,7 +21,7 @@ export declare class RepairService { protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/DataCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/DataCallbacks.d.ts index cfb1c16..04566ff 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/DataCallbacks.d.ts @@ -1,6 +1,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -18,7 +19,7 @@ export declare class DataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts index 06da1b5..5e4c240 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts @@ -1,8 +1,10 @@ import { GameController } from "../controllers/GameController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; @@ -17,8 +19,8 @@ declare class GameCallbacks { gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData; - getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/CustomizationController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/CustomizationController.d.ts index a6c4730..5fe51e3 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/CustomizationController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/CustomizationController.d.ts @@ -5,16 +5,16 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; export declare class CustomizationController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); getTraderSuits(traderID: string, sessionID: string): ISuit[]; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts index eec7dc5..3bfbdb1 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts @@ -3,7 +3,9 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { Config } from "../models/eft/common/IGlobals"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; @@ -37,6 +39,6 @@ export declare class GameController { protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; - getServer(): any[]; - getValidGameVersion(): any; + getServer(): IServerDetails[]; + getValidGameVersion(): ICheckVersionResponse; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/HealthController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/HealthController.d.ts index cc13603..ce67993 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/HealthController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/HealthController.d.ts @@ -8,16 +8,16 @@ import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestD import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; export declare class HealthController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile diff --git a/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts index dcd8894..ada5bd9 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts @@ -19,7 +19,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -40,7 +40,7 @@ export declare class HideoutController { protected playerService: PlayerService; protected presetHelper: PresetHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected hideoutHelper: HideoutHelper; @@ -49,7 +49,7 @@ export declare class HideoutController { protected jsonUtil: JsonUtil; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InraidController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InraidController.d.ts index 102a2fb..e84eea1 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InraidController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InraidController.d.ts @@ -8,6 +8,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -31,6 +32,7 @@ export declare class InraidController { protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; + protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; @@ -68,4 +70,5 @@ export declare class InraidController { protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void; + getAirdropConfig(): IAirdropConfig; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts index 6895383..14bf129 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; @@ -30,7 +30,7 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required + constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required insuranceService: InsuranceService, configServer: ConfigServer); processReturn(): void; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts index f564919..6a1a21e 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts @@ -1,3 +1,4 @@ +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { PaymentHelper } from "../helpers/PaymentHelper"; import { PresetHelper } from "../helpers/PresetHelper"; @@ -22,7 +23,6 @@ import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryT import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { RagfairOfferService } from "../services/RagfairOfferService"; @@ -39,8 +39,8 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/3GetSptConfigFile/types/controllers/NoteController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/NoteController.d.ts index ee70541..9e2e250 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/NoteController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/NoteController.d.ts @@ -1,10 +1,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; export declare class NoteController { - protected itemEventRouter: ItemEventRouter; - constructor(itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/PresetBuildController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/PresetBuildController.d.ts index adf4084..65ae0c4 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/PresetBuildController.d.ts @@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; export declare class PresetBuildController { protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); getUserBuilds(sessionID: string): WeaponBuild[]; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts index 282f50e..842207f 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts @@ -11,7 +11,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -20,7 +20,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; @@ -31,7 +31,7 @@ export declare class QuestController { protected localeService: LocaleService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) diff --git a/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts index fe1f472..5440458 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts @@ -24,7 +24,7 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RagfairServer } from "../servers/RagfairServer"; @@ -42,7 +42,7 @@ export declare class RagfairController { protected logger: ILogger; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; protected databaseServer: DatabaseServer; @@ -64,7 +64,7 @@ export declare class RagfairController { protected ragfairOfferGenerator: RagfairOfferGenerator; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed diff --git a/TypeScript/3GetSptConfigFile/types/controllers/RepairController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/RepairController.d.ts index ae54a53..fd8ff72 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/RepairController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/RepairController.d.ts @@ -7,13 +7,13 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "../services/PaymentService"; import { RepairService } from "../services/RepairService"; export declare class RepairController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -21,7 +21,7 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected repairService: RepairService; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); /** * Repair with trader * @param sessionID session id diff --git a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts index 4c31a3d..7db5886 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,7 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ import { ELocationName } from "../models/enums/ELocationName"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -63,13 +63,13 @@ export declare class RepeatableQuestController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected ragfairServerHelper: RagfairServerHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts index c86745c..0ed0556 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts @@ -6,15 +6,15 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; declare class TradeController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/TraderController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/TraderController.d.ts index b79f55e..d7afe95 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/TraderController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/TraderController.d.ts @@ -1,3 +1,4 @@ +import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -17,8 +18,9 @@ export declare class TraderController { protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected fenceService: FenceService; + protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService diff --git a/TypeScript/3GetSptConfigFile/types/controllers/WishlistController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/WishlistController.d.ts index a96c522..83be4b3 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/WishlistController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/WishlistController.d.ts @@ -1,10 +1,10 @@ -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistController { - protected itemEvenRouter: ItemEventRouter; - constructor(itemEvenRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/3GetSptConfigFile/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/FenceBaseAssortGenerator.d.ts new file mode 100644 index 0000000..387df3a --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/generators/FenceBaseAssortGenerator.d.ts @@ -0,0 +1,28 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemFilterService } from "../services/ItemFilterService"; +export declare class FenceBaseAssortGenerator { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemHelper: ItemHelper; + protected itemFilterService: ItemFilterService; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + /** + * Create base fence assorts dynamically and store in db + */ + generateFenceBaseAssorts(): void; + /** + * Check if item is valid for being added to fence assorts + * @param item Item to check + * @returns true if valid fence item + */ + protected isValidFenceItem(item: ITemplateItem): boolean; +} diff --git a/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts index 66056c2..bc0d7ec 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts @@ -17,8 +17,8 @@ export declare class LootGenerator { protected itemFilterService: ItemFilterService; constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); /** - * Generate a list of items based on options passed in - * @param options parameters to adjust what loot is generated + * Generate a list of items based on configuration options parameter + * @param options parameters to adjust how loot is generated * @returns An array of loot items */ createRandomloot(options: LootRequest): LootItem[]; @@ -44,7 +44,13 @@ export declare class LootGenerator { max: number; }>, options: LootRequest, result: LootItem[]): boolean; /** - * + * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values + * @param item item to get stack count of + * @param options loot options + * @returns stack count + */ + protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + /** * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts diff --git a/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts index 0dc2d61..b64a7e7 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Get avatar url from trader table in db + * @param isTrader Is user we're getting avatar for a trader + * @param userId persons id to get avatar of + * @returns url of avatar + */ + protected getAvatarUrl(isTrader: boolean, userId: string): string; /** * Convert a count of currency into roubles * @param currencyCount amount of currency to convert into roubles diff --git a/TypeScript/3GetSptConfigFile/types/helpers/DialogueHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/DialogueHelper.d.ts index d2be04d..88a726e 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/DialogueHelper.d.ts @@ -1,6 +1,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; @@ -8,13 +9,14 @@ import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotifierHelper } from "./NotifierHelper"; export declare class DialogueHelper { + protected logger: ILogger; protected hashUtil: HashUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; protected itemHelper: ItemHelper; - constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. @@ -23,7 +25,7 @@ export declare class DialogueHelper { * @param sessionID * @param rewards */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/3GetSptConfigFile/types/helpers/HandbookHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/HandbookHelper.d.ts index b47d466..1ab7800 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { DatabaseServer } from "../servers/DatabaseServer"; declare class LookupItem { byId: Record; byParent: Record; @@ -9,17 +10,35 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected lookup: LookupCollection; - hydrateLookup(lookup: LookupCollection): void; - getTemplatePrice(x: string): number; + protected databaseServer: DatabaseServer; + protected handbookPriceCache: LookupCollection; + constructor(databaseServer: DatabaseServer); + hydrateLookup(): void; + /** + * Get price from internal cache, if cache empty look up price directly in handbook (expensive) + * If no values found, return 1 + * @param tpl item tpl to look up price for + * @returns price in roubles + */ + getTemplatePrice(tpl: string): number; + /** + * all items in template with the given parent category + * @param x + * @returns string array + */ templatesWithParent(x: string): string[]; - isCategory(x: string): boolean; + /** + * Does category exist in handbook cache + * @param category + * @returns true if exists in cache + */ + isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Gets Currency to Ruble conversion Value + * Convert currency into roubles * @param {number} value * @param {string} currencyFrom - * @returns number + * @returns get rouble value of inputted currency */ inRUB(value: number, currencyFrom: string): number; /** diff --git a/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts index 7495a6a..5f7e3b7 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts @@ -8,7 +8,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PlayerService } from "../services/PlayerService"; @@ -24,7 +24,7 @@ export declare class HideoutHelper { protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; @@ -35,7 +35,7 @@ export declare class HideoutHelper { static bitcoin: string; static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * This convinience function intialies new Production Object diff --git a/TypeScript/3GetSptConfigFile/types/helpers/NotificationSendHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/NotificationSendHelper.d.ts index 6c56006..014ac95 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/NotificationSendHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { HttpServer } from "../servers/HttpServer"; +import { WebSocketServer } from "../servers/WebSocketServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: HttpServer; + protected webSocketServer: WebSocketServer; protected notificationService: NotificationService; - constructor(httpServer: HttpServer, notificationService: NotificationService); + constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts index d66d150..a6b4892 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -25,7 +25,7 @@ export declare class QuestHelper { protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected ragfairServerHelper: RagfairServerHelper; @@ -35,7 +35,7 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, 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, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search diff --git a/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts index ea13aae..b73f786 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts @@ -6,7 +6,7 @@ import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -27,7 +27,7 @@ export declare class RagfairOfferHelper { protected logger: ILogger; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected traderHelper: TraderHelper; protected saveServer: SaveServer; @@ -45,9 +45,15 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if trader offers' BuyRestrictionMax value has been reached + * @param offer offer to check restriction properties of + * @returns true if restriction reached, false if no restrictions/not reached + */ + protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; /** * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check diff --git a/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts index 7ab9768..2a8f0b7 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts @@ -7,20 +7,20 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; export declare class TradeHelper { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); /** * Buy item from flea or trader * @param pmcData diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts index a349a6d..c5b1cb2 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,5 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -47,7 +48,7 @@ export interface AvailableForProps { compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; - status?: number[]; + status?: QuestStatus[]; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; @@ -99,7 +100,7 @@ export interface Rewards { FailRestartable: Reward[]; Expired: Reward[]; } -export interface Reward { +export interface Reward extends Item { value?: string | number; id: string; type: QuestRewardType; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 1d0c0e8..8a29319 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -2,7 +2,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; Ignore: any[]; - InIgnoreList: any[]; + InIgnoreList: string[]; } export interface Friend { _id: string; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/game/ICheckVersionResponse.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/game/ICheckVersionResponse.d.ts new file mode 100644 index 0000000..fa8aa6f --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/eft/game/ICheckVersionResponse.d.ts @@ -0,0 +1,4 @@ +export interface ICheckVersionResponse { + isvalid: boolean; + latestVersion: string; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/game/IServerDetails.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/game/IServerDetails.d.ts new file mode 100644 index 0000000..101cf99 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/eft/game/IServerDetails.d.ts @@ -0,0 +1,4 @@ +export interface IServerDetails { + ip: string; + port: number; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/profile/GetProfileStatusResponseData.d.ts index eee9b4f..cb7368c 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -4,6 +4,7 @@ export interface GetProfileStatusResponseData { } export interface ProfileData { profileid: string; + profileToken: string; status: string; sid: string; ip: string; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts index eaa66c1..cf28c12 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts @@ -37,12 +37,12 @@ export interface Dialogue { attachmentsNew: number; } export interface DialogueInfo { - _id: string; - type: MessageType; - message: MessagePreview; - pinned: boolean; - new: number; attachmentsNew: number; + new: number; + type: MessageType; + pinned: boolean; + message: MessagePreview; + _id: string; } export interface Message { _id: string; diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/BaseClasses.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/BaseClasses.d.ts index 36ebc71..4eb6f7e 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/BaseClasses.d.ts @@ -1,6 +1,9 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", ARMOR = "5448e54d4bdc2dcc718b4568", + ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", + HEADWEAR = "5a341c4086f77401f2541505", + FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", VISORS = "5448e5724bdc2ddf718b4568", diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IAirdropConfig.d.ts index 3edcbdd..53df991 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IAirdropConfig.d.ts @@ -25,6 +25,6 @@ export interface AirdropLoot { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts index 6b1c1e3..8342c99 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -17,5 +17,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + itemPriceMult: number; + regenerateAssortsOnRefresh: boolean; + itemTypeLimits: Record; blacklist: string[]; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/services/LootRequest.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/services/LootRequest.d.ts index 1da8770..8c197ee 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/services/LootRequest.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/services/LootRequest.d.ts @@ -6,6 +6,6 @@ export declare class LootRequest { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/3GetSptConfigFile/types/routers/EventOutputHolder.d.ts b/TypeScript/3GetSptConfigFile/types/routers/EventOutputHolder.d.ts new file mode 100644 index 0000000..7a2387b --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/routers/EventOutputHolder.d.ts @@ -0,0 +1,11 @@ +import { JsonUtil } from "../utils/JsonUtil"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +export declare class EventOutputHolder { + protected jsonUtil: JsonUtil; + protected profileHelper: ProfileHelper; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected output: IItemEventRouterResponse; + getOutput(sessionID: string): IItemEventRouterResponse; + resetOutput(sessionID: string): void; +} diff --git a/TypeScript/3GetSptConfigFile/types/routers/ItemEventRouter.d.ts b/TypeScript/3GetSptConfigFile/types/routers/ItemEventRouter.d.ts index b1ac5d9..e80d16c 100644 --- a/TypeScript/3GetSptConfigFile/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/3GetSptConfigFile/types/routers/ItemEventRouter.d.ts @@ -1,17 +1,14 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { ItemEventRouterDefinition } from "../di/Router"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; - protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[]); - protected output: IItemEventRouterResponse; + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; - getOutput(sessionID: string): IItemEventRouterResponse; - protected resetOutput(sessionID: string): void; } diff --git a/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts b/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts index f572a8f..bbca8af 100644 --- a/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts +++ b/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts @@ -1,34 +1,24 @@ /// import http, { IncomingMessage, ServerResponse } from "http"; -import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; -import { NotifierHelper } from "../helpers/NotifierHelper"; -import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; import { IHttpListener } from "./http/IHttpListener"; +import { WebSocketServer } from "./WebSocketServer"; export declare class HttpServer { protected logger: ILogger; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); + protected webSocketServer: WebSocketServer; + constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); protected httpConfig: IHttpConfig; - protected webSockets: {}; - protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - sendMessage(sessionID: string, output: INotification): void; - isConnectionWebSocket(sessionID: string): boolean; handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; - protected getRandomisedMessage(): string; - protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/TypeScript/3GetSptConfigFile/types/servers/WebSocketServer.d.ts b/TypeScript/3GetSptConfigFile/types/servers/WebSocketServer.d.ts new file mode 100644 index 0000000..f33d214 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/servers/WebSocketServer.d.ts @@ -0,0 +1,25 @@ +/// +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import WebSocket from "ws"; +import http, { IncomingMessage } from "http"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { RandomUtil } from "../utils/RandomUtil"; +import { INotification } from "../models/eft/notifier/INotifier"; +import { ConfigServer } from "./ConfigServer"; +import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +export declare class WebSocketServer { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected configServer: ConfigServer; + protected httpServerHelper: HttpServerHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, httpServerHelper: HttpServerHelper); + protected httpConfig: IHttpConfig; + protected defaultNotification: INotification; + protected webSockets: Record; + protected websocketPingHandler: any; + setupWebSocket(httpServer: http.Server): void; + sendMessage(sessionID: string, output: INotification): void; + protected getRandomisedMessage(): string; + isConnectionWebSocket(sessionID: string): boolean; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; +} diff --git a/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts b/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts index 23fbf52..bdcdeb2 100644 --- a/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts @@ -3,6 +3,8 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -41,6 +43,13 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item + * @param assort + * @param modifier + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -96,6 +105,21 @@ export declare class FenceService { * @param assorts object to add assorts to */ protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + /** + * Randomise items' upd properties e.g. med packs/weapons/armor + * @param itemDetails Item being randomised + * @param itemToAdjust Item being edited + */ + protected randomiseItemUpdProperties(itemDetails: ITemplateItem, itemToAdjust: Item): void; + /** + * Construct item limit record to hold max and current item count + * @param limits limits as defined in config + * @returns record, key: item tplId, value: current/max item count allowed + */ + protected initItemLimitCounter(limits: Record): Record; /** * Get the next update timestamp for fence * @returns future timestamp diff --git a/TypeScript/3GetSptConfigFile/types/services/ItemFilterService.d.ts b/TypeScript/3GetSptConfigFile/types/services/ItemFilterService.d.ts index c9c8ef3..b830d74 100644 --- a/TypeScript/3GetSptConfigFile/types/services/ItemFilterService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/ItemFilterService.d.ts @@ -2,7 +2,7 @@ import { IItemConfig } from "../models/spt/config/IItemConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */ +/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; protected databaseServer: DatabaseServer; diff --git a/TypeScript/3GetSptConfigFile/types/services/RagfairOfferService.d.ts b/TypeScript/3GetSptConfigFile/types/services/RagfairOfferService.d.ts index f9e3a34..a6f6b6d 100644 --- a/TypeScript/3GetSptConfigFile/types/services/RagfairOfferService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/RagfairOfferService.d.ts @@ -5,7 +5,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -20,14 +20,14 @@ export declare class RagfairOfferService { protected ragfairServerHelper: RagfairServerHelper; protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; protected expiredOffers: Item[]; protected offers: IRagfairOffer[]; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts index 466c9e3..4ac7794 100644 --- a/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts @@ -10,7 +10,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -export declare class RagfairPriceService { +import { OnLoad } from "../di/OnLoad"; +export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; @@ -19,21 +20,38 @@ export declare class RagfairPriceService { protected randomUtil: RandomUtil; 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, randomUtil: RandomUtil, configServer: ConfigServer); + onLoad(): void; + getRoute(): string; + /** + * Iterate over all items of type "Item" in db and get template price, store in cache + */ generateStaticPrices(): void; - generateDynamicPrices(): void; - hasDynamicPrices(): boolean; - getDynamicPrice(itemTpl: string): number; - getAllFleaPrices(): Record; + protected generateDynamicPrices(): void; + /** + * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * if no static value, return 1 + * @param tplId Item tpl id to get price for + * @returns price in roubles + */ getFleaPriceForItem(tplId: string): number; /** - * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json - * @param itemPrice price of item - * @param itemTpl item template Id being checked - * @returns adjusted price value in roubles + * get the dynamic (flea) price for an item + * Grabs prices from prices.json and stores in class if none currently exist + * @param itemTpl item template id to look up + * @returns price in roubles */ - protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; + getDynamicPriceForItem(itemTpl: string): number; + /** + * Grab the static (handbook) for an item by its tplId + * @param itemTpl item template id to look up + * @returns price in roubles + */ + getStaticPriceForItem(itemTpl: string): number; + getAllFleaPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -41,9 +59,15 @@ export declare class RagfairPriceService { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; - getStaticPriceForItem(tplId: string): number; getBarterPrice(barterScheme: IBarterScheme[]): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; + /** + * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json + * @param itemPrice price of item + * @param itemTpl item template Id being checked + * @returns adjusted price value in roubles + */ + protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; /** * Multiply the price by a randomised curve where n = 2, shift = 2 * @param existingPrice price to alter @@ -58,7 +82,7 @@ export declare class RagfairPriceService { * @param existingPrice price of existing base weapon * @returns */ - getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) diff --git a/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts b/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts index 3e6077c..d3f1b35 100644 --- a/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts @@ -9,13 +9,11 @@ import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -23,7 +21,7 @@ export declare class RepairService { protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/DataCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/DataCallbacks.d.ts index cfb1c16..04566ff 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/DataCallbacks.d.ts @@ -1,6 +1,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -18,7 +19,7 @@ export declare class DataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts index 06da1b5..5e4c240 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts @@ -1,8 +1,10 @@ import { GameController } from "../controllers/GameController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; @@ -17,8 +19,8 @@ declare class GameCallbacks { gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData; - getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/CustomizationController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/CustomizationController.d.ts index a6c4730..5fe51e3 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/CustomizationController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/CustomizationController.d.ts @@ -5,16 +5,16 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; export declare class CustomizationController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); getTraderSuits(traderID: string, sessionID: string): ISuit[]; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts index eec7dc5..3bfbdb1 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts @@ -3,7 +3,9 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { Config } from "../models/eft/common/IGlobals"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; @@ -37,6 +39,6 @@ export declare class GameController { protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; - getServer(): any[]; - getValidGameVersion(): any; + getServer(): IServerDetails[]; + getValidGameVersion(): ICheckVersionResponse; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/HealthController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/HealthController.d.ts index cc13603..ce67993 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/HealthController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/HealthController.d.ts @@ -8,16 +8,16 @@ import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestD import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; export declare class HealthController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts index dcd8894..ada5bd9 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts @@ -19,7 +19,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -40,7 +40,7 @@ export declare class HideoutController { protected playerService: PlayerService; protected presetHelper: PresetHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected hideoutHelper: HideoutHelper; @@ -49,7 +49,7 @@ export declare class HideoutController { protected jsonUtil: JsonUtil; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InraidController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InraidController.d.ts index 102a2fb..e84eea1 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InraidController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InraidController.d.ts @@ -8,6 +8,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -31,6 +32,7 @@ export declare class InraidController { protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; + protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; @@ -68,4 +70,5 @@ export declare class InraidController { protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void; + getAirdropConfig(): IAirdropConfig; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts index 6895383..14bf129 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; @@ -30,7 +30,7 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required + constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required insuranceService: InsuranceService, configServer: ConfigServer); processReturn(): void; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts index f564919..6a1a21e 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts @@ -1,3 +1,4 @@ +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { PaymentHelper } from "../helpers/PaymentHelper"; import { PresetHelper } from "../helpers/PresetHelper"; @@ -22,7 +23,6 @@ import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryT import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { RagfairOfferService } from "../services/RagfairOfferService"; @@ -39,8 +39,8 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/NoteController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/NoteController.d.ts index ee70541..9e2e250 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/NoteController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/NoteController.d.ts @@ -1,10 +1,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; export declare class NoteController { - protected itemEventRouter: ItemEventRouter; - constructor(itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/PresetBuildController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/PresetBuildController.d.ts index adf4084..65ae0c4 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/PresetBuildController.d.ts @@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; export declare class PresetBuildController { protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); getUserBuilds(sessionID: string): WeaponBuild[]; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts index 282f50e..842207f 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts @@ -11,7 +11,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -20,7 +20,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; @@ -31,7 +31,7 @@ export declare class QuestController { protected localeService: LocaleService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts index fe1f472..5440458 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts @@ -24,7 +24,7 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RagfairServer } from "../servers/RagfairServer"; @@ -42,7 +42,7 @@ export declare class RagfairController { protected logger: ILogger; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; protected databaseServer: DatabaseServer; @@ -64,7 +64,7 @@ export declare class RagfairController { protected ragfairOfferGenerator: RagfairOfferGenerator; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/RepairController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/RepairController.d.ts index ae54a53..fd8ff72 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/RepairController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/RepairController.d.ts @@ -7,13 +7,13 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "../services/PaymentService"; import { RepairService } from "../services/RepairService"; export declare class RepairController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -21,7 +21,7 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected repairService: RepairService; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); /** * Repair with trader * @param sessionID session id diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts index 4c31a3d..7db5886 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,7 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ import { ELocationName } from "../models/enums/ELocationName"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -63,13 +63,13 @@ export declare class RepeatableQuestController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected ragfairServerHelper: RagfairServerHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts index c86745c..0ed0556 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts @@ -6,15 +6,15 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; declare class TradeController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/TraderController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/TraderController.d.ts index b79f55e..d7afe95 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/TraderController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/TraderController.d.ts @@ -1,3 +1,4 @@ +import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -17,8 +18,9 @@ export declare class TraderController { protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected fenceService: FenceService; + protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/WishlistController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/WishlistController.d.ts index a96c522..83be4b3 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/WishlistController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/WishlistController.d.ts @@ -1,10 +1,10 @@ -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistController { - protected itemEvenRouter: ItemEventRouter; - constructor(itemEvenRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/4UseACustomConfigFile/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/FenceBaseAssortGenerator.d.ts new file mode 100644 index 0000000..387df3a --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/generators/FenceBaseAssortGenerator.d.ts @@ -0,0 +1,28 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemFilterService } from "../services/ItemFilterService"; +export declare class FenceBaseAssortGenerator { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemHelper: ItemHelper; + protected itemFilterService: ItemFilterService; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + /** + * Create base fence assorts dynamically and store in db + */ + generateFenceBaseAssorts(): void; + /** + * Check if item is valid for being added to fence assorts + * @param item Item to check + * @returns true if valid fence item + */ + protected isValidFenceItem(item: ITemplateItem): boolean; +} diff --git a/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts index 66056c2..bc0d7ec 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts @@ -17,8 +17,8 @@ export declare class LootGenerator { protected itemFilterService: ItemFilterService; constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); /** - * Generate a list of items based on options passed in - * @param options parameters to adjust what loot is generated + * Generate a list of items based on configuration options parameter + * @param options parameters to adjust how loot is generated * @returns An array of loot items */ createRandomloot(options: LootRequest): LootItem[]; @@ -44,7 +44,13 @@ export declare class LootGenerator { max: number; }>, options: LootRequest, result: LootItem[]): boolean; /** - * + * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values + * @param item item to get stack count of + * @param options loot options + * @returns stack count + */ + protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + /** * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts diff --git a/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts index 0dc2d61..b64a7e7 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Get avatar url from trader table in db + * @param isTrader Is user we're getting avatar for a trader + * @param userId persons id to get avatar of + * @returns url of avatar + */ + protected getAvatarUrl(isTrader: boolean, userId: string): string; /** * Convert a count of currency into roubles * @param currencyCount amount of currency to convert into roubles diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/DialogueHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/DialogueHelper.d.ts index d2be04d..88a726e 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/DialogueHelper.d.ts @@ -1,6 +1,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; @@ -8,13 +9,14 @@ import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotifierHelper } from "./NotifierHelper"; export declare class DialogueHelper { + protected logger: ILogger; protected hashUtil: HashUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; protected itemHelper: ItemHelper; - constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. @@ -23,7 +25,7 @@ export declare class DialogueHelper { * @param sessionID * @param rewards */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/HandbookHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/HandbookHelper.d.ts index b47d466..1ab7800 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { DatabaseServer } from "../servers/DatabaseServer"; declare class LookupItem { byId: Record; byParent: Record; @@ -9,17 +10,35 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected lookup: LookupCollection; - hydrateLookup(lookup: LookupCollection): void; - getTemplatePrice(x: string): number; + protected databaseServer: DatabaseServer; + protected handbookPriceCache: LookupCollection; + constructor(databaseServer: DatabaseServer); + hydrateLookup(): void; + /** + * Get price from internal cache, if cache empty look up price directly in handbook (expensive) + * If no values found, return 1 + * @param tpl item tpl to look up price for + * @returns price in roubles + */ + getTemplatePrice(tpl: string): number; + /** + * all items in template with the given parent category + * @param x + * @returns string array + */ templatesWithParent(x: string): string[]; - isCategory(x: string): boolean; + /** + * Does category exist in handbook cache + * @param category + * @returns true if exists in cache + */ + isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Gets Currency to Ruble conversion Value + * Convert currency into roubles * @param {number} value * @param {string} currencyFrom - * @returns number + * @returns get rouble value of inputted currency */ inRUB(value: number, currencyFrom: string): number; /** diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts index 7495a6a..5f7e3b7 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts @@ -8,7 +8,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PlayerService } from "../services/PlayerService"; @@ -24,7 +24,7 @@ export declare class HideoutHelper { protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; @@ -35,7 +35,7 @@ export declare class HideoutHelper { static bitcoin: string; static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * This convinience function intialies new Production Object diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/NotificationSendHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/NotificationSendHelper.d.ts index 6c56006..014ac95 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/NotificationSendHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { HttpServer } from "../servers/HttpServer"; +import { WebSocketServer } from "../servers/WebSocketServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: HttpServer; + protected webSocketServer: WebSocketServer; protected notificationService: NotificationService; - constructor(httpServer: HttpServer, notificationService: NotificationService); + constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts index d66d150..a6b4892 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -25,7 +25,7 @@ export declare class QuestHelper { protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected ragfairServerHelper: RagfairServerHelper; @@ -35,7 +35,7 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, 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, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts index ea13aae..b73f786 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts @@ -6,7 +6,7 @@ import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -27,7 +27,7 @@ export declare class RagfairOfferHelper { protected logger: ILogger; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected traderHelper: TraderHelper; protected saveServer: SaveServer; @@ -45,9 +45,15 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if trader offers' BuyRestrictionMax value has been reached + * @param offer offer to check restriction properties of + * @returns true if restriction reached, false if no restrictions/not reached + */ + protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; /** * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts index 7ab9768..2a8f0b7 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts @@ -7,20 +7,20 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; export declare class TradeHelper { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); /** * Buy item from flea or trader * @param pmcData diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts index a349a6d..c5b1cb2 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,5 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -47,7 +48,7 @@ export interface AvailableForProps { compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; - status?: number[]; + status?: QuestStatus[]; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; @@ -99,7 +100,7 @@ export interface Rewards { FailRestartable: Reward[]; Expired: Reward[]; } -export interface Reward { +export interface Reward extends Item { value?: string | number; id: string; type: QuestRewardType; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 1d0c0e8..8a29319 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -2,7 +2,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; Ignore: any[]; - InIgnoreList: any[]; + InIgnoreList: string[]; } export interface Friend { _id: string; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/game/ICheckVersionResponse.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/game/ICheckVersionResponse.d.ts new file mode 100644 index 0000000..fa8aa6f --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/game/ICheckVersionResponse.d.ts @@ -0,0 +1,4 @@ +export interface ICheckVersionResponse { + isvalid: boolean; + latestVersion: string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/game/IServerDetails.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/game/IServerDetails.d.ts new file mode 100644 index 0000000..101cf99 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/game/IServerDetails.d.ts @@ -0,0 +1,4 @@ +export interface IServerDetails { + ip: string; + port: number; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/GetProfileStatusResponseData.d.ts index eee9b4f..cb7368c 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -4,6 +4,7 @@ export interface GetProfileStatusResponseData { } export interface ProfileData { profileid: string; + profileToken: string; status: string; sid: string; ip: string; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts index eaa66c1..cf28c12 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts @@ -37,12 +37,12 @@ export interface Dialogue { attachmentsNew: number; } export interface DialogueInfo { - _id: string; - type: MessageType; - message: MessagePreview; - pinned: boolean; - new: number; attachmentsNew: number; + new: number; + type: MessageType; + pinned: boolean; + message: MessagePreview; + _id: string; } export interface Message { _id: string; diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/BaseClasses.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/BaseClasses.d.ts index 36ebc71..4eb6f7e 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/BaseClasses.d.ts @@ -1,6 +1,9 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", ARMOR = "5448e54d4bdc2dcc718b4568", + ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", + HEADWEAR = "5a341c4086f77401f2541505", + FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", VISORS = "5448e5724bdc2ddf718b4568", diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IAirdropConfig.d.ts index 3edcbdd..53df991 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IAirdropConfig.d.ts @@ -25,6 +25,6 @@ export interface AirdropLoot { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts index 6b1c1e3..8342c99 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -17,5 +17,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + itemPriceMult: number; + regenerateAssortsOnRefresh: boolean; + itemTypeLimits: Record; blacklist: string[]; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/services/LootRequest.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/services/LootRequest.d.ts index 1da8770..8c197ee 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/services/LootRequest.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/services/LootRequest.d.ts @@ -6,6 +6,6 @@ export declare class LootRequest { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/4UseACustomConfigFile/types/routers/EventOutputHolder.d.ts b/TypeScript/4UseACustomConfigFile/types/routers/EventOutputHolder.d.ts new file mode 100644 index 0000000..7a2387b --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/routers/EventOutputHolder.d.ts @@ -0,0 +1,11 @@ +import { JsonUtil } from "../utils/JsonUtil"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +export declare class EventOutputHolder { + protected jsonUtil: JsonUtil; + protected profileHelper: ProfileHelper; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected output: IItemEventRouterResponse; + getOutput(sessionID: string): IItemEventRouterResponse; + resetOutput(sessionID: string): void; +} diff --git a/TypeScript/4UseACustomConfigFile/types/routers/ItemEventRouter.d.ts b/TypeScript/4UseACustomConfigFile/types/routers/ItemEventRouter.d.ts index b1ac5d9..e80d16c 100644 --- a/TypeScript/4UseACustomConfigFile/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/routers/ItemEventRouter.d.ts @@ -1,17 +1,14 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { ItemEventRouterDefinition } from "../di/Router"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; - protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[]); - protected output: IItemEventRouterResponse; + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; - getOutput(sessionID: string): IItemEventRouterResponse; - protected resetOutput(sessionID: string): void; } diff --git a/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts b/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts index f572a8f..bbca8af 100644 --- a/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts @@ -1,34 +1,24 @@ /// import http, { IncomingMessage, ServerResponse } from "http"; -import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; -import { NotifierHelper } from "../helpers/NotifierHelper"; -import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; import { IHttpListener } from "./http/IHttpListener"; +import { WebSocketServer } from "./WebSocketServer"; export declare class HttpServer { protected logger: ILogger; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); + protected webSocketServer: WebSocketServer; + constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); protected httpConfig: IHttpConfig; - protected webSockets: {}; - protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - sendMessage(sessionID: string, output: INotification): void; - isConnectionWebSocket(sessionID: string): boolean; handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; - protected getRandomisedMessage(): string; - protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/TypeScript/4UseACustomConfigFile/types/servers/WebSocketServer.d.ts b/TypeScript/4UseACustomConfigFile/types/servers/WebSocketServer.d.ts new file mode 100644 index 0000000..f33d214 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/servers/WebSocketServer.d.ts @@ -0,0 +1,25 @@ +/// +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import WebSocket from "ws"; +import http, { IncomingMessage } from "http"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { RandomUtil } from "../utils/RandomUtil"; +import { INotification } from "../models/eft/notifier/INotifier"; +import { ConfigServer } from "./ConfigServer"; +import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +export declare class WebSocketServer { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected configServer: ConfigServer; + protected httpServerHelper: HttpServerHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, httpServerHelper: HttpServerHelper); + protected httpConfig: IHttpConfig; + protected defaultNotification: INotification; + protected webSockets: Record; + protected websocketPingHandler: any; + setupWebSocket(httpServer: http.Server): void; + sendMessage(sessionID: string, output: INotification): void; + protected getRandomisedMessage(): string; + isConnectionWebSocket(sessionID: string): boolean; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; +} diff --git a/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts index 23fbf52..bdcdeb2 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts @@ -3,6 +3,8 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -41,6 +43,13 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item + * @param assort + * @param modifier + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -96,6 +105,21 @@ export declare class FenceService { * @param assorts object to add assorts to */ protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + /** + * Randomise items' upd properties e.g. med packs/weapons/armor + * @param itemDetails Item being randomised + * @param itemToAdjust Item being edited + */ + protected randomiseItemUpdProperties(itemDetails: ITemplateItem, itemToAdjust: Item): void; + /** + * Construct item limit record to hold max and current item count + * @param limits limits as defined in config + * @returns record, key: item tplId, value: current/max item count allowed + */ + protected initItemLimitCounter(limits: Record): Record; /** * Get the next update timestamp for fence * @returns future timestamp diff --git a/TypeScript/4UseACustomConfigFile/types/services/ItemFilterService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/ItemFilterService.d.ts index c9c8ef3..b830d74 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/ItemFilterService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/ItemFilterService.d.ts @@ -2,7 +2,7 @@ import { IItemConfig } from "../models/spt/config/IItemConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */ +/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; protected databaseServer: DatabaseServer; diff --git a/TypeScript/4UseACustomConfigFile/types/services/RagfairOfferService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/RagfairOfferService.d.ts index f9e3a34..a6f6b6d 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/RagfairOfferService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/RagfairOfferService.d.ts @@ -5,7 +5,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -20,14 +20,14 @@ export declare class RagfairOfferService { protected ragfairServerHelper: RagfairServerHelper; protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; protected expiredOffers: Item[]; protected offers: IRagfairOffer[]; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts index 466c9e3..4ac7794 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts @@ -10,7 +10,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -export declare class RagfairPriceService { +import { OnLoad } from "../di/OnLoad"; +export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; @@ -19,21 +20,38 @@ export declare class RagfairPriceService { protected randomUtil: RandomUtil; 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, randomUtil: RandomUtil, configServer: ConfigServer); + onLoad(): void; + getRoute(): string; + /** + * Iterate over all items of type "Item" in db and get template price, store in cache + */ generateStaticPrices(): void; - generateDynamicPrices(): void; - hasDynamicPrices(): boolean; - getDynamicPrice(itemTpl: string): number; - getAllFleaPrices(): Record; + protected generateDynamicPrices(): void; + /** + * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * if no static value, return 1 + * @param tplId Item tpl id to get price for + * @returns price in roubles + */ getFleaPriceForItem(tplId: string): number; /** - * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json - * @param itemPrice price of item - * @param itemTpl item template Id being checked - * @returns adjusted price value in roubles + * get the dynamic (flea) price for an item + * Grabs prices from prices.json and stores in class if none currently exist + * @param itemTpl item template id to look up + * @returns price in roubles */ - protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; + getDynamicPriceForItem(itemTpl: string): number; + /** + * Grab the static (handbook) for an item by its tplId + * @param itemTpl item template id to look up + * @returns price in roubles + */ + getStaticPriceForItem(itemTpl: string): number; + getAllFleaPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -41,9 +59,15 @@ export declare class RagfairPriceService { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; - getStaticPriceForItem(tplId: string): number; getBarterPrice(barterScheme: IBarterScheme[]): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; + /** + * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json + * @param itemPrice price of item + * @param itemTpl item template Id being checked + * @returns adjusted price value in roubles + */ + protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; /** * Multiply the price by a randomised curve where n = 2, shift = 2 * @param existingPrice price to alter @@ -58,7 +82,7 @@ export declare class RagfairPriceService { * @param existingPrice price of existing base weapon * @returns */ - getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) diff --git a/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts index 3e6077c..d3f1b35 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts @@ -9,13 +9,11 @@ import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -23,7 +21,7 @@ export declare class RepairService { protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/TypeScript/5ReplaceMethod/types/callbacks/DataCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/DataCallbacks.d.ts index cfb1c16..04566ff 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/DataCallbacks.d.ts @@ -1,6 +1,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -18,7 +19,7 @@ export declare class DataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; diff --git a/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts index 06da1b5..5e4c240 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts @@ -1,8 +1,10 @@ import { GameController } from "../controllers/GameController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; @@ -17,8 +19,8 @@ declare class GameCallbacks { gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData; - getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/5ReplaceMethod/types/controllers/CustomizationController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/CustomizationController.d.ts index a6c4730..5fe51e3 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/CustomizationController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/CustomizationController.d.ts @@ -5,16 +5,16 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; export declare class CustomizationController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); getTraderSuits(traderID: string, sessionID: string): ISuit[]; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts index eec7dc5..3bfbdb1 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts @@ -3,7 +3,9 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { Config } from "../models/eft/common/IGlobals"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; @@ -37,6 +39,6 @@ export declare class GameController { protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; - getServer(): any[]; - getValidGameVersion(): any; + getServer(): IServerDetails[]; + getValidGameVersion(): ICheckVersionResponse; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/HealthController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/HealthController.d.ts index cc13603..ce67993 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/HealthController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/HealthController.d.ts @@ -8,16 +8,16 @@ import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestD import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; export declare class HealthController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile diff --git a/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts index dcd8894..ada5bd9 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts @@ -19,7 +19,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -40,7 +40,7 @@ export declare class HideoutController { protected playerService: PlayerService; protected presetHelper: PresetHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected hideoutHelper: HideoutHelper; @@ -49,7 +49,7 @@ export declare class HideoutController { protected jsonUtil: JsonUtil; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/TypeScript/5ReplaceMethod/types/controllers/InraidController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InraidController.d.ts index 102a2fb..e84eea1 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InraidController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InraidController.d.ts @@ -8,6 +8,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -31,6 +32,7 @@ export declare class InraidController { protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; + protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; @@ -68,4 +70,5 @@ export declare class InraidController { protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void; + getAirdropConfig(): IAirdropConfig; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts index 6895383..14bf129 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; @@ -30,7 +30,7 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required + constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required insuranceService: InsuranceService, configServer: ConfigServer); processReturn(): void; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts index f564919..6a1a21e 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts @@ -1,3 +1,4 @@ +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { PaymentHelper } from "../helpers/PaymentHelper"; import { PresetHelper } from "../helpers/PresetHelper"; @@ -22,7 +23,6 @@ import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryT import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { RagfairOfferService } from "../services/RagfairOfferService"; @@ -39,8 +39,8 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/5ReplaceMethod/types/controllers/NoteController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/NoteController.d.ts index ee70541..9e2e250 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/NoteController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/NoteController.d.ts @@ -1,10 +1,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; export declare class NoteController { - protected itemEventRouter: ItemEventRouter; - constructor(itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/5ReplaceMethod/types/controllers/PresetBuildController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/PresetBuildController.d.ts index adf4084..65ae0c4 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/PresetBuildController.d.ts @@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; export declare class PresetBuildController { protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); getUserBuilds(sessionID: string): WeaponBuild[]; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts index 282f50e..842207f 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts @@ -11,7 +11,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -20,7 +20,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; @@ -31,7 +31,7 @@ export declare class QuestController { protected localeService: LocaleService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) diff --git a/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts index fe1f472..5440458 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts @@ -24,7 +24,7 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RagfairServer } from "../servers/RagfairServer"; @@ -42,7 +42,7 @@ export declare class RagfairController { protected logger: ILogger; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; protected databaseServer: DatabaseServer; @@ -64,7 +64,7 @@ export declare class RagfairController { protected ragfairOfferGenerator: RagfairOfferGenerator; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed diff --git a/TypeScript/5ReplaceMethod/types/controllers/RepairController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/RepairController.d.ts index ae54a53..fd8ff72 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/RepairController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/RepairController.d.ts @@ -7,13 +7,13 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "../services/PaymentService"; import { RepairService } from "../services/RepairService"; export declare class RepairController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -21,7 +21,7 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected repairService: RepairService; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); /** * Repair with trader * @param sessionID session id diff --git a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts index 4c31a3d..7db5886 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,7 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ import { ELocationName } from "../models/enums/ELocationName"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -63,13 +63,13 @@ export declare class RepeatableQuestController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected ragfairServerHelper: RagfairServerHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts index c86745c..0ed0556 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts @@ -6,15 +6,15 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; declare class TradeController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/TraderController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/TraderController.d.ts index b79f55e..d7afe95 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/TraderController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/TraderController.d.ts @@ -1,3 +1,4 @@ +import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -17,8 +18,9 @@ export declare class TraderController { protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected fenceService: FenceService; + protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService diff --git a/TypeScript/5ReplaceMethod/types/controllers/WishlistController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/WishlistController.d.ts index a96c522..83be4b3 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/WishlistController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/WishlistController.d.ts @@ -1,10 +1,10 @@ -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistController { - protected itemEvenRouter: ItemEventRouter; - constructor(itemEvenRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/5ReplaceMethod/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/FenceBaseAssortGenerator.d.ts new file mode 100644 index 0000000..387df3a --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/generators/FenceBaseAssortGenerator.d.ts @@ -0,0 +1,28 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemFilterService } from "../services/ItemFilterService"; +export declare class FenceBaseAssortGenerator { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemHelper: ItemHelper; + protected itemFilterService: ItemFilterService; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + /** + * Create base fence assorts dynamically and store in db + */ + generateFenceBaseAssorts(): void; + /** + * Check if item is valid for being added to fence assorts + * @param item Item to check + * @returns true if valid fence item + */ + protected isValidFenceItem(item: ITemplateItem): boolean; +} diff --git a/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts index 66056c2..bc0d7ec 100644 --- a/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts @@ -17,8 +17,8 @@ export declare class LootGenerator { protected itemFilterService: ItemFilterService; constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); /** - * Generate a list of items based on options passed in - * @param options parameters to adjust what loot is generated + * Generate a list of items based on configuration options parameter + * @param options parameters to adjust how loot is generated * @returns An array of loot items */ createRandomloot(options: LootRequest): LootItem[]; @@ -44,7 +44,13 @@ export declare class LootGenerator { max: number; }>, options: LootRequest, result: LootItem[]): boolean; /** - * + * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values + * @param item item to get stack count of + * @param options loot options + * @returns stack count + */ + protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + /** * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts diff --git a/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts index 0dc2d61..b64a7e7 100644 --- a/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Get avatar url from trader table in db + * @param isTrader Is user we're getting avatar for a trader + * @param userId persons id to get avatar of + * @returns url of avatar + */ + protected getAvatarUrl(isTrader: boolean, userId: string): string; /** * Convert a count of currency into roubles * @param currencyCount amount of currency to convert into roubles diff --git a/TypeScript/5ReplaceMethod/types/helpers/DialogueHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/DialogueHelper.d.ts index d2be04d..88a726e 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/DialogueHelper.d.ts @@ -1,6 +1,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; @@ -8,13 +9,14 @@ import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotifierHelper } from "./NotifierHelper"; export declare class DialogueHelper { + protected logger: ILogger; protected hashUtil: HashUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; protected itemHelper: ItemHelper; - constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. @@ -23,7 +25,7 @@ export declare class DialogueHelper { * @param sessionID * @param rewards */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/5ReplaceMethod/types/helpers/HandbookHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/HandbookHelper.d.ts index b47d466..1ab7800 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { DatabaseServer } from "../servers/DatabaseServer"; declare class LookupItem { byId: Record; byParent: Record; @@ -9,17 +10,35 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected lookup: LookupCollection; - hydrateLookup(lookup: LookupCollection): void; - getTemplatePrice(x: string): number; + protected databaseServer: DatabaseServer; + protected handbookPriceCache: LookupCollection; + constructor(databaseServer: DatabaseServer); + hydrateLookup(): void; + /** + * Get price from internal cache, if cache empty look up price directly in handbook (expensive) + * If no values found, return 1 + * @param tpl item tpl to look up price for + * @returns price in roubles + */ + getTemplatePrice(tpl: string): number; + /** + * all items in template with the given parent category + * @param x + * @returns string array + */ templatesWithParent(x: string): string[]; - isCategory(x: string): boolean; + /** + * Does category exist in handbook cache + * @param category + * @returns true if exists in cache + */ + isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Gets Currency to Ruble conversion Value + * Convert currency into roubles * @param {number} value * @param {string} currencyFrom - * @returns number + * @returns get rouble value of inputted currency */ inRUB(value: number, currencyFrom: string): number; /** diff --git a/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts index 7495a6a..5f7e3b7 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts @@ -8,7 +8,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PlayerService } from "../services/PlayerService"; @@ -24,7 +24,7 @@ export declare class HideoutHelper { protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; @@ -35,7 +35,7 @@ export declare class HideoutHelper { static bitcoin: string; static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * This convinience function intialies new Production Object diff --git a/TypeScript/5ReplaceMethod/types/helpers/NotificationSendHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/NotificationSendHelper.d.ts index 6c56006..014ac95 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/NotificationSendHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { HttpServer } from "../servers/HttpServer"; +import { WebSocketServer } from "../servers/WebSocketServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: HttpServer; + protected webSocketServer: WebSocketServer; protected notificationService: NotificationService; - constructor(httpServer: HttpServer, notificationService: NotificationService); + constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts index d66d150..a6b4892 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -25,7 +25,7 @@ export declare class QuestHelper { protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected ragfairServerHelper: RagfairServerHelper; @@ -35,7 +35,7 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, 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, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search diff --git a/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts index ea13aae..b73f786 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts @@ -6,7 +6,7 @@ import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -27,7 +27,7 @@ export declare class RagfairOfferHelper { protected logger: ILogger; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected traderHelper: TraderHelper; protected saveServer: SaveServer; @@ -45,9 +45,15 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if trader offers' BuyRestrictionMax value has been reached + * @param offer offer to check restriction properties of + * @returns true if restriction reached, false if no restrictions/not reached + */ + protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; /** * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check diff --git a/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts index 7ab9768..2a8f0b7 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts @@ -7,20 +7,20 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; export declare class TradeHelper { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); /** * Buy item from flea or trader * @param pmcData diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts index a349a6d..c5b1cb2 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,5 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -47,7 +48,7 @@ export interface AvailableForProps { compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; - status?: number[]; + status?: QuestStatus[]; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; @@ -99,7 +100,7 @@ export interface Rewards { FailRestartable: Reward[]; Expired: Reward[]; } -export interface Reward { +export interface Reward extends Item { value?: string | number; id: string; type: QuestRewardType; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 1d0c0e8..8a29319 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -2,7 +2,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; Ignore: any[]; - InIgnoreList: any[]; + InIgnoreList: string[]; } export interface Friend { _id: string; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/game/ICheckVersionResponse.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/game/ICheckVersionResponse.d.ts new file mode 100644 index 0000000..fa8aa6f --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/eft/game/ICheckVersionResponse.d.ts @@ -0,0 +1,4 @@ +export interface ICheckVersionResponse { + isvalid: boolean; + latestVersion: string; +} diff --git a/TypeScript/5ReplaceMethod/types/models/eft/game/IServerDetails.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/game/IServerDetails.d.ts new file mode 100644 index 0000000..101cf99 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/eft/game/IServerDetails.d.ts @@ -0,0 +1,4 @@ +export interface IServerDetails { + ip: string; + port: number; +} diff --git a/TypeScript/5ReplaceMethod/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/profile/GetProfileStatusResponseData.d.ts index eee9b4f..cb7368c 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -4,6 +4,7 @@ export interface GetProfileStatusResponseData { } export interface ProfileData { profileid: string; + profileToken: string; status: string; sid: string; ip: string; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts index eaa66c1..cf28c12 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts @@ -37,12 +37,12 @@ export interface Dialogue { attachmentsNew: number; } export interface DialogueInfo { - _id: string; - type: MessageType; - message: MessagePreview; - pinned: boolean; - new: number; attachmentsNew: number; + new: number; + type: MessageType; + pinned: boolean; + message: MessagePreview; + _id: string; } export interface Message { _id: string; diff --git a/TypeScript/5ReplaceMethod/types/models/enums/BaseClasses.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/BaseClasses.d.ts index 36ebc71..4eb6f7e 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/BaseClasses.d.ts @@ -1,6 +1,9 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", ARMOR = "5448e54d4bdc2dcc718b4568", + ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", + HEADWEAR = "5a341c4086f77401f2541505", + FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", VISORS = "5448e5724bdc2ddf718b4568", diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IAirdropConfig.d.ts index 3edcbdd..53df991 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IAirdropConfig.d.ts @@ -25,6 +25,6 @@ export interface AirdropLoot { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts index 6b1c1e3..8342c99 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts @@ -17,5 +17,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + itemPriceMult: number; + regenerateAssortsOnRefresh: boolean; + itemTypeLimits: Record; blacklist: string[]; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/services/LootRequest.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/services/LootRequest.d.ts index 1da8770..8c197ee 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/services/LootRequest.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/services/LootRequest.d.ts @@ -6,6 +6,6 @@ export declare class LootRequest { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/5ReplaceMethod/types/routers/EventOutputHolder.d.ts b/TypeScript/5ReplaceMethod/types/routers/EventOutputHolder.d.ts new file mode 100644 index 0000000..7a2387b --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/routers/EventOutputHolder.d.ts @@ -0,0 +1,11 @@ +import { JsonUtil } from "../utils/JsonUtil"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +export declare class EventOutputHolder { + protected jsonUtil: JsonUtil; + protected profileHelper: ProfileHelper; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected output: IItemEventRouterResponse; + getOutput(sessionID: string): IItemEventRouterResponse; + resetOutput(sessionID: string): void; +} diff --git a/TypeScript/5ReplaceMethod/types/routers/ItemEventRouter.d.ts b/TypeScript/5ReplaceMethod/types/routers/ItemEventRouter.d.ts index b1ac5d9..e80d16c 100644 --- a/TypeScript/5ReplaceMethod/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/5ReplaceMethod/types/routers/ItemEventRouter.d.ts @@ -1,17 +1,14 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { ItemEventRouterDefinition } from "../di/Router"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; - protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[]); - protected output: IItemEventRouterResponse; + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; - getOutput(sessionID: string): IItemEventRouterResponse; - protected resetOutput(sessionID: string): void; } diff --git a/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts b/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts index f572a8f..bbca8af 100644 --- a/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts +++ b/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts @@ -1,34 +1,24 @@ /// import http, { IncomingMessage, ServerResponse } from "http"; -import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; -import { NotifierHelper } from "../helpers/NotifierHelper"; -import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; import { IHttpListener } from "./http/IHttpListener"; +import { WebSocketServer } from "./WebSocketServer"; export declare class HttpServer { protected logger: ILogger; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); + protected webSocketServer: WebSocketServer; + constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); protected httpConfig: IHttpConfig; - protected webSockets: {}; - protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - sendMessage(sessionID: string, output: INotification): void; - isConnectionWebSocket(sessionID: string): boolean; handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; - protected getRandomisedMessage(): string; - protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/TypeScript/5ReplaceMethod/types/servers/WebSocketServer.d.ts b/TypeScript/5ReplaceMethod/types/servers/WebSocketServer.d.ts new file mode 100644 index 0000000..f33d214 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/servers/WebSocketServer.d.ts @@ -0,0 +1,25 @@ +/// +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import WebSocket from "ws"; +import http, { IncomingMessage } from "http"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { RandomUtil } from "../utils/RandomUtil"; +import { INotification } from "../models/eft/notifier/INotifier"; +import { ConfigServer } from "./ConfigServer"; +import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +export declare class WebSocketServer { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected configServer: ConfigServer; + protected httpServerHelper: HttpServerHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, httpServerHelper: HttpServerHelper); + protected httpConfig: IHttpConfig; + protected defaultNotification: INotification; + protected webSockets: Record; + protected websocketPingHandler: any; + setupWebSocket(httpServer: http.Server): void; + sendMessage(sessionID: string, output: INotification): void; + protected getRandomisedMessage(): string; + isConnectionWebSocket(sessionID: string): boolean; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; +} diff --git a/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts b/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts index 23fbf52..bdcdeb2 100644 --- a/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts @@ -3,6 +3,8 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -41,6 +43,13 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item + * @param assort + * @param modifier + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -96,6 +105,21 @@ export declare class FenceService { * @param assorts object to add assorts to */ protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + /** + * Randomise items' upd properties e.g. med packs/weapons/armor + * @param itemDetails Item being randomised + * @param itemToAdjust Item being edited + */ + protected randomiseItemUpdProperties(itemDetails: ITemplateItem, itemToAdjust: Item): void; + /** + * Construct item limit record to hold max and current item count + * @param limits limits as defined in config + * @returns record, key: item tplId, value: current/max item count allowed + */ + protected initItemLimitCounter(limits: Record): Record; /** * Get the next update timestamp for fence * @returns future timestamp diff --git a/TypeScript/5ReplaceMethod/types/services/ItemFilterService.d.ts b/TypeScript/5ReplaceMethod/types/services/ItemFilterService.d.ts index c9c8ef3..b830d74 100644 --- a/TypeScript/5ReplaceMethod/types/services/ItemFilterService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/ItemFilterService.d.ts @@ -2,7 +2,7 @@ import { IItemConfig } from "../models/spt/config/IItemConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */ +/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; protected databaseServer: DatabaseServer; diff --git a/TypeScript/5ReplaceMethod/types/services/RagfairOfferService.d.ts b/TypeScript/5ReplaceMethod/types/services/RagfairOfferService.d.ts index f9e3a34..a6f6b6d 100644 --- a/TypeScript/5ReplaceMethod/types/services/RagfairOfferService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/RagfairOfferService.d.ts @@ -5,7 +5,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -20,14 +20,14 @@ export declare class RagfairOfferService { protected ragfairServerHelper: RagfairServerHelper; protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; protected expiredOffers: Item[]; protected offers: IRagfairOffer[]; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts b/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts index 466c9e3..4ac7794 100644 --- a/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts @@ -10,7 +10,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -export declare class RagfairPriceService { +import { OnLoad } from "../di/OnLoad"; +export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; @@ -19,21 +20,38 @@ export declare class RagfairPriceService { protected randomUtil: RandomUtil; 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, randomUtil: RandomUtil, configServer: ConfigServer); + onLoad(): void; + getRoute(): string; + /** + * Iterate over all items of type "Item" in db and get template price, store in cache + */ generateStaticPrices(): void; - generateDynamicPrices(): void; - hasDynamicPrices(): boolean; - getDynamicPrice(itemTpl: string): number; - getAllFleaPrices(): Record; + protected generateDynamicPrices(): void; + /** + * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * if no static value, return 1 + * @param tplId Item tpl id to get price for + * @returns price in roubles + */ getFleaPriceForItem(tplId: string): number; /** - * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json - * @param itemPrice price of item - * @param itemTpl item template Id being checked - * @returns adjusted price value in roubles + * get the dynamic (flea) price for an item + * Grabs prices from prices.json and stores in class if none currently exist + * @param itemTpl item template id to look up + * @returns price in roubles */ - protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; + getDynamicPriceForItem(itemTpl: string): number; + /** + * Grab the static (handbook) for an item by its tplId + * @param itemTpl item template id to look up + * @returns price in roubles + */ + getStaticPriceForItem(itemTpl: string): number; + getAllFleaPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -41,9 +59,15 @@ export declare class RagfairPriceService { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; - getStaticPriceForItem(tplId: string): number; getBarterPrice(barterScheme: IBarterScheme[]): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; + /** + * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json + * @param itemPrice price of item + * @param itemTpl item template Id being checked + * @returns adjusted price value in roubles + */ + protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; /** * Multiply the price by a randomised curve where n = 2, shift = 2 * @param existingPrice price to alter @@ -58,7 +82,7 @@ export declare class RagfairPriceService { * @param existingPrice price of existing base weapon * @returns */ - getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) diff --git a/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts b/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts index 3e6077c..d3f1b35 100644 --- a/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts @@ -9,13 +9,11 @@ import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -23,7 +21,7 @@ export declare class RepairService { protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/DataCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/DataCallbacks.d.ts index cfb1c16..04566ff 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/DataCallbacks.d.ts @@ -1,6 +1,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -18,7 +19,7 @@ export declare class DataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts index 06da1b5..5e4c240 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts @@ -1,8 +1,10 @@ import { GameController } from "../controllers/GameController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; @@ -17,8 +19,8 @@ declare class GameCallbacks { gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData; - getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/CustomizationController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/CustomizationController.d.ts index a6c4730..5fe51e3 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/CustomizationController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/CustomizationController.d.ts @@ -5,16 +5,16 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; export declare class CustomizationController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); getTraderSuits(traderID: string, sessionID: string): ISuit[]; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts index eec7dc5..3bfbdb1 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts @@ -3,7 +3,9 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { Config } from "../models/eft/common/IGlobals"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; @@ -37,6 +39,6 @@ export declare class GameController { protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; - getServer(): any[]; - getValidGameVersion(): any; + getServer(): IServerDetails[]; + getValidGameVersion(): ICheckVersionResponse; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/HealthController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/HealthController.d.ts index cc13603..ce67993 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/HealthController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/HealthController.d.ts @@ -8,16 +8,16 @@ import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestD import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; export declare class HealthController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts index dcd8894..ada5bd9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts @@ -19,7 +19,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -40,7 +40,7 @@ export declare class HideoutController { protected playerService: PlayerService; protected presetHelper: PresetHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected hideoutHelper: HideoutHelper; @@ -49,7 +49,7 @@ export declare class HideoutController { protected jsonUtil: JsonUtil; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InraidController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InraidController.d.ts index 102a2fb..e84eea1 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InraidController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InraidController.d.ts @@ -8,6 +8,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -31,6 +32,7 @@ export declare class InraidController { protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; + protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; @@ -68,4 +70,5 @@ export declare class InraidController { protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void; + getAirdropConfig(): IAirdropConfig; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts index 6895383..14bf129 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; @@ -30,7 +30,7 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required + constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required insuranceService: InsuranceService, configServer: ConfigServer); processReturn(): void; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts index f564919..6a1a21e 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts @@ -1,3 +1,4 @@ +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { PaymentHelper } from "../helpers/PaymentHelper"; import { PresetHelper } from "../helpers/PresetHelper"; @@ -22,7 +23,6 @@ import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryT import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { RagfairOfferService } from "../services/RagfairOfferService"; @@ -39,8 +39,8 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/NoteController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/NoteController.d.ts index ee70541..9e2e250 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/NoteController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/NoteController.d.ts @@ -1,10 +1,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; export declare class NoteController { - protected itemEventRouter: ItemEventRouter; - constructor(itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/PresetBuildController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/PresetBuildController.d.ts index adf4084..65ae0c4 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/PresetBuildController.d.ts @@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; export declare class PresetBuildController { protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); getUserBuilds(sessionID: string): WeaponBuild[]; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts index 282f50e..842207f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts @@ -11,7 +11,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -20,7 +20,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; @@ -31,7 +31,7 @@ export declare class QuestController { protected localeService: LocaleService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts index fe1f472..5440458 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts @@ -24,7 +24,7 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RagfairServer } from "../servers/RagfairServer"; @@ -42,7 +42,7 @@ export declare class RagfairController { protected logger: ILogger; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; protected databaseServer: DatabaseServer; @@ -64,7 +64,7 @@ export declare class RagfairController { protected ragfairOfferGenerator: RagfairOfferGenerator; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/RepairController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/RepairController.d.ts index ae54a53..fd8ff72 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/RepairController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/RepairController.d.ts @@ -7,13 +7,13 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "../services/PaymentService"; import { RepairService } from "../services/RepairService"; export declare class RepairController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -21,7 +21,7 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected repairService: RepairService; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); /** * Repair with trader * @param sessionID session id diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts index 4c31a3d..7db5886 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,7 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ import { ELocationName } from "../models/enums/ELocationName"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -63,13 +63,13 @@ export declare class RepeatableQuestController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected ragfairServerHelper: RagfairServerHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts index c86745c..0ed0556 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts @@ -6,15 +6,15 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; declare class TradeController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/TraderController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/TraderController.d.ts index b79f55e..d7afe95 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/TraderController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/TraderController.d.ts @@ -1,3 +1,4 @@ +import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -17,8 +18,9 @@ export declare class TraderController { protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected fenceService: FenceService; + protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/WishlistController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/WishlistController.d.ts index a96c522..83be4b3 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/WishlistController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/WishlistController.d.ts @@ -1,10 +1,10 @@ -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistController { - protected itemEvenRouter: ItemEventRouter; - constructor(itemEvenRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/FenceBaseAssortGenerator.d.ts new file mode 100644 index 0000000..387df3a --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/generators/FenceBaseAssortGenerator.d.ts @@ -0,0 +1,28 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemFilterService } from "../services/ItemFilterService"; +export declare class FenceBaseAssortGenerator { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemHelper: ItemHelper; + protected itemFilterService: ItemFilterService; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + /** + * Create base fence assorts dynamically and store in db + */ + generateFenceBaseAssorts(): void; + /** + * Check if item is valid for being added to fence assorts + * @param item Item to check + * @returns true if valid fence item + */ + protected isValidFenceItem(item: ITemplateItem): boolean; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts index 66056c2..bc0d7ec 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts @@ -17,8 +17,8 @@ export declare class LootGenerator { protected itemFilterService: ItemFilterService; constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); /** - * Generate a list of items based on options passed in - * @param options parameters to adjust what loot is generated + * Generate a list of items based on configuration options parameter + * @param options parameters to adjust how loot is generated * @returns An array of loot items */ createRandomloot(options: LootRequest): LootItem[]; @@ -44,7 +44,13 @@ export declare class LootGenerator { max: number; }>, options: LootRequest, result: LootItem[]): boolean; /** - * + * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values + * @param item item to get stack count of + * @param options loot options + * @returns stack count + */ + protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + /** * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts index 0dc2d61..b64a7e7 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Get avatar url from trader table in db + * @param isTrader Is user we're getting avatar for a trader + * @param userId persons id to get avatar of + * @returns url of avatar + */ + protected getAvatarUrl(isTrader: boolean, userId: string): string; /** * Convert a count of currency into roubles * @param currencyCount amount of currency to convert into roubles diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/DialogueHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/DialogueHelper.d.ts index d2be04d..88a726e 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/DialogueHelper.d.ts @@ -1,6 +1,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; @@ -8,13 +9,14 @@ import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotifierHelper } from "./NotifierHelper"; export declare class DialogueHelper { + protected logger: ILogger; protected hashUtil: HashUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; protected itemHelper: ItemHelper; - constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. @@ -23,7 +25,7 @@ export declare class DialogueHelper { * @param sessionID * @param rewards */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/HandbookHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/HandbookHelper.d.ts index b47d466..1ab7800 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { DatabaseServer } from "../servers/DatabaseServer"; declare class LookupItem { byId: Record; byParent: Record; @@ -9,17 +10,35 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected lookup: LookupCollection; - hydrateLookup(lookup: LookupCollection): void; - getTemplatePrice(x: string): number; + protected databaseServer: DatabaseServer; + protected handbookPriceCache: LookupCollection; + constructor(databaseServer: DatabaseServer); + hydrateLookup(): void; + /** + * Get price from internal cache, if cache empty look up price directly in handbook (expensive) + * If no values found, return 1 + * @param tpl item tpl to look up price for + * @returns price in roubles + */ + getTemplatePrice(tpl: string): number; + /** + * all items in template with the given parent category + * @param x + * @returns string array + */ templatesWithParent(x: string): string[]; - isCategory(x: string): boolean; + /** + * Does category exist in handbook cache + * @param category + * @returns true if exists in cache + */ + isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Gets Currency to Ruble conversion Value + * Convert currency into roubles * @param {number} value * @param {string} currencyFrom - * @returns number + * @returns get rouble value of inputted currency */ inRUB(value: number, currencyFrom: string): number; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts index 7495a6a..5f7e3b7 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts @@ -8,7 +8,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PlayerService } from "../services/PlayerService"; @@ -24,7 +24,7 @@ export declare class HideoutHelper { protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; @@ -35,7 +35,7 @@ export declare class HideoutHelper { static bitcoin: string; static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * This convinience function intialies new Production Object diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/NotificationSendHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/NotificationSendHelper.d.ts index 6c56006..014ac95 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/NotificationSendHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { HttpServer } from "../servers/HttpServer"; +import { WebSocketServer } from "../servers/WebSocketServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: HttpServer; + protected webSocketServer: WebSocketServer; protected notificationService: NotificationService; - constructor(httpServer: HttpServer, notificationService: NotificationService); + constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts index d66d150..a6b4892 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -25,7 +25,7 @@ export declare class QuestHelper { protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected ragfairServerHelper: RagfairServerHelper; @@ -35,7 +35,7 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, 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, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts index ea13aae..b73f786 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts @@ -6,7 +6,7 @@ import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -27,7 +27,7 @@ export declare class RagfairOfferHelper { protected logger: ILogger; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected traderHelper: TraderHelper; protected saveServer: SaveServer; @@ -45,9 +45,15 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if trader offers' BuyRestrictionMax value has been reached + * @param offer offer to check restriction properties of + * @returns true if restriction reached, false if no restrictions/not reached + */ + protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; /** * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts index 7ab9768..2a8f0b7 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts @@ -7,20 +7,20 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; export declare class TradeHelper { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); /** * Buy item from flea or trader * @param pmcData diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts index a349a6d..c5b1cb2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,5 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -47,7 +48,7 @@ export interface AvailableForProps { compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; - status?: number[]; + status?: QuestStatus[]; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; @@ -99,7 +100,7 @@ export interface Rewards { FailRestartable: Reward[]; Expired: Reward[]; } -export interface Reward { +export interface Reward extends Item { value?: string | number; id: string; type: QuestRewardType; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 1d0c0e8..8a29319 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -2,7 +2,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; Ignore: any[]; - InIgnoreList: any[]; + InIgnoreList: string[]; } export interface Friend { _id: string; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/game/ICheckVersionResponse.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/game/ICheckVersionResponse.d.ts new file mode 100644 index 0000000..fa8aa6f --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/game/ICheckVersionResponse.d.ts @@ -0,0 +1,4 @@ +export interface ICheckVersionResponse { + isvalid: boolean; + latestVersion: string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IServerDetails.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IServerDetails.d.ts new file mode 100644 index 0000000..101cf99 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IServerDetails.d.ts @@ -0,0 +1,4 @@ +export interface IServerDetails { + ip: string; + port: number; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/GetProfileStatusResponseData.d.ts index eee9b4f..cb7368c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -4,6 +4,7 @@ export interface GetProfileStatusResponseData { } export interface ProfileData { profileid: string; + profileToken: string; status: string; sid: string; ip: string; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts index eaa66c1..cf28c12 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts @@ -37,12 +37,12 @@ export interface Dialogue { attachmentsNew: number; } export interface DialogueInfo { - _id: string; - type: MessageType; - message: MessagePreview; - pinned: boolean; - new: number; attachmentsNew: number; + new: number; + type: MessageType; + pinned: boolean; + message: MessagePreview; + _id: string; } export interface Message { _id: string; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/BaseClasses.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/BaseClasses.d.ts index 36ebc71..4eb6f7e 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/BaseClasses.d.ts @@ -1,6 +1,9 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", ARMOR = "5448e54d4bdc2dcc718b4568", + ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", + HEADWEAR = "5a341c4086f77401f2541505", + FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", VISORS = "5448e5724bdc2ddf718b4568", diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IAirdropConfig.d.ts index 3edcbdd..53df991 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IAirdropConfig.d.ts @@ -25,6 +25,6 @@ export interface AirdropLoot { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts index 6b1c1e3..8342c99 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts @@ -17,5 +17,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + itemPriceMult: number; + regenerateAssortsOnRefresh: boolean; + itemTypeLimits: Record; blacklist: string[]; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/services/LootRequest.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/services/LootRequest.d.ts index 1da8770..8c197ee 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/services/LootRequest.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/services/LootRequest.d.ts @@ -6,6 +6,6 @@ export declare class LootRequest { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/6ReferenceAnotherClass/types/routers/EventOutputHolder.d.ts b/TypeScript/6ReferenceAnotherClass/types/routers/EventOutputHolder.d.ts new file mode 100644 index 0000000..7a2387b --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/routers/EventOutputHolder.d.ts @@ -0,0 +1,11 @@ +import { JsonUtil } from "../utils/JsonUtil"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +export declare class EventOutputHolder { + protected jsonUtil: JsonUtil; + protected profileHelper: ProfileHelper; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected output: IItemEventRouterResponse; + getOutput(sessionID: string): IItemEventRouterResponse; + resetOutput(sessionID: string): void; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/routers/ItemEventRouter.d.ts b/TypeScript/6ReferenceAnotherClass/types/routers/ItemEventRouter.d.ts index b1ac5d9..e80d16c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/routers/ItemEventRouter.d.ts @@ -1,17 +1,14 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { ItemEventRouterDefinition } from "../di/Router"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; - protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[]); - protected output: IItemEventRouterResponse; + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; - getOutput(sessionID: string): IItemEventRouterResponse; - protected resetOutput(sessionID: string): void; } diff --git a/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts b/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts index f572a8f..bbca8af 100644 --- a/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts @@ -1,34 +1,24 @@ /// import http, { IncomingMessage, ServerResponse } from "http"; -import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; -import { NotifierHelper } from "../helpers/NotifierHelper"; -import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; import { IHttpListener } from "./http/IHttpListener"; +import { WebSocketServer } from "./WebSocketServer"; export declare class HttpServer { protected logger: ILogger; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); + protected webSocketServer: WebSocketServer; + constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); protected httpConfig: IHttpConfig; - protected webSockets: {}; - protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - sendMessage(sessionID: string, output: INotification): void; - isConnectionWebSocket(sessionID: string): boolean; handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; - protected getRandomisedMessage(): string; - protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/TypeScript/6ReferenceAnotherClass/types/servers/WebSocketServer.d.ts b/TypeScript/6ReferenceAnotherClass/types/servers/WebSocketServer.d.ts new file mode 100644 index 0000000..f33d214 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/servers/WebSocketServer.d.ts @@ -0,0 +1,25 @@ +/// +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import WebSocket from "ws"; +import http, { IncomingMessage } from "http"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { RandomUtil } from "../utils/RandomUtil"; +import { INotification } from "../models/eft/notifier/INotifier"; +import { ConfigServer } from "./ConfigServer"; +import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +export declare class WebSocketServer { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected configServer: ConfigServer; + protected httpServerHelper: HttpServerHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, httpServerHelper: HttpServerHelper); + protected httpConfig: IHttpConfig; + protected defaultNotification: INotification; + protected webSockets: Record; + protected websocketPingHandler: any; + setupWebSocket(httpServer: http.Server): void; + sendMessage(sessionID: string, output: INotification): void; + protected getRandomisedMessage(): string; + isConnectionWebSocket(sessionID: string): boolean; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts index 23fbf52..bdcdeb2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts @@ -3,6 +3,8 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -41,6 +43,13 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item + * @param assort + * @param modifier + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -96,6 +105,21 @@ export declare class FenceService { * @param assorts object to add assorts to */ protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + /** + * Randomise items' upd properties e.g. med packs/weapons/armor + * @param itemDetails Item being randomised + * @param itemToAdjust Item being edited + */ + protected randomiseItemUpdProperties(itemDetails: ITemplateItem, itemToAdjust: Item): void; + /** + * Construct item limit record to hold max and current item count + * @param limits limits as defined in config + * @returns record, key: item tplId, value: current/max item count allowed + */ + protected initItemLimitCounter(limits: Record): Record; /** * Get the next update timestamp for fence * @returns future timestamp diff --git a/TypeScript/6ReferenceAnotherClass/types/services/ItemFilterService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/ItemFilterService.d.ts index c9c8ef3..b830d74 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/ItemFilterService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/ItemFilterService.d.ts @@ -2,7 +2,7 @@ import { IItemConfig } from "../models/spt/config/IItemConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */ +/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; protected databaseServer: DatabaseServer; diff --git a/TypeScript/6ReferenceAnotherClass/types/services/RagfairOfferService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/RagfairOfferService.d.ts index f9e3a34..a6f6b6d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/RagfairOfferService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/RagfairOfferService.d.ts @@ -5,7 +5,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -20,14 +20,14 @@ export declare class RagfairOfferService { protected ragfairServerHelper: RagfairServerHelper; protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; protected expiredOffers: Item[]; protected offers: IRagfairOffer[]; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts index 466c9e3..4ac7794 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts @@ -10,7 +10,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -export declare class RagfairPriceService { +import { OnLoad } from "../di/OnLoad"; +export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; @@ -19,21 +20,38 @@ export declare class RagfairPriceService { protected randomUtil: RandomUtil; 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, randomUtil: RandomUtil, configServer: ConfigServer); + onLoad(): void; + getRoute(): string; + /** + * Iterate over all items of type "Item" in db and get template price, store in cache + */ generateStaticPrices(): void; - generateDynamicPrices(): void; - hasDynamicPrices(): boolean; - getDynamicPrice(itemTpl: string): number; - getAllFleaPrices(): Record; + protected generateDynamicPrices(): void; + /** + * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * if no static value, return 1 + * @param tplId Item tpl id to get price for + * @returns price in roubles + */ getFleaPriceForItem(tplId: string): number; /** - * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json - * @param itemPrice price of item - * @param itemTpl item template Id being checked - * @returns adjusted price value in roubles + * get the dynamic (flea) price for an item + * Grabs prices from prices.json and stores in class if none currently exist + * @param itemTpl item template id to look up + * @returns price in roubles */ - protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; + getDynamicPriceForItem(itemTpl: string): number; + /** + * Grab the static (handbook) for an item by its tplId + * @param itemTpl item template id to look up + * @returns price in roubles + */ + getStaticPriceForItem(itemTpl: string): number; + getAllFleaPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -41,9 +59,15 @@ export declare class RagfairPriceService { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; - getStaticPriceForItem(tplId: string): number; getBarterPrice(barterScheme: IBarterScheme[]): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; + /** + * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json + * @param itemPrice price of item + * @param itemTpl item template Id being checked + * @returns adjusted price value in roubles + */ + protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; /** * Multiply the price by a randomised curve where n = 2, shift = 2 * @param existingPrice price to alter @@ -58,7 +82,7 @@ export declare class RagfairPriceService { * @param existingPrice price of existing base weapon * @returns */ - getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) diff --git a/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts index 3e6077c..d3f1b35 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts @@ -9,13 +9,11 @@ import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -23,7 +21,7 @@ export declare class RepairService { protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/TypeScript/7OnLoadHook/types/callbacks/DataCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/DataCallbacks.d.ts index cfb1c16..04566ff 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/DataCallbacks.d.ts @@ -1,6 +1,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -18,7 +19,7 @@ export declare class DataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; diff --git a/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts index 06da1b5..5e4c240 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts @@ -1,8 +1,10 @@ import { GameController } from "../controllers/GameController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; @@ -17,8 +19,8 @@ declare class GameCallbacks { gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData; - getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/7OnLoadHook/types/controllers/CustomizationController.d.ts b/TypeScript/7OnLoadHook/types/controllers/CustomizationController.d.ts index a6c4730..5fe51e3 100644 --- a/TypeScript/7OnLoadHook/types/controllers/CustomizationController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/CustomizationController.d.ts @@ -5,16 +5,16 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; export declare class CustomizationController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); getTraderSuits(traderID: string, sessionID: string): ISuit[]; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts b/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts index eec7dc5..3bfbdb1 100644 --- a/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts @@ -3,7 +3,9 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { Config } from "../models/eft/common/IGlobals"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; @@ -37,6 +39,6 @@ export declare class GameController { protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; - getServer(): any[]; - getValidGameVersion(): any; + getServer(): IServerDetails[]; + getValidGameVersion(): ICheckVersionResponse; } diff --git a/TypeScript/7OnLoadHook/types/controllers/HealthController.d.ts b/TypeScript/7OnLoadHook/types/controllers/HealthController.d.ts index cc13603..ce67993 100644 --- a/TypeScript/7OnLoadHook/types/controllers/HealthController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/HealthController.d.ts @@ -8,16 +8,16 @@ import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestD import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; export declare class HealthController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile diff --git a/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts b/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts index dcd8894..ada5bd9 100644 --- a/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts @@ -19,7 +19,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -40,7 +40,7 @@ export declare class HideoutController { protected playerService: PlayerService; protected presetHelper: PresetHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected hideoutHelper: HideoutHelper; @@ -49,7 +49,7 @@ export declare class HideoutController { protected jsonUtil: JsonUtil; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/TypeScript/7OnLoadHook/types/controllers/InraidController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InraidController.d.ts index 102a2fb..e84eea1 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InraidController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InraidController.d.ts @@ -8,6 +8,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -31,6 +32,7 @@ export declare class InraidController { protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; + protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; @@ -68,4 +70,5 @@ export declare class InraidController { protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void; + getAirdropConfig(): IAirdropConfig; } diff --git a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts index 6895383..14bf129 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; @@ -30,7 +30,7 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required + constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required insuranceService: InsuranceService, configServer: ConfigServer); processReturn(): void; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts index f564919..6a1a21e 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts @@ -1,3 +1,4 @@ +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { PaymentHelper } from "../helpers/PaymentHelper"; import { PresetHelper } from "../helpers/PresetHelper"; @@ -22,7 +23,6 @@ import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryT import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { RagfairOfferService } from "../services/RagfairOfferService"; @@ -39,8 +39,8 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/7OnLoadHook/types/controllers/NoteController.d.ts b/TypeScript/7OnLoadHook/types/controllers/NoteController.d.ts index ee70541..9e2e250 100644 --- a/TypeScript/7OnLoadHook/types/controllers/NoteController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/NoteController.d.ts @@ -1,10 +1,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; export declare class NoteController { - protected itemEventRouter: ItemEventRouter; - constructor(itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/7OnLoadHook/types/controllers/PresetBuildController.d.ts b/TypeScript/7OnLoadHook/types/controllers/PresetBuildController.d.ts index adf4084..65ae0c4 100644 --- a/TypeScript/7OnLoadHook/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/PresetBuildController.d.ts @@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; export declare class PresetBuildController { protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); getUserBuilds(sessionID: string): WeaponBuild[]; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts b/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts index 282f50e..842207f 100644 --- a/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts @@ -11,7 +11,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -20,7 +20,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; @@ -31,7 +31,7 @@ export declare class QuestController { protected localeService: LocaleService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) diff --git a/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts b/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts index fe1f472..5440458 100644 --- a/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts @@ -24,7 +24,7 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RagfairServer } from "../servers/RagfairServer"; @@ -42,7 +42,7 @@ export declare class RagfairController { protected logger: ILogger; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; protected databaseServer: DatabaseServer; @@ -64,7 +64,7 @@ export declare class RagfairController { protected ragfairOfferGenerator: RagfairOfferGenerator; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed diff --git a/TypeScript/7OnLoadHook/types/controllers/RepairController.d.ts b/TypeScript/7OnLoadHook/types/controllers/RepairController.d.ts index ae54a53..fd8ff72 100644 --- a/TypeScript/7OnLoadHook/types/controllers/RepairController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/RepairController.d.ts @@ -7,13 +7,13 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "../services/PaymentService"; import { RepairService } from "../services/RepairService"; export declare class RepairController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -21,7 +21,7 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected repairService: RepairService; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); /** * Repair with trader * @param sessionID session id diff --git a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts index 4c31a3d..7db5886 100644 --- a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,7 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ import { ELocationName } from "../models/enums/ELocationName"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -63,13 +63,13 @@ export declare class RepeatableQuestController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected ragfairServerHelper: RagfairServerHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts b/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts index c86745c..0ed0556 100644 --- a/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts @@ -6,15 +6,15 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; declare class TradeController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/7OnLoadHook/types/controllers/TraderController.d.ts b/TypeScript/7OnLoadHook/types/controllers/TraderController.d.ts index b79f55e..d7afe95 100644 --- a/TypeScript/7OnLoadHook/types/controllers/TraderController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/TraderController.d.ts @@ -1,3 +1,4 @@ +import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -17,8 +18,9 @@ export declare class TraderController { protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected fenceService: FenceService; + protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService diff --git a/TypeScript/7OnLoadHook/types/controllers/WishlistController.d.ts b/TypeScript/7OnLoadHook/types/controllers/WishlistController.d.ts index a96c522..83be4b3 100644 --- a/TypeScript/7OnLoadHook/types/controllers/WishlistController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/WishlistController.d.ts @@ -1,10 +1,10 @@ -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistController { - protected itemEvenRouter: ItemEventRouter; - constructor(itemEvenRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/7OnLoadHook/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/FenceBaseAssortGenerator.d.ts new file mode 100644 index 0000000..387df3a --- /dev/null +++ b/TypeScript/7OnLoadHook/types/generators/FenceBaseAssortGenerator.d.ts @@ -0,0 +1,28 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemFilterService } from "../services/ItemFilterService"; +export declare class FenceBaseAssortGenerator { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemHelper: ItemHelper; + protected itemFilterService: ItemFilterService; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + /** + * Create base fence assorts dynamically and store in db + */ + generateFenceBaseAssorts(): void; + /** + * Check if item is valid for being added to fence assorts + * @param item Item to check + * @returns true if valid fence item + */ + protected isValidFenceItem(item: ITemplateItem): boolean; +} diff --git a/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts index 66056c2..bc0d7ec 100644 --- a/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts @@ -17,8 +17,8 @@ export declare class LootGenerator { protected itemFilterService: ItemFilterService; constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); /** - * Generate a list of items based on options passed in - * @param options parameters to adjust what loot is generated + * Generate a list of items based on configuration options parameter + * @param options parameters to adjust how loot is generated * @returns An array of loot items */ createRandomloot(options: LootRequest): LootItem[]; @@ -44,7 +44,13 @@ export declare class LootGenerator { max: number; }>, options: LootRequest, result: LootItem[]): boolean; /** - * + * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values + * @param item item to get stack count of + * @param options loot options + * @returns stack count + */ + protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + /** * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts diff --git a/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts index 0dc2d61..b64a7e7 100644 --- a/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Get avatar url from trader table in db + * @param isTrader Is user we're getting avatar for a trader + * @param userId persons id to get avatar of + * @returns url of avatar + */ + protected getAvatarUrl(isTrader: boolean, userId: string): string; /** * Convert a count of currency into roubles * @param currencyCount amount of currency to convert into roubles diff --git a/TypeScript/7OnLoadHook/types/helpers/DialogueHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/DialogueHelper.d.ts index d2be04d..88a726e 100644 --- a/TypeScript/7OnLoadHook/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/DialogueHelper.d.ts @@ -1,6 +1,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; @@ -8,13 +9,14 @@ import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotifierHelper } from "./NotifierHelper"; export declare class DialogueHelper { + protected logger: ILogger; protected hashUtil: HashUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; protected itemHelper: ItemHelper; - constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. @@ -23,7 +25,7 @@ export declare class DialogueHelper { * @param sessionID * @param rewards */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/7OnLoadHook/types/helpers/HandbookHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/HandbookHelper.d.ts index b47d466..1ab7800 100644 --- a/TypeScript/7OnLoadHook/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { DatabaseServer } from "../servers/DatabaseServer"; declare class LookupItem { byId: Record; byParent: Record; @@ -9,17 +10,35 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected lookup: LookupCollection; - hydrateLookup(lookup: LookupCollection): void; - getTemplatePrice(x: string): number; + protected databaseServer: DatabaseServer; + protected handbookPriceCache: LookupCollection; + constructor(databaseServer: DatabaseServer); + hydrateLookup(): void; + /** + * Get price from internal cache, if cache empty look up price directly in handbook (expensive) + * If no values found, return 1 + * @param tpl item tpl to look up price for + * @returns price in roubles + */ + getTemplatePrice(tpl: string): number; + /** + * all items in template with the given parent category + * @param x + * @returns string array + */ templatesWithParent(x: string): string[]; - isCategory(x: string): boolean; + /** + * Does category exist in handbook cache + * @param category + * @returns true if exists in cache + */ + isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Gets Currency to Ruble conversion Value + * Convert currency into roubles * @param {number} value * @param {string} currencyFrom - * @returns number + * @returns get rouble value of inputted currency */ inRUB(value: number, currencyFrom: string): number; /** diff --git a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts index 7495a6a..5f7e3b7 100644 --- a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts @@ -8,7 +8,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PlayerService } from "../services/PlayerService"; @@ -24,7 +24,7 @@ export declare class HideoutHelper { protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; @@ -35,7 +35,7 @@ export declare class HideoutHelper { static bitcoin: string; static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * This convinience function intialies new Production Object diff --git a/TypeScript/7OnLoadHook/types/helpers/NotificationSendHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/NotificationSendHelper.d.ts index 6c56006..014ac95 100644 --- a/TypeScript/7OnLoadHook/types/helpers/NotificationSendHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { HttpServer } from "../servers/HttpServer"; +import { WebSocketServer } from "../servers/WebSocketServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: HttpServer; + protected webSocketServer: WebSocketServer; protected notificationService: NotificationService; - constructor(httpServer: HttpServer, notificationService: NotificationService); + constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts index d66d150..a6b4892 100644 --- a/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -25,7 +25,7 @@ export declare class QuestHelper { protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected ragfairServerHelper: RagfairServerHelper; @@ -35,7 +35,7 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, 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, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search diff --git a/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts index ea13aae..b73f786 100644 --- a/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts @@ -6,7 +6,7 @@ import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -27,7 +27,7 @@ export declare class RagfairOfferHelper { protected logger: ILogger; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected traderHelper: TraderHelper; protected saveServer: SaveServer; @@ -45,9 +45,15 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if trader offers' BuyRestrictionMax value has been reached + * @param offer offer to check restriction properties of + * @returns true if restriction reached, false if no restrictions/not reached + */ + protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; /** * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check diff --git a/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts index 7ab9768..2a8f0b7 100644 --- a/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts @@ -7,20 +7,20 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; export declare class TradeHelper { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); /** * Buy item from flea or trader * @param pmcData diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts index a349a6d..c5b1cb2 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,5 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -47,7 +48,7 @@ export interface AvailableForProps { compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; - status?: number[]; + status?: QuestStatus[]; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; @@ -99,7 +100,7 @@ export interface Rewards { FailRestartable: Reward[]; Expired: Reward[]; } -export interface Reward { +export interface Reward extends Item { value?: string | number; id: string; type: QuestRewardType; diff --git a/TypeScript/7OnLoadHook/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/7OnLoadHook/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 1d0c0e8..8a29319 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -2,7 +2,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; Ignore: any[]; - InIgnoreList: any[]; + InIgnoreList: string[]; } export interface Friend { _id: string; diff --git a/TypeScript/7OnLoadHook/types/models/eft/game/ICheckVersionResponse.d.ts b/TypeScript/7OnLoadHook/types/models/eft/game/ICheckVersionResponse.d.ts new file mode 100644 index 0000000..fa8aa6f --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/eft/game/ICheckVersionResponse.d.ts @@ -0,0 +1,4 @@ +export interface ICheckVersionResponse { + isvalid: boolean; + latestVersion: string; +} diff --git a/TypeScript/7OnLoadHook/types/models/eft/game/IServerDetails.d.ts b/TypeScript/7OnLoadHook/types/models/eft/game/IServerDetails.d.ts new file mode 100644 index 0000000..101cf99 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/eft/game/IServerDetails.d.ts @@ -0,0 +1,4 @@ +export interface IServerDetails { + ip: string; + port: number; +} diff --git a/TypeScript/7OnLoadHook/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/profile/GetProfileStatusResponseData.d.ts index eee9b4f..cb7368c 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -4,6 +4,7 @@ export interface GetProfileStatusResponseData { } export interface ProfileData { profileid: string; + profileToken: string; status: string; sid: string; ip: string; diff --git a/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts index eaa66c1..cf28c12 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts @@ -37,12 +37,12 @@ export interface Dialogue { attachmentsNew: number; } export interface DialogueInfo { - _id: string; - type: MessageType; - message: MessagePreview; - pinned: boolean; - new: number; attachmentsNew: number; + new: number; + type: MessageType; + pinned: boolean; + message: MessagePreview; + _id: string; } export interface Message { _id: string; diff --git a/TypeScript/7OnLoadHook/types/models/enums/BaseClasses.d.ts b/TypeScript/7OnLoadHook/types/models/enums/BaseClasses.d.ts index 36ebc71..4eb6f7e 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/BaseClasses.d.ts @@ -1,6 +1,9 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", ARMOR = "5448e54d4bdc2dcc718b4568", + ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", + HEADWEAR = "5a341c4086f77401f2541505", + FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", VISORS = "5448e5724bdc2ddf718b4568", diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IAirdropConfig.d.ts index 3edcbdd..53df991 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IAirdropConfig.d.ts @@ -25,6 +25,6 @@ export interface AirdropLoot { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts index 6b1c1e3..8342c99 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts @@ -17,5 +17,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + itemPriceMult: number; + regenerateAssortsOnRefresh: boolean; + itemTypeLimits: Record; blacklist: string[]; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/services/LootRequest.d.ts b/TypeScript/7OnLoadHook/types/models/spt/services/LootRequest.d.ts index 1da8770..8c197ee 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/services/LootRequest.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/services/LootRequest.d.ts @@ -6,6 +6,6 @@ export declare class LootRequest { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/7OnLoadHook/types/routers/EventOutputHolder.d.ts b/TypeScript/7OnLoadHook/types/routers/EventOutputHolder.d.ts new file mode 100644 index 0000000..7a2387b --- /dev/null +++ b/TypeScript/7OnLoadHook/types/routers/EventOutputHolder.d.ts @@ -0,0 +1,11 @@ +import { JsonUtil } from "../utils/JsonUtil"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +export declare class EventOutputHolder { + protected jsonUtil: JsonUtil; + protected profileHelper: ProfileHelper; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected output: IItemEventRouterResponse; + getOutput(sessionID: string): IItemEventRouterResponse; + resetOutput(sessionID: string): void; +} diff --git a/TypeScript/7OnLoadHook/types/routers/ItemEventRouter.d.ts b/TypeScript/7OnLoadHook/types/routers/ItemEventRouter.d.ts index b1ac5d9..e80d16c 100644 --- a/TypeScript/7OnLoadHook/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/7OnLoadHook/types/routers/ItemEventRouter.d.ts @@ -1,17 +1,14 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { ItemEventRouterDefinition } from "../di/Router"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; - protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[]); - protected output: IItemEventRouterResponse; + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; - getOutput(sessionID: string): IItemEventRouterResponse; - protected resetOutput(sessionID: string): void; } diff --git a/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts b/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts index f572a8f..bbca8af 100644 --- a/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts +++ b/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts @@ -1,34 +1,24 @@ /// import http, { IncomingMessage, ServerResponse } from "http"; -import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; -import { NotifierHelper } from "../helpers/NotifierHelper"; -import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; import { IHttpListener } from "./http/IHttpListener"; +import { WebSocketServer } from "./WebSocketServer"; export declare class HttpServer { protected logger: ILogger; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); + protected webSocketServer: WebSocketServer; + constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); protected httpConfig: IHttpConfig; - protected webSockets: {}; - protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - sendMessage(sessionID: string, output: INotification): void; - isConnectionWebSocket(sessionID: string): boolean; handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; - protected getRandomisedMessage(): string; - protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/TypeScript/7OnLoadHook/types/servers/WebSocketServer.d.ts b/TypeScript/7OnLoadHook/types/servers/WebSocketServer.d.ts new file mode 100644 index 0000000..f33d214 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/servers/WebSocketServer.d.ts @@ -0,0 +1,25 @@ +/// +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import WebSocket from "ws"; +import http, { IncomingMessage } from "http"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { RandomUtil } from "../utils/RandomUtil"; +import { INotification } from "../models/eft/notifier/INotifier"; +import { ConfigServer } from "./ConfigServer"; +import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +export declare class WebSocketServer { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected configServer: ConfigServer; + protected httpServerHelper: HttpServerHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, httpServerHelper: HttpServerHelper); + protected httpConfig: IHttpConfig; + protected defaultNotification: INotification; + protected webSockets: Record; + protected websocketPingHandler: any; + setupWebSocket(httpServer: http.Server): void; + sendMessage(sessionID: string, output: INotification): void; + protected getRandomisedMessage(): string; + isConnectionWebSocket(sessionID: string): boolean; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; +} diff --git a/TypeScript/7OnLoadHook/types/services/FenceService.d.ts b/TypeScript/7OnLoadHook/types/services/FenceService.d.ts index 23fbf52..bdcdeb2 100644 --- a/TypeScript/7OnLoadHook/types/services/FenceService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/FenceService.d.ts @@ -3,6 +3,8 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -41,6 +43,13 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item + * @param assort + * @param modifier + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -96,6 +105,21 @@ export declare class FenceService { * @param assorts object to add assorts to */ protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + /** + * Randomise items' upd properties e.g. med packs/weapons/armor + * @param itemDetails Item being randomised + * @param itemToAdjust Item being edited + */ + protected randomiseItemUpdProperties(itemDetails: ITemplateItem, itemToAdjust: Item): void; + /** + * Construct item limit record to hold max and current item count + * @param limits limits as defined in config + * @returns record, key: item tplId, value: current/max item count allowed + */ + protected initItemLimitCounter(limits: Record): Record; /** * Get the next update timestamp for fence * @returns future timestamp diff --git a/TypeScript/7OnLoadHook/types/services/ItemFilterService.d.ts b/TypeScript/7OnLoadHook/types/services/ItemFilterService.d.ts index c9c8ef3..b830d74 100644 --- a/TypeScript/7OnLoadHook/types/services/ItemFilterService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/ItemFilterService.d.ts @@ -2,7 +2,7 @@ import { IItemConfig } from "../models/spt/config/IItemConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */ +/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; protected databaseServer: DatabaseServer; diff --git a/TypeScript/7OnLoadHook/types/services/RagfairOfferService.d.ts b/TypeScript/7OnLoadHook/types/services/RagfairOfferService.d.ts index f9e3a34..a6f6b6d 100644 --- a/TypeScript/7OnLoadHook/types/services/RagfairOfferService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/RagfairOfferService.d.ts @@ -5,7 +5,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -20,14 +20,14 @@ export declare class RagfairOfferService { protected ragfairServerHelper: RagfairServerHelper; protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; protected expiredOffers: Item[]; protected offers: IRagfairOffer[]; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts b/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts index 466c9e3..4ac7794 100644 --- a/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts @@ -10,7 +10,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -export declare class RagfairPriceService { +import { OnLoad } from "../di/OnLoad"; +export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; @@ -19,21 +20,38 @@ export declare class RagfairPriceService { protected randomUtil: RandomUtil; 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, randomUtil: RandomUtil, configServer: ConfigServer); + onLoad(): void; + getRoute(): string; + /** + * Iterate over all items of type "Item" in db and get template price, store in cache + */ generateStaticPrices(): void; - generateDynamicPrices(): void; - hasDynamicPrices(): boolean; - getDynamicPrice(itemTpl: string): number; - getAllFleaPrices(): Record; + protected generateDynamicPrices(): void; + /** + * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * if no static value, return 1 + * @param tplId Item tpl id to get price for + * @returns price in roubles + */ getFleaPriceForItem(tplId: string): number; /** - * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json - * @param itemPrice price of item - * @param itemTpl item template Id being checked - * @returns adjusted price value in roubles + * get the dynamic (flea) price for an item + * Grabs prices from prices.json and stores in class if none currently exist + * @param itemTpl item template id to look up + * @returns price in roubles */ - protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; + getDynamicPriceForItem(itemTpl: string): number; + /** + * Grab the static (handbook) for an item by its tplId + * @param itemTpl item template id to look up + * @returns price in roubles + */ + getStaticPriceForItem(itemTpl: string): number; + getAllFleaPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -41,9 +59,15 @@ export declare class RagfairPriceService { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; - getStaticPriceForItem(tplId: string): number; getBarterPrice(barterScheme: IBarterScheme[]): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; + /** + * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json + * @param itemPrice price of item + * @param itemTpl item template Id being checked + * @returns adjusted price value in roubles + */ + protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; /** * Multiply the price by a randomised curve where n = 2, shift = 2 * @param existingPrice price to alter @@ -58,7 +82,7 @@ export declare class RagfairPriceService { * @param existingPrice price of existing base weapon * @returns */ - getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) diff --git a/TypeScript/7OnLoadHook/types/services/RepairService.d.ts b/TypeScript/7OnLoadHook/types/services/RepairService.d.ts index 3e6077c..d3f1b35 100644 --- a/TypeScript/7OnLoadHook/types/services/RepairService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/RepairService.d.ts @@ -9,13 +9,11 @@ import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -23,7 +21,7 @@ export declare class RepairService { protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/TypeScript/8OnUpdateHook/types/callbacks/DataCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/DataCallbacks.d.ts index cfb1c16..04566ff 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/DataCallbacks.d.ts @@ -1,6 +1,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -18,7 +19,7 @@ export declare class DataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; diff --git a/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts index 06da1b5..5e4c240 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts @@ -1,8 +1,10 @@ import { GameController } from "../controllers/GameController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; @@ -17,8 +19,8 @@ declare class GameCallbacks { gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData; - getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/8OnUpdateHook/types/controllers/CustomizationController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/CustomizationController.d.ts index a6c4730..5fe51e3 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/CustomizationController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/CustomizationController.d.ts @@ -5,16 +5,16 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; export declare class CustomizationController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); getTraderSuits(traderID: string, sessionID: string): ISuit[]; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts index eec7dc5..3bfbdb1 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts @@ -3,7 +3,9 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { Config } from "../models/eft/common/IGlobals"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; @@ -37,6 +39,6 @@ export declare class GameController { protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; - getServer(): any[]; - getValidGameVersion(): any; + getServer(): IServerDetails[]; + getValidGameVersion(): ICheckVersionResponse; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/HealthController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/HealthController.d.ts index cc13603..ce67993 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/HealthController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/HealthController.d.ts @@ -8,16 +8,16 @@ import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestD import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; export declare class HealthController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile diff --git a/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts index dcd8894..ada5bd9 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts @@ -19,7 +19,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -40,7 +40,7 @@ export declare class HideoutController { protected playerService: PlayerService; protected presetHelper: PresetHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected hideoutHelper: HideoutHelper; @@ -49,7 +49,7 @@ export declare class HideoutController { protected jsonUtil: JsonUtil; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/TypeScript/8OnUpdateHook/types/controllers/InraidController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InraidController.d.ts index 102a2fb..e84eea1 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InraidController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InraidController.d.ts @@ -8,6 +8,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -31,6 +32,7 @@ export declare class InraidController { protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; + protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; @@ -68,4 +70,5 @@ export declare class InraidController { protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void; + getAirdropConfig(): IAirdropConfig; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts index 6895383..14bf129 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; @@ -30,7 +30,7 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required + constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required insuranceService: InsuranceService, configServer: ConfigServer); processReturn(): void; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts index f564919..6a1a21e 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts @@ -1,3 +1,4 @@ +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { PaymentHelper } from "../helpers/PaymentHelper"; import { PresetHelper } from "../helpers/PresetHelper"; @@ -22,7 +23,6 @@ import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryT import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { RagfairOfferService } from "../services/RagfairOfferService"; @@ -39,8 +39,8 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/8OnUpdateHook/types/controllers/NoteController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/NoteController.d.ts index ee70541..9e2e250 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/NoteController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/NoteController.d.ts @@ -1,10 +1,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; export declare class NoteController { - protected itemEventRouter: ItemEventRouter; - constructor(itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/8OnUpdateHook/types/controllers/PresetBuildController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/PresetBuildController.d.ts index adf4084..65ae0c4 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/PresetBuildController.d.ts @@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; export declare class PresetBuildController { protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); getUserBuilds(sessionID: string): WeaponBuild[]; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts index 282f50e..842207f 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts @@ -11,7 +11,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -20,7 +20,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; @@ -31,7 +31,7 @@ export declare class QuestController { protected localeService: LocaleService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) diff --git a/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts index fe1f472..5440458 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts @@ -24,7 +24,7 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RagfairServer } from "../servers/RagfairServer"; @@ -42,7 +42,7 @@ export declare class RagfairController { protected logger: ILogger; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; protected databaseServer: DatabaseServer; @@ -64,7 +64,7 @@ export declare class RagfairController { protected ragfairOfferGenerator: RagfairOfferGenerator; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed diff --git a/TypeScript/8OnUpdateHook/types/controllers/RepairController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/RepairController.d.ts index ae54a53..fd8ff72 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/RepairController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/RepairController.d.ts @@ -7,13 +7,13 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "../services/PaymentService"; import { RepairService } from "../services/RepairService"; export declare class RepairController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -21,7 +21,7 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected repairService: RepairService; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); /** * Repair with trader * @param sessionID session id diff --git a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts index 4c31a3d..7db5886 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,7 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ import { ELocationName } from "../models/enums/ELocationName"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -63,13 +63,13 @@ export declare class RepeatableQuestController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected ragfairServerHelper: RagfairServerHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts index c86745c..0ed0556 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts @@ -6,15 +6,15 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; declare class TradeController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/TraderController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/TraderController.d.ts index b79f55e..d7afe95 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/TraderController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/TraderController.d.ts @@ -1,3 +1,4 @@ +import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -17,8 +18,9 @@ export declare class TraderController { protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected fenceService: FenceService; + protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService diff --git a/TypeScript/8OnUpdateHook/types/controllers/WishlistController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/WishlistController.d.ts index a96c522..83be4b3 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/WishlistController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/WishlistController.d.ts @@ -1,10 +1,10 @@ -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistController { - protected itemEvenRouter: ItemEventRouter; - constructor(itemEvenRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/8OnUpdateHook/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/FenceBaseAssortGenerator.d.ts new file mode 100644 index 0000000..387df3a --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/generators/FenceBaseAssortGenerator.d.ts @@ -0,0 +1,28 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemFilterService } from "../services/ItemFilterService"; +export declare class FenceBaseAssortGenerator { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemHelper: ItemHelper; + protected itemFilterService: ItemFilterService; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + /** + * Create base fence assorts dynamically and store in db + */ + generateFenceBaseAssorts(): void; + /** + * Check if item is valid for being added to fence assorts + * @param item Item to check + * @returns true if valid fence item + */ + protected isValidFenceItem(item: ITemplateItem): boolean; +} diff --git a/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts index 66056c2..bc0d7ec 100644 --- a/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts @@ -17,8 +17,8 @@ export declare class LootGenerator { protected itemFilterService: ItemFilterService; constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); /** - * Generate a list of items based on options passed in - * @param options parameters to adjust what loot is generated + * Generate a list of items based on configuration options parameter + * @param options parameters to adjust how loot is generated * @returns An array of loot items */ createRandomloot(options: LootRequest): LootItem[]; @@ -44,7 +44,13 @@ export declare class LootGenerator { max: number; }>, options: LootRequest, result: LootItem[]): boolean; /** - * + * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values + * @param item item to get stack count of + * @param options loot options + * @returns stack count + */ + protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + /** * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts diff --git a/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts index 0dc2d61..b64a7e7 100644 --- a/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Get avatar url from trader table in db + * @param isTrader Is user we're getting avatar for a trader + * @param userId persons id to get avatar of + * @returns url of avatar + */ + protected getAvatarUrl(isTrader: boolean, userId: string): string; /** * Convert a count of currency into roubles * @param currencyCount amount of currency to convert into roubles diff --git a/TypeScript/8OnUpdateHook/types/helpers/DialogueHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/DialogueHelper.d.ts index d2be04d..88a726e 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/DialogueHelper.d.ts @@ -1,6 +1,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; @@ -8,13 +9,14 @@ import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotifierHelper } from "./NotifierHelper"; export declare class DialogueHelper { + protected logger: ILogger; protected hashUtil: HashUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; protected itemHelper: ItemHelper; - constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. @@ -23,7 +25,7 @@ export declare class DialogueHelper { * @param sessionID * @param rewards */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/8OnUpdateHook/types/helpers/HandbookHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/HandbookHelper.d.ts index b47d466..1ab7800 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { DatabaseServer } from "../servers/DatabaseServer"; declare class LookupItem { byId: Record; byParent: Record; @@ -9,17 +10,35 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected lookup: LookupCollection; - hydrateLookup(lookup: LookupCollection): void; - getTemplatePrice(x: string): number; + protected databaseServer: DatabaseServer; + protected handbookPriceCache: LookupCollection; + constructor(databaseServer: DatabaseServer); + hydrateLookup(): void; + /** + * Get price from internal cache, if cache empty look up price directly in handbook (expensive) + * If no values found, return 1 + * @param tpl item tpl to look up price for + * @returns price in roubles + */ + getTemplatePrice(tpl: string): number; + /** + * all items in template with the given parent category + * @param x + * @returns string array + */ templatesWithParent(x: string): string[]; - isCategory(x: string): boolean; + /** + * Does category exist in handbook cache + * @param category + * @returns true if exists in cache + */ + isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Gets Currency to Ruble conversion Value + * Convert currency into roubles * @param {number} value * @param {string} currencyFrom - * @returns number + * @returns get rouble value of inputted currency */ inRUB(value: number, currencyFrom: string): number; /** diff --git a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts index 7495a6a..5f7e3b7 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts @@ -8,7 +8,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PlayerService } from "../services/PlayerService"; @@ -24,7 +24,7 @@ export declare class HideoutHelper { protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; @@ -35,7 +35,7 @@ export declare class HideoutHelper { static bitcoin: string; static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * This convinience function intialies new Production Object diff --git a/TypeScript/8OnUpdateHook/types/helpers/NotificationSendHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/NotificationSendHelper.d.ts index 6c56006..014ac95 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/NotificationSendHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { HttpServer } from "../servers/HttpServer"; +import { WebSocketServer } from "../servers/WebSocketServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: HttpServer; + protected webSocketServer: WebSocketServer; protected notificationService: NotificationService; - constructor(httpServer: HttpServer, notificationService: NotificationService); + constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts index d66d150..a6b4892 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -25,7 +25,7 @@ export declare class QuestHelper { protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected ragfairServerHelper: RagfairServerHelper; @@ -35,7 +35,7 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, 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, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search diff --git a/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts index ea13aae..b73f786 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts @@ -6,7 +6,7 @@ import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -27,7 +27,7 @@ export declare class RagfairOfferHelper { protected logger: ILogger; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected traderHelper: TraderHelper; protected saveServer: SaveServer; @@ -45,9 +45,15 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if trader offers' BuyRestrictionMax value has been reached + * @param offer offer to check restriction properties of + * @returns true if restriction reached, false if no restrictions/not reached + */ + protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; /** * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check diff --git a/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts index 7ab9768..2a8f0b7 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts @@ -7,20 +7,20 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; export declare class TradeHelper { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); /** * Buy item from flea or trader * @param pmcData diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts index a349a6d..c5b1cb2 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,5 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -47,7 +48,7 @@ export interface AvailableForProps { compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; - status?: number[]; + status?: QuestStatus[]; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; @@ -99,7 +100,7 @@ export interface Rewards { FailRestartable: Reward[]; Expired: Reward[]; } -export interface Reward { +export interface Reward extends Item { value?: string | number; id: string; type: QuestRewardType; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 1d0c0e8..8a29319 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -2,7 +2,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; Ignore: any[]; - InIgnoreList: any[]; + InIgnoreList: string[]; } export interface Friend { _id: string; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/game/ICheckVersionResponse.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/game/ICheckVersionResponse.d.ts new file mode 100644 index 0000000..fa8aa6f --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/eft/game/ICheckVersionResponse.d.ts @@ -0,0 +1,4 @@ +export interface ICheckVersionResponse { + isvalid: boolean; + latestVersion: string; +} diff --git a/TypeScript/8OnUpdateHook/types/models/eft/game/IServerDetails.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/game/IServerDetails.d.ts new file mode 100644 index 0000000..101cf99 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/eft/game/IServerDetails.d.ts @@ -0,0 +1,4 @@ +export interface IServerDetails { + ip: string; + port: number; +} diff --git a/TypeScript/8OnUpdateHook/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/profile/GetProfileStatusResponseData.d.ts index eee9b4f..cb7368c 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -4,6 +4,7 @@ export interface GetProfileStatusResponseData { } export interface ProfileData { profileid: string; + profileToken: string; status: string; sid: string; ip: string; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts index eaa66c1..cf28c12 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts @@ -37,12 +37,12 @@ export interface Dialogue { attachmentsNew: number; } export interface DialogueInfo { - _id: string; - type: MessageType; - message: MessagePreview; - pinned: boolean; - new: number; attachmentsNew: number; + new: number; + type: MessageType; + pinned: boolean; + message: MessagePreview; + _id: string; } export interface Message { _id: string; diff --git a/TypeScript/8OnUpdateHook/types/models/enums/BaseClasses.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/BaseClasses.d.ts index 36ebc71..4eb6f7e 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/BaseClasses.d.ts @@ -1,6 +1,9 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", ARMOR = "5448e54d4bdc2dcc718b4568", + ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", + HEADWEAR = "5a341c4086f77401f2541505", + FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", VISORS = "5448e5724bdc2ddf718b4568", diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IAirdropConfig.d.ts index 3edcbdd..53df991 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IAirdropConfig.d.ts @@ -25,6 +25,6 @@ export interface AirdropLoot { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts index 6b1c1e3..8342c99 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts @@ -17,5 +17,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + itemPriceMult: number; + regenerateAssortsOnRefresh: boolean; + itemTypeLimits: Record; blacklist: string[]; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/services/LootRequest.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/services/LootRequest.d.ts index 1da8770..8c197ee 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/services/LootRequest.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/services/LootRequest.d.ts @@ -6,6 +6,6 @@ export declare class LootRequest { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/8OnUpdateHook/types/routers/EventOutputHolder.d.ts b/TypeScript/8OnUpdateHook/types/routers/EventOutputHolder.d.ts new file mode 100644 index 0000000..7a2387b --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/routers/EventOutputHolder.d.ts @@ -0,0 +1,11 @@ +import { JsonUtil } from "../utils/JsonUtil"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +export declare class EventOutputHolder { + protected jsonUtil: JsonUtil; + protected profileHelper: ProfileHelper; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected output: IItemEventRouterResponse; + getOutput(sessionID: string): IItemEventRouterResponse; + resetOutput(sessionID: string): void; +} diff --git a/TypeScript/8OnUpdateHook/types/routers/ItemEventRouter.d.ts b/TypeScript/8OnUpdateHook/types/routers/ItemEventRouter.d.ts index b1ac5d9..e80d16c 100644 --- a/TypeScript/8OnUpdateHook/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/8OnUpdateHook/types/routers/ItemEventRouter.d.ts @@ -1,17 +1,14 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { ItemEventRouterDefinition } from "../di/Router"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; - protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[]); - protected output: IItemEventRouterResponse; + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; - getOutput(sessionID: string): IItemEventRouterResponse; - protected resetOutput(sessionID: string): void; } diff --git a/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts b/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts index f572a8f..bbca8af 100644 --- a/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts +++ b/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts @@ -1,34 +1,24 @@ /// import http, { IncomingMessage, ServerResponse } from "http"; -import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; -import { NotifierHelper } from "../helpers/NotifierHelper"; -import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; import { IHttpListener } from "./http/IHttpListener"; +import { WebSocketServer } from "./WebSocketServer"; export declare class HttpServer { protected logger: ILogger; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); + protected webSocketServer: WebSocketServer; + constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); protected httpConfig: IHttpConfig; - protected webSockets: {}; - protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - sendMessage(sessionID: string, output: INotification): void; - isConnectionWebSocket(sessionID: string): boolean; handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; - protected getRandomisedMessage(): string; - protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/TypeScript/8OnUpdateHook/types/servers/WebSocketServer.d.ts b/TypeScript/8OnUpdateHook/types/servers/WebSocketServer.d.ts new file mode 100644 index 0000000..f33d214 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/servers/WebSocketServer.d.ts @@ -0,0 +1,25 @@ +/// +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import WebSocket from "ws"; +import http, { IncomingMessage } from "http"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { RandomUtil } from "../utils/RandomUtil"; +import { INotification } from "../models/eft/notifier/INotifier"; +import { ConfigServer } from "./ConfigServer"; +import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +export declare class WebSocketServer { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected configServer: ConfigServer; + protected httpServerHelper: HttpServerHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, httpServerHelper: HttpServerHelper); + protected httpConfig: IHttpConfig; + protected defaultNotification: INotification; + protected webSockets: Record; + protected websocketPingHandler: any; + setupWebSocket(httpServer: http.Server): void; + sendMessage(sessionID: string, output: INotification): void; + protected getRandomisedMessage(): string; + isConnectionWebSocket(sessionID: string): boolean; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; +} diff --git a/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts b/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts index 23fbf52..bdcdeb2 100644 --- a/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts @@ -3,6 +3,8 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -41,6 +43,13 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item + * @param assort + * @param modifier + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -96,6 +105,21 @@ export declare class FenceService { * @param assorts object to add assorts to */ protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + /** + * Randomise items' upd properties e.g. med packs/weapons/armor + * @param itemDetails Item being randomised + * @param itemToAdjust Item being edited + */ + protected randomiseItemUpdProperties(itemDetails: ITemplateItem, itemToAdjust: Item): void; + /** + * Construct item limit record to hold max and current item count + * @param limits limits as defined in config + * @returns record, key: item tplId, value: current/max item count allowed + */ + protected initItemLimitCounter(limits: Record): Record; /** * Get the next update timestamp for fence * @returns future timestamp diff --git a/TypeScript/8OnUpdateHook/types/services/ItemFilterService.d.ts b/TypeScript/8OnUpdateHook/types/services/ItemFilterService.d.ts index c9c8ef3..b830d74 100644 --- a/TypeScript/8OnUpdateHook/types/services/ItemFilterService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/ItemFilterService.d.ts @@ -2,7 +2,7 @@ import { IItemConfig } from "../models/spt/config/IItemConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */ +/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; protected databaseServer: DatabaseServer; diff --git a/TypeScript/8OnUpdateHook/types/services/RagfairOfferService.d.ts b/TypeScript/8OnUpdateHook/types/services/RagfairOfferService.d.ts index f9e3a34..a6f6b6d 100644 --- a/TypeScript/8OnUpdateHook/types/services/RagfairOfferService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/RagfairOfferService.d.ts @@ -5,7 +5,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -20,14 +20,14 @@ export declare class RagfairOfferService { protected ragfairServerHelper: RagfairServerHelper; protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; protected expiredOffers: Item[]; protected offers: IRagfairOffer[]; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts b/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts index 466c9e3..4ac7794 100644 --- a/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts @@ -10,7 +10,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -export declare class RagfairPriceService { +import { OnLoad } from "../di/OnLoad"; +export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; @@ -19,21 +20,38 @@ export declare class RagfairPriceService { protected randomUtil: RandomUtil; 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, randomUtil: RandomUtil, configServer: ConfigServer); + onLoad(): void; + getRoute(): string; + /** + * Iterate over all items of type "Item" in db and get template price, store in cache + */ generateStaticPrices(): void; - generateDynamicPrices(): void; - hasDynamicPrices(): boolean; - getDynamicPrice(itemTpl: string): number; - getAllFleaPrices(): Record; + protected generateDynamicPrices(): void; + /** + * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * if no static value, return 1 + * @param tplId Item tpl id to get price for + * @returns price in roubles + */ getFleaPriceForItem(tplId: string): number; /** - * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json - * @param itemPrice price of item - * @param itemTpl item template Id being checked - * @returns adjusted price value in roubles + * get the dynamic (flea) price for an item + * Grabs prices from prices.json and stores in class if none currently exist + * @param itemTpl item template id to look up + * @returns price in roubles */ - protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; + getDynamicPriceForItem(itemTpl: string): number; + /** + * Grab the static (handbook) for an item by its tplId + * @param itemTpl item template id to look up + * @returns price in roubles + */ + getStaticPriceForItem(itemTpl: string): number; + getAllFleaPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -41,9 +59,15 @@ export declare class RagfairPriceService { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; - getStaticPriceForItem(tplId: string): number; getBarterPrice(barterScheme: IBarterScheme[]): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; + /** + * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json + * @param itemPrice price of item + * @param itemTpl item template Id being checked + * @returns adjusted price value in roubles + */ + protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; /** * Multiply the price by a randomised curve where n = 2, shift = 2 * @param existingPrice price to alter @@ -58,7 +82,7 @@ export declare class RagfairPriceService { * @param existingPrice price of existing base weapon * @returns */ - getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) diff --git a/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts b/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts index 3e6077c..d3f1b35 100644 --- a/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts @@ -9,13 +9,11 @@ import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -23,7 +21,7 @@ export declare class RepairService { protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/TypeScript/9RouterHooks/types/callbacks/DataCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/DataCallbacks.d.ts index cfb1c16..04566ff 100644 --- a/TypeScript/9RouterHooks/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/DataCallbacks.d.ts @@ -1,6 +1,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; +import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -18,7 +19,7 @@ export declare class DataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; diff --git a/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts index 06da1b5..5e4c240 100644 --- a/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts @@ -1,8 +1,10 @@ import { GameController } from "../controllers/GameController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; @@ -17,8 +19,8 @@ declare class GameCallbacks { gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData; - getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/9RouterHooks/types/controllers/CustomizationController.d.ts b/TypeScript/9RouterHooks/types/controllers/CustomizationController.d.ts index a6c4730..5fe51e3 100644 --- a/TypeScript/9RouterHooks/types/controllers/CustomizationController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/CustomizationController.d.ts @@ -5,16 +5,16 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; export declare class CustomizationController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); getTraderSuits(traderID: string, sessionID: string): ISuit[]; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/9RouterHooks/types/controllers/GameController.d.ts b/TypeScript/9RouterHooks/types/controllers/GameController.d.ts index eec7dc5..3bfbdb1 100644 --- a/TypeScript/9RouterHooks/types/controllers/GameController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/GameController.d.ts @@ -3,7 +3,9 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { Config } from "../models/eft/common/IGlobals"; +import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; +import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; @@ -37,6 +39,6 @@ export declare class GameController { protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; - getServer(): any[]; - getValidGameVersion(): any; + getServer(): IServerDetails[]; + getValidGameVersion(): ICheckVersionResponse; } diff --git a/TypeScript/9RouterHooks/types/controllers/HealthController.d.ts b/TypeScript/9RouterHooks/types/controllers/HealthController.d.ts index cc13603..ce67993 100644 --- a/TypeScript/9RouterHooks/types/controllers/HealthController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/HealthController.d.ts @@ -8,16 +8,16 @@ import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestD import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; export declare class HealthController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile diff --git a/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts b/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts index dcd8894..ada5bd9 100644 --- a/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts @@ -19,7 +19,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -40,7 +40,7 @@ export declare class HideoutController { protected playerService: PlayerService; protected presetHelper: PresetHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected hideoutHelper: HideoutHelper; @@ -49,7 +49,7 @@ export declare class HideoutController { protected jsonUtil: JsonUtil; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/TypeScript/9RouterHooks/types/controllers/InraidController.d.ts b/TypeScript/9RouterHooks/types/controllers/InraidController.d.ts index 102a2fb..e84eea1 100644 --- a/TypeScript/9RouterHooks/types/controllers/InraidController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InraidController.d.ts @@ -8,6 +8,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -31,6 +32,7 @@ export declare class InraidController { protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; + protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; @@ -68,4 +70,5 @@ export declare class InraidController { protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void; + getAirdropConfig(): IAirdropConfig; } diff --git a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts index 6895383..14bf129 100644 --- a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; @@ -30,7 +30,7 @@ export declare class InsuranceController { protected insuranceService: InsuranceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required + constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required insuranceService: InsuranceService, configServer: ConfigServer); processReturn(): void; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts b/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts index f564919..6a1a21e 100644 --- a/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts @@ -1,3 +1,4 @@ +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { PaymentHelper } from "../helpers/PaymentHelper"; import { PresetHelper } from "../helpers/PresetHelper"; @@ -22,7 +23,6 @@ import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryT import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { RagfairOfferService } from "../services/RagfairOfferService"; @@ -39,8 +39,8 @@ export declare class InventoryController { protected ragfairOfferService: RagfairOfferService; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; - protected itemEventRouter: ItemEventRouter; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder); /** * Move Item * change location of item with parentId and slotId diff --git a/TypeScript/9RouterHooks/types/controllers/NoteController.d.ts b/TypeScript/9RouterHooks/types/controllers/NoteController.d.ts index ee70541..9e2e250 100644 --- a/TypeScript/9RouterHooks/types/controllers/NoteController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/NoteController.d.ts @@ -1,10 +1,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; export declare class NoteController { - protected itemEventRouter: ItemEventRouter; - constructor(itemEventRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/9RouterHooks/types/controllers/PresetBuildController.d.ts b/TypeScript/9RouterHooks/types/controllers/PresetBuildController.d.ts index adf4084..65ae0c4 100644 --- a/TypeScript/9RouterHooks/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/PresetBuildController.d.ts @@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; export declare class PresetBuildController { protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); getUserBuilds(sessionID: string): WeaponBuild[]; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts b/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts index 282f50e..842207f 100644 --- a/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts @@ -11,7 +11,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -20,7 +20,7 @@ import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected dialogueHelper: DialogueHelper; @@ -31,7 +31,7 @@ export declare class QuestController { protected localeService: LocaleService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) diff --git a/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts b/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts index fe1f472..5440458 100644 --- a/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts @@ -24,7 +24,7 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RagfairServer } from "../servers/RagfairServer"; @@ -42,7 +42,7 @@ export declare class RagfairController { protected logger: ILogger; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected ragfairServer: RagfairServer; protected ragfairPriceService: RagfairPriceService; protected databaseServer: DatabaseServer; @@ -64,7 +64,7 @@ export declare class RagfairController { protected ragfairOfferGenerator: RagfairOfferGenerator; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed diff --git a/TypeScript/9RouterHooks/types/controllers/RepairController.d.ts b/TypeScript/9RouterHooks/types/controllers/RepairController.d.ts index ae54a53..fd8ff72 100644 --- a/TypeScript/9RouterHooks/types/controllers/RepairController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/RepairController.d.ts @@ -7,13 +7,13 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "../services/PaymentService"; import { RepairService } from "../services/RepairService"; export declare class RepairController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -21,7 +21,7 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected repairService: RepairService; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); /** * Repair with trader * @param sessionID session id diff --git a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts index 4c31a3d..7db5886 100644 --- a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts @@ -13,7 +13,7 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ import { ELocationName } from "../models/enums/ELocationName"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -63,13 +63,13 @@ export declare class RepeatableQuestController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected ragfairServerHelper: RagfairServerHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected paymentService: PaymentService; protected objectId: ObjectId; protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * Returns an array of objects in the format of repeatable quests to the client. diff --git a/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts b/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts index c86745c..0ed0556 100644 --- a/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts @@ -6,15 +6,15 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; declare class TradeController { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/9RouterHooks/types/controllers/TraderController.d.ts b/TypeScript/9RouterHooks/types/controllers/TraderController.d.ts index b79f55e..d7afe95 100644 --- a/TypeScript/9RouterHooks/types/controllers/TraderController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/TraderController.d.ts @@ -1,3 +1,4 @@ +import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; @@ -17,8 +18,9 @@ export declare class TraderController { protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected fenceService: FenceService; + protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService diff --git a/TypeScript/9RouterHooks/types/controllers/WishlistController.d.ts b/TypeScript/9RouterHooks/types/controllers/WishlistController.d.ts index a96c522..83be4b3 100644 --- a/TypeScript/9RouterHooks/types/controllers/WishlistController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/WishlistController.d.ts @@ -1,10 +1,10 @@ -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistController { - protected itemEvenRouter: ItemEventRouter; - constructor(itemEvenRouter: ItemEventRouter); + protected eventOutputHolder: EventOutputHolder; + constructor(eventOutputHolder: EventOutputHolder); addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/9RouterHooks/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/FenceBaseAssortGenerator.d.ts new file mode 100644 index 0000000..387df3a --- /dev/null +++ b/TypeScript/9RouterHooks/types/generators/FenceBaseAssortGenerator.d.ts @@ -0,0 +1,28 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemFilterService } from "../services/ItemFilterService"; +export declare class FenceBaseAssortGenerator { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemHelper: ItemHelper; + protected itemFilterService: ItemFilterService; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); + /** + * Create base fence assorts dynamically and store in db + */ + generateFenceBaseAssorts(): void; + /** + * Check if item is valid for being added to fence assorts + * @param item Item to check + * @returns true if valid fence item + */ + protected isValidFenceItem(item: ITemplateItem): boolean; +} diff --git a/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts index 66056c2..bc0d7ec 100644 --- a/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts @@ -17,8 +17,8 @@ export declare class LootGenerator { protected itemFilterService: ItemFilterService; constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); /** - * Generate a list of items based on options passed in - * @param options parameters to adjust what loot is generated + * Generate a list of items based on configuration options parameter + * @param options parameters to adjust how loot is generated * @returns An array of loot items */ createRandomloot(options: LootRequest): LootItem[]; @@ -44,7 +44,13 @@ export declare class LootGenerator { max: number; }>, options: LootRequest, result: LootItem[]): boolean; /** - * + * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values + * @param item item to get stack count of + * @param options loot options + * @returns stack count + */ + protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + /** * Find a random item in items.json and add to result array * @param globalDefaultPresets presets to choose from * @param itemTypeCounts item limit counts diff --git a/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts index 0dc2d61..b64a7e7 100644 --- a/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts @@ -39,6 +39,13 @@ export declare class RagfairOfferGenerator { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; + /** + * Get avatar url from trader table in db + * @param isTrader Is user we're getting avatar for a trader + * @param userId persons id to get avatar of + * @returns url of avatar + */ + protected getAvatarUrl(isTrader: boolean, userId: string): string; /** * Convert a count of currency into roubles * @param currencyCount amount of currency to convert into roubles diff --git a/TypeScript/9RouterHooks/types/helpers/DialogueHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/DialogueHelper.d.ts index d2be04d..88a726e 100644 --- a/TypeScript/9RouterHooks/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/DialogueHelper.d.ts @@ -1,6 +1,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; @@ -8,13 +9,14 @@ import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotifierHelper } from "./NotifierHelper"; export declare class DialogueHelper { + protected logger: ILogger; protected hashUtil: HashUtil; protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; protected itemHelper: ItemHelper; - constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. @@ -23,7 +25,7 @@ export declare class DialogueHelper { * @param sessionID * @param rewards */ - addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void; /** * Get the preview contents of the last message in a dialogue. * @param dialogue diff --git a/TypeScript/9RouterHooks/types/helpers/HandbookHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/HandbookHelper.d.ts index b47d466..1ab7800 100644 --- a/TypeScript/9RouterHooks/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { DatabaseServer } from "../servers/DatabaseServer"; declare class LookupItem { byId: Record; byParent: Record; @@ -9,17 +10,35 @@ export declare class LookupCollection { constructor(); } export declare class HandbookHelper { - protected lookup: LookupCollection; - hydrateLookup(lookup: LookupCollection): void; - getTemplatePrice(x: string): number; + protected databaseServer: DatabaseServer; + protected handbookPriceCache: LookupCollection; + constructor(databaseServer: DatabaseServer); + hydrateLookup(): void; + /** + * Get price from internal cache, if cache empty look up price directly in handbook (expensive) + * If no values found, return 1 + * @param tpl item tpl to look up price for + * @returns price in roubles + */ + getTemplatePrice(tpl: string): number; + /** + * all items in template with the given parent category + * @param x + * @returns string array + */ templatesWithParent(x: string): string[]; - isCategory(x: string): boolean; + /** + * Does category exist in handbook cache + * @param category + * @returns true if exists in cache + */ + isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Gets Currency to Ruble conversion Value + * Convert currency into roubles * @param {number} value * @param {string} currencyFrom - * @returns number + * @returns get rouble value of inputted currency */ inRUB(value: number, currencyFrom: string): number; /** diff --git a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts index 7495a6a..5f7e3b7 100644 --- a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts @@ -8,7 +8,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PlayerService } from "../services/PlayerService"; @@ -24,7 +24,7 @@ export declare class HideoutHelper { protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; @@ -35,7 +35,7 @@ export declare class HideoutHelper { static bitcoin: string; static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * This convinience function intialies new Production Object diff --git a/TypeScript/9RouterHooks/types/helpers/NotificationSendHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/NotificationSendHelper.d.ts index 6c56006..014ac95 100644 --- a/TypeScript/9RouterHooks/types/helpers/NotificationSendHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/NotificationSendHelper.d.ts @@ -1,10 +1,10 @@ import { INotification } from "../models/eft/notifier/INotifier"; -import { HttpServer } from "../servers/HttpServer"; +import { WebSocketServer } from "../servers/WebSocketServer"; import { NotificationService } from "../services/NotificationService"; export declare class NotificationSendHelper { - protected httpServer: HttpServer; + protected webSocketServer: WebSocketServer; protected notificationService: NotificationService; - constructor(httpServer: HttpServer, notificationService: NotificationService); + constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** * Send notification message to the appropiate channel */ diff --git a/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts index d66d150..a6b4892 100644 --- a/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRe import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; @@ -25,7 +25,7 @@ export declare class QuestHelper { protected timeUtil: TimeUtil; protected hashUtil: HashUtil; protected itemHelper: ItemHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected ragfairServerHelper: RagfairServerHelper; @@ -35,7 +35,7 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, 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, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search diff --git a/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts index ea13aae..b73f786 100644 --- a/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts @@ -6,7 +6,7 @@ import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -27,7 +27,7 @@ export declare class RagfairOfferHelper { protected logger: ILogger; protected timeUtil: TimeUtil; protected hashUtil: HashUtil; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected traderHelper: TraderHelper; protected saveServer: SaveServer; @@ -45,9 +45,15 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if trader offers' BuyRestrictionMax value has been reached + * @param offer offer to check restriction properties of + * @returns true if restriction reached, false if no restrictions/not reached + */ + protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; /** * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check diff --git a/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts index 7ab9768..2a8f0b7 100644 --- a/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts @@ -7,20 +7,20 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; export declare class TradeHelper { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); /** * Buy item from flea or trader * @param pmcData diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts index a349a6d..c5b1cb2 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,5 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -47,7 +48,7 @@ export interface AvailableForProps { compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; - status?: number[]; + status?: QuestStatus[]; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; @@ -99,7 +100,7 @@ export interface Rewards { FailRestartable: Reward[]; Expired: Reward[]; } -export interface Reward { +export interface Reward extends Item { value?: string | number; id: string; type: QuestRewardType; diff --git a/TypeScript/9RouterHooks/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/TypeScript/9RouterHooks/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 1d0c0e8..8a29319 100644 --- a/TypeScript/9RouterHooks/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -2,7 +2,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; Ignore: any[]; - InIgnoreList: any[]; + InIgnoreList: string[]; } export interface Friend { _id: string; diff --git a/TypeScript/9RouterHooks/types/models/eft/game/ICheckVersionResponse.d.ts b/TypeScript/9RouterHooks/types/models/eft/game/ICheckVersionResponse.d.ts new file mode 100644 index 0000000..fa8aa6f --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/eft/game/ICheckVersionResponse.d.ts @@ -0,0 +1,4 @@ +export interface ICheckVersionResponse { + isvalid: boolean; + latestVersion: string; +} diff --git a/TypeScript/9RouterHooks/types/models/eft/game/IServerDetails.d.ts b/TypeScript/9RouterHooks/types/models/eft/game/IServerDetails.d.ts new file mode 100644 index 0000000..101cf99 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/eft/game/IServerDetails.d.ts @@ -0,0 +1,4 @@ +export interface IServerDetails { + ip: string; + port: number; +} diff --git a/TypeScript/9RouterHooks/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/9RouterHooks/types/models/eft/profile/GetProfileStatusResponseData.d.ts index eee9b4f..cb7368c 100644 --- a/TypeScript/9RouterHooks/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -4,6 +4,7 @@ export interface GetProfileStatusResponseData { } export interface ProfileData { profileid: string; + profileToken: string; status: string; sid: string; ip: string; diff --git a/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts index eaa66c1..cf28c12 100644 --- a/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts @@ -37,12 +37,12 @@ export interface Dialogue { attachmentsNew: number; } export interface DialogueInfo { - _id: string; - type: MessageType; - message: MessagePreview; - pinned: boolean; - new: number; attachmentsNew: number; + new: number; + type: MessageType; + pinned: boolean; + message: MessagePreview; + _id: string; } export interface Message { _id: string; diff --git a/TypeScript/9RouterHooks/types/models/enums/BaseClasses.d.ts b/TypeScript/9RouterHooks/types/models/enums/BaseClasses.d.ts index 36ebc71..4eb6f7e 100644 --- a/TypeScript/9RouterHooks/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/BaseClasses.d.ts @@ -1,6 +1,9 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", ARMOR = "5448e54d4bdc2dcc718b4568", + ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", + HEADWEAR = "5a341c4086f77401f2541505", + FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", VISORS = "5448e5724bdc2ddf718b4568", diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IAirdropConfig.d.ts index 3edcbdd..53df991 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IAirdropConfig.d.ts @@ -25,6 +25,6 @@ export interface AirdropLoot { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts index 6b1c1e3..8342c99 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts @@ -17,5 +17,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + itemPriceMult: number; + regenerateAssortsOnRefresh: boolean; + itemTypeLimits: Record; blacklist: string[]; } diff --git a/TypeScript/9RouterHooks/types/models/spt/services/LootRequest.d.ts b/TypeScript/9RouterHooks/types/models/spt/services/LootRequest.d.ts index 1da8770..8c197ee 100644 --- a/TypeScript/9RouterHooks/types/models/spt/services/LootRequest.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/services/LootRequest.d.ts @@ -6,6 +6,6 @@ export declare class LootRequest { itemTypeWhitelist: string[]; /** key: item base type: value: max count */ itemLimits: Record; + itemStackLimits: Record; armorLevelWhitelist: number[]; - moneyStackLimits: Record; } diff --git a/TypeScript/9RouterHooks/types/routers/EventOutputHolder.d.ts b/TypeScript/9RouterHooks/types/routers/EventOutputHolder.d.ts new file mode 100644 index 0000000..7a2387b --- /dev/null +++ b/TypeScript/9RouterHooks/types/routers/EventOutputHolder.d.ts @@ -0,0 +1,11 @@ +import { JsonUtil } from "../utils/JsonUtil"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +export declare class EventOutputHolder { + protected jsonUtil: JsonUtil; + protected profileHelper: ProfileHelper; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected output: IItemEventRouterResponse; + getOutput(sessionID: string): IItemEventRouterResponse; + resetOutput(sessionID: string): void; +} diff --git a/TypeScript/9RouterHooks/types/routers/ItemEventRouter.d.ts b/TypeScript/9RouterHooks/types/routers/ItemEventRouter.d.ts index b1ac5d9..e80d16c 100644 --- a/TypeScript/9RouterHooks/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/9RouterHooks/types/routers/ItemEventRouter.d.ts @@ -1,17 +1,14 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { ItemEventRouterDefinition } from "../di/Router"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; - protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[]); - protected output: IItemEventRouterResponse; + protected eventOutputHolder: EventOutputHolder; + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; - getOutput(sessionID: string): IItemEventRouterResponse; - protected resetOutput(sessionID: string): void; } diff --git a/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts b/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts index f572a8f..bbca8af 100644 --- a/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts +++ b/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts @@ -1,34 +1,24 @@ /// import http, { IncomingMessage, ServerResponse } from "http"; -import WebSocket from "ws"; import { ApplicationContext } from "../context/ApplicationContext"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; -import { NotifierHelper } from "../helpers/NotifierHelper"; -import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; import { DatabaseServer } from "./DatabaseServer"; import { IHttpListener } from "./http/IHttpListener"; +import { WebSocketServer } from "./WebSocketServer"; export declare class HttpServer { protected logger: ILogger; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; - protected notifierHelper: NotifierHelper; protected httpServerHelper: HttpServerHelper; protected httpListeners: IHttpListener[]; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext); + protected webSocketServer: WebSocketServer; + constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); protected httpConfig: IHttpConfig; - protected webSockets: {}; - protected websocketPingHandler: any; getCookies(req: http.IncomingMessage): any; - sendMessage(sessionID: string, output: INotification): void; - isConnectionWebSocket(sessionID: string): boolean; handleRequest(req: IncomingMessage, resp: ServerResponse): void; load(): void; - protected getRandomisedMessage(): string; - protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; } diff --git a/TypeScript/9RouterHooks/types/servers/WebSocketServer.d.ts b/TypeScript/9RouterHooks/types/servers/WebSocketServer.d.ts new file mode 100644 index 0000000..f33d214 --- /dev/null +++ b/TypeScript/9RouterHooks/types/servers/WebSocketServer.d.ts @@ -0,0 +1,25 @@ +/// +import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import WebSocket from "ws"; +import http, { IncomingMessage } from "http"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { RandomUtil } from "../utils/RandomUtil"; +import { INotification } from "../models/eft/notifier/INotifier"; +import { ConfigServer } from "./ConfigServer"; +import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +export declare class WebSocketServer { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected configServer: ConfigServer; + protected httpServerHelper: HttpServerHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, httpServerHelper: HttpServerHelper); + protected httpConfig: IHttpConfig; + protected defaultNotification: INotification; + protected webSockets: Record; + protected websocketPingHandler: any; + setupWebSocket(httpServer: http.Server): void; + sendMessage(sessionID: string, output: INotification): void; + protected getRandomisedMessage(): string; + isConnectionWebSocket(sessionID: string): boolean; + protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void; +} diff --git a/TypeScript/9RouterHooks/types/services/FenceService.d.ts b/TypeScript/9RouterHooks/types/services/FenceService.d.ts index 23fbf52..bdcdeb2 100644 --- a/TypeScript/9RouterHooks/types/services/FenceService.d.ts +++ b/TypeScript/9RouterHooks/types/services/FenceService.d.ts @@ -3,6 +3,8 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -41,6 +43,13 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item + * @param assort + * @param modifier + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -96,6 +105,21 @@ export declare class FenceService { * @param assorts object to add assorts to */ protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + /** + * Randomise items' upd properties e.g. med packs/weapons/armor + * @param itemDetails Item being randomised + * @param itemToAdjust Item being edited + */ + protected randomiseItemUpdProperties(itemDetails: ITemplateItem, itemToAdjust: Item): void; + /** + * Construct item limit record to hold max and current item count + * @param limits limits as defined in config + * @returns record, key: item tplId, value: current/max item count allowed + */ + protected initItemLimitCounter(limits: Record): Record; /** * Get the next update timestamp for fence * @returns future timestamp diff --git a/TypeScript/9RouterHooks/types/services/ItemFilterService.d.ts b/TypeScript/9RouterHooks/types/services/ItemFilterService.d.ts index c9c8ef3..b830d74 100644 --- a/TypeScript/9RouterHooks/types/services/ItemFilterService.d.ts +++ b/TypeScript/9RouterHooks/types/services/ItemFilterService.d.ts @@ -2,7 +2,7 @@ import { IItemConfig } from "../models/spt/config/IItemConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */ +/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; protected databaseServer: DatabaseServer; diff --git a/TypeScript/9RouterHooks/types/services/RagfairOfferService.d.ts b/TypeScript/9RouterHooks/types/services/RagfairOfferService.d.ts index f9e3a34..a6f6b6d 100644 --- a/TypeScript/9RouterHooks/types/services/RagfairOfferService.d.ts +++ b/TypeScript/9RouterHooks/types/services/RagfairOfferService.d.ts @@ -5,7 +5,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -20,14 +20,14 @@ export declare class RagfairOfferService { protected ragfairServerHelper: RagfairServerHelper; protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; - protected itemEventRouter: ItemEventRouter; + protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; protected expiredOffers: Item[]; protected offers: IRagfairOffer[]; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts b/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts index 466c9e3..4ac7794 100644 --- a/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts +++ b/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts @@ -10,7 +10,8 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -export declare class RagfairPriceService { +import { OnLoad } from "../di/OnLoad"; +export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; @@ -19,21 +20,38 @@ export declare class RagfairPriceService { protected randomUtil: RandomUtil; 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, randomUtil: RandomUtil, configServer: ConfigServer); + onLoad(): void; + getRoute(): string; + /** + * Iterate over all items of type "Item" in db and get template price, store in cache + */ generateStaticPrices(): void; - generateDynamicPrices(): void; - hasDynamicPrices(): boolean; - getDynamicPrice(itemTpl: string): number; - getAllFleaPrices(): Record; + protected generateDynamicPrices(): void; + /** + * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * if no static value, return 1 + * @param tplId Item tpl id to get price for + * @returns price in roubles + */ getFleaPriceForItem(tplId: string): number; /** - * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json - * @param itemPrice price of item - * @param itemTpl item template Id being checked - * @returns adjusted price value in roubles + * get the dynamic (flea) price for an item + * Grabs prices from prices.json and stores in class if none currently exist + * @param itemTpl item template id to look up + * @returns price in roubles */ - protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; + getDynamicPriceForItem(itemTpl: string): number; + /** + * Grab the static (handbook) for an item by its tplId + * @param itemTpl item template id to look up + * @returns price in roubles + */ + getStaticPriceForItem(itemTpl: string): number; + getAllFleaPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -41,9 +59,15 @@ export declare class RagfairPriceService { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; - getStaticPriceForItem(tplId: string): number; getBarterPrice(barterScheme: IBarterScheme[]): number; getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; + /** + * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json + * @param itemPrice price of item + * @param itemTpl item template Id being checked + * @returns adjusted price value in roubles + */ + protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number; /** * Multiply the price by a randomised curve where n = 2, shift = 2 * @param existingPrice price to alter @@ -58,7 +82,7 @@ export declare class RagfairPriceService { * @param existingPrice price of existing base weapon * @returns */ - getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) diff --git a/TypeScript/9RouterHooks/types/services/RepairService.d.ts b/TypeScript/9RouterHooks/types/services/RepairService.d.ts index 3e6077c..d3f1b35 100644 --- a/TypeScript/9RouterHooks/types/services/RepairService.d.ts +++ b/TypeScript/9RouterHooks/types/services/RepairService.d.ts @@ -9,13 +9,11 @@ import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; -import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; - protected itemEventRouter: ItemEventRouter; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected traderHelper: TraderHelper; @@ -23,7 +21,7 @@ export declare class RepairService { protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id diff --git a/readme.md b/readme.md index dff7704..6ea461d 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# Mod examples for 3.2.4 +# Mod examples for 3.2.5 A collection of example mods that perform typical actions in SPT