diff --git a/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/bepInEx/plugins/Faupi-HideoutArchitect.dll b/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/bepInEx/plugins/Faupi-HideoutArchitect.dll similarity index 74% rename from Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/bepInEx/plugins/Faupi-HideoutArchitect.dll rename to Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/bepInEx/plugins/Faupi-HideoutArchitect.dll index d3df414..283d091 100644 Binary files a/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/bepInEx/plugins/Faupi-HideoutArchitect.dll and b/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/bepInEx/plugins/Faupi-HideoutArchitect.dll differ diff --git a/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/user/mods/HideoutArchitect/LICENSE b/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/user/mods/HideoutArchitect/LICENSE similarity index 100% rename from Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/user/mods/HideoutArchitect/LICENSE rename to Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/user/mods/HideoutArchitect/LICENSE diff --git a/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/user/mods/HideoutArchitect/config.jsonc b/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/user/mods/HideoutArchitect/config.jsonc similarity index 100% rename from Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/user/mods/HideoutArchitect/config.jsonc rename to Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/user/mods/HideoutArchitect/config.jsonc diff --git a/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/user/mods/HideoutArchitect/package.json b/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/user/mods/HideoutArchitect/package.json similarity index 92% rename from Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/user/mods/HideoutArchitect/package.json rename to Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/user/mods/HideoutArchitect/package.json index 3a7112e..92d07bf 100644 --- a/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/user/mods/HideoutArchitect/package.json +++ b/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/user/mods/HideoutArchitect/package.json @@ -1,10 +1,10 @@ { "name": "HideoutArchitect", - "version": "1.6.9", + "version": "1.7.0", "main": "./src/hideoutarchitect.js", "license": "NCSA Open Source", "author": "Faupi", - "akiVersion": "3.4.0", + "akiVersion": "3.5.0", "updated by": "CWX", "scripts": { "setup": "npm i", diff --git a/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/user/mods/HideoutArchitect/res/icon_neededforhideout_small.png b/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/user/mods/HideoutArchitect/res/icon_neededforhideout_small.png similarity index 100% rename from Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/user/mods/HideoutArchitect/res/icon_neededforhideout_small.png rename to Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/user/mods/HideoutArchitect/res/icon_neededforhideout_small.png diff --git a/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/user/mods/HideoutArchitect/res/translations.json b/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/user/mods/HideoutArchitect/res/translations.json similarity index 100% rename from Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/user/mods/HideoutArchitect/res/translations.json rename to Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/user/mods/HideoutArchitect/res/translations.json diff --git a/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/user/mods/HideoutArchitect/src/hideoutarchitect.ts b/Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/user/mods/HideoutArchitect/src/hideoutarchitect.ts similarity index 100% rename from Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.6.9/user/mods/HideoutArchitect/src/hideoutarchitect.ts rename to Faupi-HideoutArchitect/Built/Faupi-HideoutArchitect 1.7.0/user/mods/HideoutArchitect/src/hideoutarchitect.ts diff --git a/Faupi-HideoutArchitect/HideoutArchitect/HideoutArchitect/Program.cs b/Faupi-HideoutArchitect/HideoutArchitect/HideoutArchitect/Program.cs index a322fac..9b8683a 100644 --- a/Faupi-HideoutArchitect/HideoutArchitect/HideoutArchitect/Program.cs +++ b/Faupi-HideoutArchitect/HideoutArchitect/HideoutArchitect/Program.cs @@ -10,7 +10,7 @@ using UnityEngine; namespace HideoutArchitect { - [BepInPlugin("com.FAUPI.HideoutArchitect", "FAUPI-HideoutArchitect", "1.6.9")] + [BepInPlugin("com.FAUPI.HideoutArchitect", "FAUPI-HideoutArchitect", "1.7.0")] public class HideoutArchitect : BaseUnityPlugin { private void Awake() @@ -73,12 +73,12 @@ namespace HideoutArchitect { bool areaActive = area.Status != EAreaStatus.NotSet && area.Template.Enabled == true; - List targetedRequirements; + List targetedRequirements; switch (ModConfig.NeededForHideoutDefinition) { case ENeededDefinition.NextLevel: case ENeededDefinition.NextLevelReady: - targetedRequirements = area.NextStage.Requirements.Value as List; + targetedRequirements = area.NextStage.Requirements.Value as List; break; default: throw new NotImplementedException(Enum.GetName(typeof(ENeededDefinition), ModConfig.NeededForHideoutDefinition)); diff --git a/Faupi-HideoutArchitect/server/dist/package.json b/Faupi-HideoutArchitect/server/dist/package.json index 3a7112e..92d07bf 100644 --- a/Faupi-HideoutArchitect/server/dist/package.json +++ b/Faupi-HideoutArchitect/server/dist/package.json @@ -1,10 +1,10 @@ { "name": "HideoutArchitect", - "version": "1.6.9", + "version": "1.7.0", "main": "./src/hideoutarchitect.js", "license": "NCSA Open Source", "author": "Faupi", - "akiVersion": "3.4.0", + "akiVersion": "3.5.0", "updated by": "CWX", "scripts": { "setup": "npm i", diff --git a/Faupi-HideoutArchitect/server/package.json b/Faupi-HideoutArchitect/server/package.json index 3a7112e..92d07bf 100644 --- a/Faupi-HideoutArchitect/server/package.json +++ b/Faupi-HideoutArchitect/server/package.json @@ -1,10 +1,10 @@ { "name": "HideoutArchitect", - "version": "1.6.9", + "version": "1.7.0", "main": "./src/hideoutarchitect.js", "license": "NCSA Open Source", "author": "Faupi", - "akiVersion": "3.4.0", + "akiVersion": "3.5.0", "updated by": "CWX", "scripts": { "setup": "npm i", diff --git a/Faupi-HideoutArchitect/server/types/callbacks/DataCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/callbacks/DataCallbacks.d.ts index 2efcf81..26f5899 100644 --- a/Faupi-HideoutArchitect/server/types/callbacks/DataCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/callbacks/DataCallbacks.d.ts @@ -1,14 +1,16 @@ +import { HideoutController } from "../controllers/HideoutController"; +import { RagfairController } from "../controllers/RagfairController"; 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 { IGetItemPricesResponse } from "../models/eft/game/IGetItemPricesResponse"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "../models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; -import { ILanguageBase } from "../models/spt/server/ILocaleBase"; import { ISettingsBase } from "../models/spt/server/ISettingsBase"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; @@ -18,7 +20,9 @@ import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer); + protected ragfairController: RagfairController; + protected hideoutController: HideoutController; + constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handles client/settings * @returns ISettingsBase @@ -54,7 +58,17 @@ export declare class DataCallbacks { getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle client/hideout/qte/list + */ + getQteList(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle client/items/prices/ + * Called when viewing a traders assorts + * TODO - fully implement this + */ + getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/Faupi-HideoutArchitect/server/types/callbacks/DialogueCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/callbacks/DialogueCallbacks.d.ts index 7b2eeae..63d7163 100644 --- a/Faupi-HideoutArchitect/server/types/callbacks/DialogueCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "../controllers/DialogueController"; import { OnUpdate } from "../di/OnUpdate"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { IChatServer } from "../models/eft/dialog/IChatServer"; import { IFriendRequestData } from "../models/eft/dialog/IFriendRequestData"; import { IGetAllAttachmentsRequestData } from "../models/eft/dialog/IGetAllAttachmentsRequestData"; import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse"; @@ -20,7 +21,7 @@ import { DialogueInfo } from "../models/eft/profile/IAkiProfile"; import { HashUtil } from "../utils/HashUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { TimeUtil } from "../utils/TimeUtil"; -export declare class DialogueCallbacks extends OnUpdate { +export declare class DialogueCallbacks implements OnUpdate { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; @@ -35,7 +36,7 @@ export declare class DialogueCallbacks extends OnUpdate { * Handles client/chatServer/list * @returns */ - getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData; + getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData; getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData; getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData; getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData; @@ -52,6 +53,6 @@ export declare class DialogueCallbacks extends OnUpdate { listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; friendRequest(url: string, request: IFriendRequestData, sessionID: string): INullResponseData; sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; - onUpdate(timeSinceLastRun: number): boolean; + onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/Faupi-HideoutArchitect/server/types/callbacks/HandbookCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/callbacks/HandbookCallbacks.d.ts index 891e375..6bd3909 100644 --- a/Faupi-HideoutArchitect/server/types/callbacks/HandbookCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/callbacks/HandbookCallbacks.d.ts @@ -1,8 +1,8 @@ import { HandbookController } from "../controllers/HandbookController"; import { OnLoad } from "../di/OnLoad"; -export declare class HandbookCallbacks extends OnLoad { +export declare class HandbookCallbacks implements OnLoad { protected handbookController: HandbookController; constructor(handbookController: HandbookController); - onLoad(): void; + onLoad(): Promise; getRoute(): string; } diff --git a/Faupi-HideoutArchitect/server/types/callbacks/HealthCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/callbacks/HealthCallbacks.d.ts index 7edf03e..bd3e507 100644 --- a/Faupi-HideoutArchitect/server/types/callbacks/HealthCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/callbacks/HealthCallbacks.d.ts @@ -7,6 +7,7 @@ import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealReques import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { IWorkoutData } from "../models/eft/health/IWorkoutData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class HealthCallbacks { protected httpResponse: HttpResponseUtil; @@ -21,6 +22,14 @@ export declare class HealthCallbacks { * @returns empty response, no data sent back to client */ syncHealth(url: string, info: ISyncHealthRequestData, sessionID: string): IGetBodyResponseData; + /** + * Custom aki server request found in modules/QTEPatch.cs + * @param url + * @param info HealthListener.Instance.CurrentHealth class + * @param sessionID session id + * @returns empty response, no data sent back to client + */ + handleWorkoutEffects(url: string, info: IWorkoutData, sessionID: string): IGetBodyResponseData; /** * Handle Eat * @returns IItemEventRouterResponse diff --git a/Faupi-HideoutArchitect/server/types/callbacks/HideoutCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/callbacks/HideoutCallbacks.d.ts index e39e806..d0247f9 100644 --- a/Faupi-HideoutArchitect/server/types/callbacks/HideoutCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/callbacks/HideoutCallbacks.d.ts @@ -1,7 +1,9 @@ import { HideoutController } from "../controllers/HideoutController"; import { OnUpdate } from "../di/OnUpdate"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; +import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; +import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData"; import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData"; import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData"; @@ -10,10 +12,11 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData"; import { IHideoutUpgradeCompleteRequestData } from "../models/eft/hideout/IHideoutUpgradeCompleteRequestData"; import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData"; +import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ConfigServer } from "../servers/ConfigServer"; -export declare class HideoutCallbacks extends OnUpdate { +export declare class HideoutCallbacks implements OnUpdate { protected hideoutController: HideoutController; protected configServer: ConfigServer; protected hideoutConfig: IHideoutConfig; @@ -21,76 +24,52 @@ export declare class HideoutCallbacks extends OnUpdate { configServer: ConfigServer); /** * Handle HideoutUpgrade - * @param pmcData - * @param body - * @param sessionID - * @returns */ upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutUpgradeComplete - * @param pmcData - * @param body - * @param sessionID - * @returns */ upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutPutItemsInAreaSlots - * @param pmcData - * @param body - * @param sessionID - * @returns */ putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutTakeItemsFromAreaSlots - * @param pmcData - * @param body - * @param sessionID - * @returns */ takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutToggleArea - * @param pmcData - * @param body - * @param sessionID - * @returns */ toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutSingleProductionStart - * @param pmcData - * @param body - * @param sessionID - * @returns */ singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutScavCaseProductionStart - * @param pmcData - * @param body - * @param sessionID - * @returns */ scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutContinuousProductionStart - * @param pmcData - * @param body - * @param sessionID - * @returns */ - continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutTakeProduction - * @param pmcData - * @param body - * @param sessionID - * @returns */ takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; - onUpdate(timeSinceLastRun: number): boolean; + /** + * Handle HideoutQuickTimeEvent + */ + handleQTEEvent(pmcData: IPmcData, request: IHandleQTEEventRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - RecordShootingRangePoints + */ + recordShootingRangePoints(pmcData: IPmcData, request: IRecordShootingRangePoints, sessionId: string): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - RecordShootingRangePoints + */ + improveArea(pmcData: IPmcData, request: IHideoutImproveAreaRequestData, sessionId: string): IItemEventRouterResponse; + onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/Faupi-HideoutArchitect/server/types/callbacks/HttpCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/callbacks/HttpCallbacks.d.ts index 43928a1..10794fa 100644 --- a/Faupi-HideoutArchitect/server/types/callbacks/HttpCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/callbacks/HttpCallbacks.d.ts @@ -1,9 +1,9 @@ import { OnLoad } from "../di/OnLoad"; import { HttpServer } from "../servers/HttpServer"; -export declare class HttpCallbacks extends OnLoad { +export declare class HttpCallbacks implements OnLoad { protected httpServer: HttpServer; constructor(httpServer: HttpServer); - onLoad(): void; + onLoad(): Promise; getRoute(): string; getImage(): string; } diff --git a/Faupi-HideoutArchitect/server/types/callbacks/InsuranceCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/callbacks/InsuranceCallbacks.d.ts index a171e1c..aea0756 100644 --- a/Faupi-HideoutArchitect/server/types/callbacks/InsuranceCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/callbacks/InsuranceCallbacks.d.ts @@ -10,7 +10,7 @@ import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { InsuranceService } from "../services/InsuranceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; -export declare class InsuranceCallbacks extends OnUpdate { +export declare class InsuranceCallbacks implements OnUpdate { protected insuranceController: InsuranceController; protected insuranceService: InsuranceService; protected httpResponse: HttpResponseUtil; @@ -27,6 +27,6 @@ export declare class InsuranceCallbacks extends OnUpdate { * @returns IItemEventRouterResponse */ insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; - onUpdate(secondsSinceLastRun: number): boolean; + onUpdate(secondsSinceLastRun: number): Promise; getRoute(): string; } diff --git a/Faupi-HideoutArchitect/server/types/callbacks/MatchCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/callbacks/MatchCallbacks.d.ts index 10fbc44..52e3290 100644 --- a/Faupi-HideoutArchitect/server/types/callbacks/MatchCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/callbacks/MatchCallbacks.d.ts @@ -7,10 +7,10 @@ import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequest import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; +import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; -import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; @@ -41,6 +41,6 @@ export declare class MatchCallbacks { getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; - startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; + getRaidConfiguration(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData; } diff --git a/Faupi-HideoutArchitect/server/types/callbacks/ModCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/callbacks/ModCallbacks.d.ts index aec2f59..d1ec7f7 100644 --- a/Faupi-HideoutArchitect/server/types/callbacks/ModCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/callbacks/ModCallbacks.d.ts @@ -3,20 +3,19 @@ import { PostAkiModLoader } from "../loaders/PostAkiModLoader"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { LocalisationService } from "../services/LocalisationService"; import { HttpFileUtil } from "../utils/HttpFileUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; -declare class ModCallbacks extends OnLoad { +declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; protected postAkiModLoader: PostAkiModLoader; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; - constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, configServer: ConfigServer); - onLoad(): void; + constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, localisationService: LocalisationService, configServer: ConfigServer); + onLoad(): Promise; getRoute(): string; - sendBundle(sessionID: string, req: any, resp: any, body: any): void; - getBundles(url: string, info: any, sessionID: string): string; - getBundle(url: string, info: any, sessionID: string): string; } export { ModCallbacks }; diff --git a/Faupi-HideoutArchitect/server/types/callbacks/PresetCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/callbacks/PresetCallbacks.d.ts index 4553f8f..37bf4e8 100644 --- a/Faupi-HideoutArchitect/server/types/callbacks/PresetCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/callbacks/PresetCallbacks.d.ts @@ -1,8 +1,8 @@ import { PresetController } from "../controllers/PresetController"; import { OnLoad } from "../di/OnLoad"; -export declare class PresetCallbacks extends OnLoad { +export declare class PresetCallbacks implements OnLoad { protected presetController: PresetController; constructor(presetController: PresetController); - onLoad(): void; + onLoad(): Promise; getRoute(): string; } diff --git a/Faupi-HideoutArchitect/server/types/callbacks/RagfairCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/callbacks/RagfairCallbacks.d.ts index 37f3807..97713e7 100644 --- a/Faupi-HideoutArchitect/server/types/callbacks/RagfairCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/callbacks/RagfairCallbacks.d.ts @@ -1,5 +1,6 @@ +import { OnLoad } from "../di/OnLoad"; +import { OnUpdate } from "../di/OnUpdate"; import { RagfairController } from "../controllers/RagfairController"; -import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; @@ -14,7 +15,6 @@ import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferReque import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; @@ -22,23 +22,26 @@ import { JsonUtil } from "../utils/JsonUtil"; /** * Handle ragfair related callback events */ -export declare class RagfairCallbacks extends OnLoadOnUpdate { +export declare class RagfairCallbacks implements OnLoad, OnUpdate { protected httpResponse: HttpResponseUtil; - protected logger: ILogger; protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected ragfairController: RagfairController; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(httpResponse: HttpResponseUtil, logger: ILogger, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer); - onLoad(): void; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer); + onLoad(): Promise; getRoute(): string; search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData; getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData; - getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse; removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; - onUpdate(timeSinceLastRun: number): boolean; + /** + * Handle /client/items/prices + * Called when clicking an item to list on flea + */ + getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; + onUpdate(timeSinceLastRun: number): Promise; sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/Faupi-HideoutArchitect/server/types/callbacks/SaveCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/callbacks/SaveCallbacks.d.ts index bbb6e53..93ffd96 100644 --- a/Faupi-HideoutArchitect/server/types/callbacks/SaveCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/callbacks/SaveCallbacks.d.ts @@ -1,9 +1,10 @@ -import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate"; +import { OnLoad } from "../di/OnLoad"; +import { OnUpdate } from "../di/OnUpdate"; import { SaveServer } from "../servers/SaveServer"; -export declare class SaveCallbacks extends OnLoadOnUpdate { +export declare class SaveCallbacks implements OnLoad, OnUpdate { protected saveServer: SaveServer; constructor(saveServer: SaveServer); - onLoad(): void; + onLoad(): Promise; getRoute(): string; - onUpdate(secondsSinceLastRun: number): boolean; + onUpdate(secondsSinceLastRun: number): Promise; } diff --git a/Faupi-HideoutArchitect/server/types/callbacks/TradeCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/callbacks/TradeCallbacks.d.ts index 272ae46..4291da8 100644 --- a/Faupi-HideoutArchitect/server/types/callbacks/TradeCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/callbacks/TradeCallbacks.d.ts @@ -6,6 +6,9 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); + /** + * Handle client/game/profile/items/moving TradingConfirm + */ processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/Faupi-HideoutArchitect/server/types/callbacks/TraderCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/callbacks/TraderCallbacks.d.ts index 40a1455..8df1049 100644 --- a/Faupi-HideoutArchitect/server/types/callbacks/TraderCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/callbacks/TraderCallbacks.d.ts @@ -1,15 +1,16 @@ +import { OnLoad } from "../di/OnLoad"; +import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; -import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; -export declare class TraderCallbacks extends OnLoadOnUpdate { +export declare class TraderCallbacks implements OnLoad, OnUpdate { protected httpResponse: HttpResponseUtil; protected traderController: TraderController; constructor(httpResponse: HttpResponseUtil, traderController: TraderController); - onLoad(): void; - onUpdate(): boolean; + onLoad(): Promise; + onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; /** diff --git a/Faupi-HideoutArchitect/server/types/context/ApplicationContext.d.ts b/Faupi-HideoutArchitect/server/types/context/ApplicationContext.d.ts index a155bcd..28bbdf7 100644 --- a/Faupi-HideoutArchitect/server/types/context/ApplicationContext.d.ts +++ b/Faupi-HideoutArchitect/server/types/context/ApplicationContext.d.ts @@ -3,6 +3,15 @@ import { ContextVariableType } from "./ContextVariableType"; export declare class ApplicationContext { private variables; private static holderMaxSize; + /** + * Called like: + * + * const registerPlayerInfo = this.applicationContext.getLatestValue(ContextVariableType.REGISTER_PLAYER_REQUEST).getValue(); + * + * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.MATCH_INFO).getValue(); + * @param type + * @returns + */ getLatestValue(type: ContextVariableType): ContextVariable; getValues(type: ContextVariableType): ContextVariable[]; addValue(type: ContextVariableType, value: any): void; diff --git a/Faupi-HideoutArchitect/server/types/context/ContextVariableType.d.ts b/Faupi-HideoutArchitect/server/types/context/ContextVariableType.d.ts index a7dd9b5..49f3267 100644 --- a/Faupi-HideoutArchitect/server/types/context/ContextVariableType.d.ts +++ b/Faupi-HideoutArchitect/server/types/context/ContextVariableType.d.ts @@ -2,7 +2,9 @@ export declare enum ContextVariableType { /** Logged in users session id */ SESSION_ID = 0, /** Currently acive raid information */ - MATCH_INFO = 1, + RAID_CONFIGURATION = 1, /** Timestamp when client first connected */ - CLIENT_START_TIMESTAMP = 2 + CLIENT_START_TIMESTAMP = 2, + /** When player is loading into map and loot is requested */ + REGISTER_PLAYER_REQUEST = 3 } diff --git a/Faupi-HideoutArchitect/server/types/controllers/BotController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/BotController.d.ts index 51c0c68..1d7eb9d 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/BotController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/BotController.d.ts @@ -3,7 +3,6 @@ import { BotGenerator } from "../generators/BotGenerator"; import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper"; import { BotHelper } from "../helpers/BotHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; -import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData"; import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; @@ -23,14 +22,13 @@ export declare class BotController { protected botDifficultyHelper: BotDifficultyHelper; protected botGenerationCacheService: BotGenerationCacheService; protected localisationService: LocalisationService; - protected weightedRandomHelper: WeightedRandomHelper; protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; static readonly pmcTypeLabel = "PMC"; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** * Return the number of bot loadout varieties to be generated * @param type bot Type we want the loadout gen count for @@ -57,6 +55,12 @@ export declare class BotController { * @returns IBotBase array */ generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[]; + /** + * Get the difficulty passed in, if its not "asoline", get selected difficulty from config + * @param requestedDifficulty + * @returns + */ + getPMCDifficulty(requestedDifficulty: string): string; /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value diff --git a/Faupi-HideoutArchitect/server/types/controllers/CustomizationController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/CustomizationController.d.ts index 5fe51e3..a4ef8cf 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/CustomizationController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/CustomizationController.d.ts @@ -8,13 +8,15 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; +import { LocalisationService } from "../services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; + protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, 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/Faupi-HideoutArchitect/server/types/controllers/DialogueController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/DialogueController.d.ts index 9c8b728..98d3d52 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/DialogueController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/DialogueController.d.ts @@ -27,6 +27,7 @@ export declare class DialogueController { */ getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo; /** + * Handle player clicking 'messenger' and seeing all the messages they've recieved * Set the content of the dialogue on the details panel, showing all the messages * for the specified dialogue. * @param dialogueID Dialog id diff --git a/Faupi-HideoutArchitect/server/types/controllers/GameController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/GameController.d.ts index f4f5849..44264dc 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/GameController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/GameController.d.ts @@ -1,59 +1,74 @@ import { ApplicationContext } from "../context/ApplicationContext"; -import { GameEventHelper } from "../helpers/GameEventHelper"; +import { HideoutHelper } from "../helpers/HideoutHelper"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { Config } from "../models/eft/common/IGlobals"; +import { IPmcData } from "../models/eft/common/IPmcData"; 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"; -import { ISeasonalEvent } from "../models/spt/config/ISeasonalEventConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -import { LocaleService } from "../services/LocaleService"; +import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { LocalisationService } from "../services/LocalisationService"; +import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; -import { Watermark } from "../utils/Watermark"; +import { SeasonalEventService } from "../services/SeasonalEventService"; +import { TimeUtil } from "../utils/TimeUtil"; export declare class GameController { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected watermark: Watermark; + protected timeUtil: TimeUtil; + protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; - protected localeService: LocaleService; + protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; - protected gameEventHelper: GameEventHelper; + protected customLocationWaveService: CustomLocationWaveService; + protected openZoneService: OpenZoneService; + protected seasonalEventService: SeasonalEventService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, watermark: Watermark, httpServerHelper: HttpServerHelper, localeService: LocaleService, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, gameEventHelper: GameEventHelper, applicationContext: ApplicationContext, configServer: ConfigServer); + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; /** - * Check if current date falls inside any of the seasons events pased in, if so, handle them - * @param seasonalEvents events to check for + * When player logs in, iterate over all active effects and reduce timer + * TODO - add body part HP regen + * @param pmcProfile */ - protected checkForAndEnableSeasonalEvents(seasonalEvents: ISeasonalEvent[]): void; + protected updateProfileHealthValues(pmcProfile: IPmcData): void; /** - * Make adjusted to server code based on the name of the event passed in - * @param globalConfig globals.json - * @param eventName Name of the event to enable. e.g. Christmas + * Waves with an identical min/max values spawn nothing, the number of bots that spawn is the difference between min and max */ - protected updateGlobalEvents(globalConfig: Config, eventName: string): void; + protected fixBrokenOfflineMapWaves(): void; /** - * Read in data from seasonalEvents.json and add found equipment items to bots - * @param eventName Name of the event to read equipment in from config + * Make Rogues spawn later to allow for scavs to spawn first instead of rogues filling up all spawn positions */ - protected addEventGearToScavs(eventName: string): void; + protected fixRoguesSpawningInstantlyOnLighthouse(): void; /** - * Set Khorovod(dancing tree) chance to 100% on all maps that support it + * Get a list of installed mods and save their details to the profile being used + * @param fullProfile Profile to add mod details to */ - protected enableDancingTree(): void; + protected saveActiveModsToProfile(fullProfile: IAkiProfile): void; + /** + * Add the logged in players name to PMC name pool + * @param pmcProfile + */ + protected addPlayerToPMCNames(pmcProfile: IPmcData): void; + /** + * Blank out the "test" mail message from prapor + */ + protected removePraporTestMessage(): void; /** * Make non-trigger-spawned raiders spawn earlier + always */ @@ -61,6 +76,5 @@ export declare class GameController { protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; getServer(): IServerDetails[]; - protected addPumpkinsToScavBackpacks(): void; getValidGameVersion(): ICheckVersionResponse; } diff --git a/Faupi-HideoutArchitect/server/types/controllers/HealthController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/HealthController.d.ts index ce67993..7c149cc 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/HealthController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/HealthController.d.ts @@ -1,23 +1,28 @@ -import { ItemHelper } from "../helpers/ItemHelper"; -import { PaymentService } from "../services/PaymentService"; -import { InventoryHelper } from "../helpers/InventoryHelper"; import { HealthHelper } from "../helpers/HealthHelper"; +import { InventoryHelper } from "../helpers/InventoryHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData"; import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData"; import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; +import { IWorkoutData } from "../models/eft/health/IWorkoutData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { LocalisationService } from "../services/LocalisationService"; +import { PaymentService } from "../services/PaymentService"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class HealthController { protected logger: ILogger; + protected jsonUtil: JsonUtil; protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; + protected localisationService: LocalisationService; protected healthHelper: HealthHelper; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, jsonUtil: JsonUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile @@ -25,7 +30,7 @@ export declare class HealthController { * @param sessionID * @param addEffects Should effects found be added or removed from profile */ - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** * When healing in menu * @param pmcData @@ -34,13 +39,35 @@ export declare class HealthController { * @returns */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Consume food/water outside of a raid + * @param pmcData Player profile + * @param body request Object + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; /** * Occurs on post-raid healing page * @param pmcData player profile - * @param info Request data from client + * @param healthTreatmentRequest Request data from client * @param sessionID Session id * @returns */ - healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; + healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; + /** + * applies skills from hideout workout. + * @param pmcData Player profile + * @param info Request data + * @param sessionID + */ + applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void; + /** + * Iterate over treatment request diff and find effects to remove from player limbs + * @param sessionId + * @param profile Profile to update + * @param treatmentRequest client request + * @param output response to send to client + */ + protected removeEffectsAfterPostRaidHeal(sessionId: string, profile: IPmcData, treatmentRequest: IHealthTreatmentRequestData, output: IItemEventRouterResponse): void; } diff --git a/Faupi-HideoutArchitect/server/types/controllers/HideoutController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/HideoutController.d.ts index 5b6507b..e6e0243 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/HideoutController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/HideoutController.d.ts @@ -7,7 +7,9 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; -import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; +import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; +import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData"; import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData"; @@ -16,6 +18,8 @@ import { IHideoutTakeItemOutRequestData } from "../models/eft/hideout/IHideoutTa import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData"; import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData"; import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData"; +import { IQteData } from "../models/eft/hideout/IQteData"; +import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -23,6 +27,7 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; +import { FenceService } from "../services/FenceService"; import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { HashUtil } from "../utils/HashUtil"; @@ -49,12 +54,28 @@ export declare class HideoutController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; + protected fenceService: FenceService; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil); - upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; - upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** + * Start a hideout area upgrade + * @param pmcData Player profile + * @param request upgrade start request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + startUpgrade(pmcData: IPmcData, request: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Complete a hideout area upgrade + * @param pmcData Player profile + * @param request Completed upgrade request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory * @param pmcData Profile data * @param addItemToHideoutRequest reqeust from client to place item in area slot @@ -62,7 +83,14 @@ export declare class HideoutController { * @returns IItemEventRouterResponse object */ putItemsInAreaSlots(pmcData: IPmcData, addItemToHideoutRequest: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse; - takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Remove item from hideout area and place into player inventory + * @param pmcData Player profile + * @param request Take item out of area request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + takeItemsFromAreaSlots(pmcData: IPmcData, request: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse; /** * Find resource item in hideout area, add copy to player inventory, remove Item from hideout slot * @param sessionID Session id @@ -73,7 +101,21 @@ export declare class HideoutController { * @returns IItemEventRouterResponse response */ protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: HideoutArea): IItemEventRouterResponse; - toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Toggle area on/off + * @param pmcData Player profile + * @param request Toggle area request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + toggleArea(pmcData: IPmcData, request: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Start production for an item from hideout area + * @param pmcData Player profile + * @param body Start prodution of single item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles event after clicking 'start' on the scav case hideout page @@ -83,24 +125,96 @@ export declare class HideoutController { * @returns item event router response */ scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Adjust scav case time based on fence standing + * + * @param pmcData Player profile + * @param productionTime Time to complete scav case in seconds + * @returns Adjusted scav case time in seconds + */ + protected getScavCaseTime(pmcData: IPmcData, productionTime: number): number; /** * Add generated scav case rewards to player profile * @param pmcData player profile to add rewards to * @param rewards reward items to add to profile + * @param recipieId recipie id to save into Production dict */ - protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[]): void; - continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; - takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; - protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; + protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[], recipieId: string): void; + /** + * Start production of continuously created item + * @param pmcData Player profile + * @param request Continious production request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + continuousProductionStart(pmcData: IPmcData, request: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Take completed item out of hideout area and place into player inventory + * @param pmcData Player profile + * @param request Remove production from area request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + takeProduction(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Take recipie-type production out of hideout area and place into player inventory + * @param sessionID Session id + * @param recipe Completed recipie of item + * @param pmcData Player profile + * @param request Remove production from area request + * @param output Output object to update + * @returns IItemEventRouterResponse + */ + protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Handles giving rewards stored in player profile to player after clicking 'get rewards' - * @param sessionID - * @param pmcData - * @param body - * @param output - * @returns + * @param sessionID Session id + * @param pmcData Player profile + * @param request Get rewards from scavcase craft request + * @param output Output object to update + * @returns IItemEventRouterResponse + */ + protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; + /** + * Start area production for item + * @param pmcData Player profile + * @param request Start production request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + registerProduction(pmcData: IPmcData, request: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Get quick time event list for hideout + * // TODO - implement this + * @param sessionId Session id + * @returns IQteData array + */ + getQteList(sessionId: string): IQteData[]; + /** + * Handle HideoutQuickTimeEvent on client/game/profile/items/moving + * Called after completing workout at gym + * @param sessionId Session id + * @param pmcData Profile to adjust + * @param request QTE result object + */ + handleQTEEventOutcome(sessionId: string, pmcData: IPmcData, request: IHandleQTEEventRequestData): IItemEventRouterResponse; + /** + * Record a high score from the shooting range into a player profiles overallcounters + * @param sessionId Session id + * @param pmcData Profile to update + * @param request shooting range score request + * @returns IItemEventRouterResponse + */ + recordShootingRangePoints(sessionId: string, pmcData: IPmcData, request: IRecordShootingRangePoints): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - HideoutImproveArea + * @param sessionId Session id + * @param pmcData profile to improve area in + * @param request improve area request data + */ + improveArea(sessionId: string, pmcData: IPmcData, request: IHideoutImproveAreaRequestData): IItemEventRouterResponse; + /** + * Function called every x seconds as part of onUpdate event */ - protected handleScavCase(sessionID: string, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; - registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; update(): void; } diff --git a/Faupi-HideoutArchitect/server/types/controllers/InraidController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/InraidController.d.ts index 39a6396..f954eff 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/InraidController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/InraidController.d.ts @@ -1,3 +1,4 @@ +import { ApplicationContext } from "../context/ApplicationContext"; import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; import { HealthHelper } from "../helpers/HealthHelper"; import { InRaidHelper } from "../helpers/InRaidHelper"; @@ -35,12 +36,13 @@ export declare class InraidController { protected traderHelper: TraderHelper; protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; + protected applicationContext: ApplicationContext; 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); + 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, applicationContext: ApplicationContext, configServer: ConfigServer); /** - * Save locationid to active profiles inraid object + * Save locationId to active profiles inraid object AND app context * @param sessionID Session id * @param info Register player request */ diff --git a/Faupi-HideoutArchitect/server/types/controllers/InsuranceController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/InsuranceController.d.ts index 54f31b5..af6e68d 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/InsuranceController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/InsuranceController.d.ts @@ -31,13 +31,23 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, insuranceService: InsuranceService, configServer: ConfigServer); + /** + * Process insurance items prior to being given to player in mail + */ processReturn(): void; + /** + * Add insurance to an item + * @param pmcData Player profile + * @param body Insurance request + * @param sessionID Session id + * @returns IItemEventRouterResponse object to send to client + */ insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; /** * Calculate insurance cost * @param info request object * @param sessionID session id - * @returns response object to send to client + * @returns IGetInsuranceCostResponseData object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/Faupi-HideoutArchitect/server/types/controllers/InventoryController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/InventoryController.d.ts index e1c08c0..129ede3 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/InventoryController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/InventoryController.d.ts @@ -129,9 +129,14 @@ export declare class InventoryController { protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** - * Handles sorting of Inventory. + * Handle ApplyInventoryChanges + * Sorts supplied items. + * @param pmcData Player profile + * @param request sort request + * @param sessionID Session id + * @returns IItemEventRouterResponse */ - sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse; + sortInventory(pmcData: IPmcData, request: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse; createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse; deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse; editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/Faupi-HideoutArchitect/server/types/controllers/MatchController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/MatchController.d.ts index 2b0d150..cb0c755 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/MatchController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/MatchController.d.ts @@ -6,10 +6,9 @@ import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequest import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; +import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; -import { BotDifficulty } from "../models/enums/BotDifficulty"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; @@ -42,12 +41,17 @@ export declare class MatchController { joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; getGroupStatus(info: IGetGroupStatusRequestData): any; - startOfflineRaid(info: IStartOfflineRaidRequestData, sessionID: string): void; + /** + * Handle /client/raid/configuration + * @param request + * @param sessionID + */ + startOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void; /** * Convert a difficulty value from pre-raid screen to a bot difficulty - * @param botDifficulty dropdown difficulty + * @param botDifficulty dropdown difficulty value * @returns bot difficulty */ - protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: BotDifficulty): string; + protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: string): string; endOfflineRaid(info: IEndOfflineRaidRequestData, sessionID: string): void; } diff --git a/Faupi-HideoutArchitect/server/types/controllers/ProfileController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/ProfileController.d.ts index 8c89a02..e76785a 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/ProfileController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/ProfileController.d.ts @@ -1,6 +1,7 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; +import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IMiniProfile } from "../models/eft/launcher/IMiniProfile"; @@ -24,8 +25,9 @@ export declare class ProfileController { protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; protected traderHelper: TraderHelper; + protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/Faupi-HideoutArchitect/server/types/controllers/QuestController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/QuestController.d.ts index 842207f..fe1754d 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/QuestController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IQuest, Reward } from "../models/eft/common/tables/IQuest"; +import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData"; @@ -15,11 +16,14 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; +import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; +import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; @@ -29,9 +33,10 @@ export declare class QuestController { protected questConditionHelper: QuestConditionHelper; protected playerService: PlayerService; protected localeService: LocaleService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - 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); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) @@ -55,7 +60,30 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; + /** + * Handle the client accepting a repeatable quest and starting it + * Send starting rewards if any to player and + * Send start notification if any to player + * @param pmcData Profile to update with new quest + * @param acceptedQuest Quest being accepted + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Look for an accepted quest inside player profile, return matching + * @param pmcData Profile to search through + * @param acceptedQuest Quest to search for + * @returns IRepeatableQuest + */ + protected getRepeatableQuestFromProfile(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData): IRepeatableQuest; /** * Update completed quest in profile * Add newly unlocked quests to profile @@ -67,13 +95,20 @@ export declare class QuestController { */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; /** - * Send a popup to player on completion of a quest + * Send a popup to player on successful completion of a quest * @param sessionID session id - * @param pmcData player profile - * @param completedQuestId completed quest id - * @param questRewards rewards given to player + * @param pmcData Player profile + * @param completedQuestId Completed quest id + * @param questRewards Rewards given to player */ - protected sendDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Reward[]): void; + protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Reward[]): void; + /** + * Look for newly available quests after completing a quest with a requirement to wait x minutes (time-locked) before being available and add data to profile + * @param pmcData Player profile to update + * @param quests Quests to look for wait conditions in + * @param completedQuestId Quest just completed + */ + protected addTimeLockedQuestsToProfile(pmcData: IPmcData, quests: IQuest[], completedQuestId: string): void; /** * Returns a list of quests that should be failed when a quest is completed * @param completedQuestId quest completed id diff --git a/Faupi-HideoutArchitect/server/types/controllers/RagfairController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/RagfairController.d.ts index 95702f2..fffcaa3 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/RagfairController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/RagfairController.d.ts @@ -67,16 +67,16 @@ export declare class RagfairController { protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; 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, localisationService: LocalisationService, configServer: ConfigServer); - getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; + getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data * @param itemsToAdd - * @param assorts + * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers */ - protected getOffersForSearchType(searchRequest: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + protected getOffersForSearchType(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; /** * Get categories for the type of search being performed, linked/required/all * @param searchRequest Client search request data @@ -100,8 +100,14 @@ export declare class RagfairController { /** * Update a trader flea offer with buy restrictions stored in the traders assort * @param offer flea offer to update + * @param profile full profile of player */ - protected setTraderOfferPurchaseLimits(offer: IRagfairOffer): void; + protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, profile: IAkiProfile): void; + /** + * Adjust ragfair offer stack count to match same value as traders assort stack count + * @param offer Flea offer to adjust + */ + protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; update(): void; @@ -114,6 +120,7 @@ export declare class RagfairController { addPlayerOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse; createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; + getStaticPrices(): Record; removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/Faupi-HideoutArchitect/server/types/controllers/RepeatableQuestController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/RepeatableQuestController.d.ts index 333583b..dd8dc40 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/RepeatableQuestController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/RepeatableQuestController.d.ts @@ -1,3 +1,4 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; @@ -20,6 +21,7 @@ import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { PaymentService } from "../services/PaymentService"; import { ProfileFixerService } from "../services/ProfileFixerService"; +import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { MathUtil } from "../utils/MathUtil"; import { ObjectId } from "../utils/ObjectId"; @@ -56,6 +58,7 @@ export declare class RepeatableQuestController { protected timeUtil: TimeUtil; protected logger: ILogger; protected randomUtil: RandomUtil; + protected httpResponse: HttpResponseUtil; protected mathUtil: MathUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; @@ -63,6 +66,7 @@ export declare class RepeatableQuestController { protected presetHelper: PresetHelper; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected handbookHelper: HandbookHelper; protected ragfairServerHelper: RagfairServerHelper; protected eventOutputHolder: EventOutputHolder; protected localisationService: LocalisationService; @@ -71,7 +75,7 @@ export declare class RepeatableQuestController { 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, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, handbookHelper: HandbookHelper, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, 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. @@ -98,6 +102,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists + * @param repeatableConfig daily/weekly config + * @param pmcData Profile to search + * @returns IPmcDataRepeatableQuest + */ + protected getRepeatableQuestSubTypeFromProfile(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): IPmcDataRepeatableQuest; /** * This method is called by GetClientRepeatableQuests and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest @@ -106,17 +117,18 @@ export declare class RepeatableQuestController { /** * Just for debug reasons. Draws dailies a random assort of dailies extracted from dumps */ - generateDebugDailies(dailiesPool: any, factory: any, number: any): any; + generateDebugDailies(dailiesPool: any, factory: any, number: number): any; /** * Generates the base object of quest type format given as templates in assets/database/templates/repeatableQuests.json * The templates include Elimination, Completion and Extraction quest types * * @param {string} type quest type: "Elimination", "Completion" or "Extraction" * @param {string} traderId trader from which the quest will be provided + * @param {string} side scav daily or pmc daily/weekly quest * @returns {object} a object which contains the base elements for repeatable quests of the requests type * (needs to be filled with reward and conditions by called to make a valid quest) */ - generateRepeatableTemplate(type: string, traderId: string): IRepeatableQuest; + generateRepeatableTemplate(type: string, traderId: string, side: string): IRepeatableQuest; /** * Generates a valid Exploration quest * @@ -146,6 +158,12 @@ export declare class RepeatableQuestController { * @returns {object} object of quest type format for "Elimination" (see assets/database/templates/repeatableQuests.json) */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; + /** + * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * @param locationKey e.g factory4_day + * @returns guid + */ + protected getQuestLocationByMapId(locationKey: string): string; /** * Exploration repeatable quests can specify a required extraction point. * This method creates the according object which will be appended to the conditions array @@ -221,16 +239,17 @@ export declare class RepeatableQuestController { generateRewardItem(tpl: string, value: number, index: number, preset?: any): IReward; debugLogRepeatableQuestIds(pmcData: IPmcData): void; probabilityObjectArray(configArrayInput: ProbabilityObject[]): ProbabilityObjectArray; - changeRepeatableQuest(pmcDataIn: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; + changeRepeatableQuest(pmcData: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) - * @returns a list of rewardable items [[_tpl, itemTemplate],...] + * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * @param repeatableQuestConfig config file + * @returns a list of rewardable items [[_tpl, itemTemplate],...] */ protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [string, ITemplateItem][]; /** * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. - * @param {*} tpl template id of item to check + * @param {string} tpl template id of item to check * @returns boolean: true if item is valid reward */ isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean; diff --git a/Faupi-HideoutArchitect/server/types/controllers/TradeController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/TradeController.d.ts index 0ed0556..dc7de19 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/TradeController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/TradeController.d.ts @@ -1,20 +1,30 @@ -import { RagfairServer } from "../servers/RagfairServer"; +import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; -import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { ConfigServer } from "../servers/ConfigServer"; +import { RagfairServer } from "../servers/RagfairServer"; +import { LocalisationService } from "../services/LocalisationService"; +import { HttpResponseUtil } from "../utils/HttpResponseUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; + protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + protected httpResponse: HttpResponseUtil; + protected localisationService: LocalisationService; + protected configServer: ConfigServer; + protected ragfairConfig: IRagfairConfig; + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/Faupi-HideoutArchitect/server/types/controllers/TraderController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/TraderController.d.ts index d7afe95..b67aec9 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/TraderController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/TraderController.d.ts @@ -7,6 +7,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; +import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { @@ -17,10 +18,11 @@ export declare class TraderController { protected traderHelper: TraderHelper; protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; + protected traderPurchasePersisterService: TraderPurchasePersisterService; 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, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, 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/Faupi-HideoutArchitect/server/types/controllers/WishlistController.d.ts b/Faupi-HideoutArchitect/server/types/controllers/WishlistController.d.ts index 83be4b3..60c4a15 100644 --- a/Faupi-HideoutArchitect/server/types/controllers/WishlistController.d.ts +++ b/Faupi-HideoutArchitect/server/types/controllers/WishlistController.d.ts @@ -1,7 +1,7 @@ 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"; +import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; export declare class WishlistController { protected eventOutputHolder: EventOutputHolder; constructor(eventOutputHolder: EventOutputHolder); diff --git a/Faupi-HideoutArchitect/server/types/di/OnLoad.d.ts b/Faupi-HideoutArchitect/server/types/di/OnLoad.d.ts index 064d07d..a5cdea3 100644 --- a/Faupi-HideoutArchitect/server/types/di/OnLoad.d.ts +++ b/Faupi-HideoutArchitect/server/types/di/OnLoad.d.ts @@ -1,4 +1,4 @@ -export declare class OnLoad { - onLoad(): void; +export interface OnLoad { + onLoad(): Promise; getRoute(): string; } diff --git a/Faupi-HideoutArchitect/server/types/di/OnLoadOnUpdate.d.ts b/Faupi-HideoutArchitect/server/types/di/OnLoadOnUpdate.d.ts deleted file mode 100644 index 8bd3dc3..0000000 --- a/Faupi-HideoutArchitect/server/types/di/OnLoadOnUpdate.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { OnLoad } from "./OnLoad"; -import { OnUpdate } from "./OnUpdate"; -export declare class OnLoadOnUpdate implements OnLoad, OnUpdate { - onUpdate(timeSinceLastRun: number): boolean; - onLoad(): void; - getRoute(): string; -} diff --git a/Faupi-HideoutArchitect/server/types/di/OnUpdate.d.ts b/Faupi-HideoutArchitect/server/types/di/OnUpdate.d.ts index 7fbbe09..e1ce375 100644 --- a/Faupi-HideoutArchitect/server/types/di/OnUpdate.d.ts +++ b/Faupi-HideoutArchitect/server/types/di/OnUpdate.d.ts @@ -1,4 +1,4 @@ -export declare class OnUpdate { - onUpdate(timeSinceLastRun: number): boolean; +export interface OnUpdate { + onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/Faupi-HideoutArchitect/server/types/generators/BotEquipmentModGenerator.d.ts b/Faupi-HideoutArchitect/server/types/generators/BotEquipmentModGenerator.d.ts new file mode 100644 index 0000000..6703a36 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/generators/BotEquipmentModGenerator.d.ts @@ -0,0 +1,200 @@ +import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; +import { BotHelper } from "../helpers/BotHelper"; +import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ProbabilityHelper } from "../helpers/ProbabilityHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { Mods, ModsChances } from "../models/eft/common/tables/IBotType"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem"; +import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; +import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemFilterService } from "../services/ItemFilterService"; +import { LocalisationService } from "../services/LocalisationService"; +import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; +export declare class BotEquipmentModGenerator { + protected logger: ILogger; + protected jsonUtil: JsonUtil; + protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; + protected probabilityHelper: ProbabilityHelper; + protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; + protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemFilterService: ItemFilterService; + protected profileHelper: ProfileHelper; + protected botWeaponModLimitService: BotWeaponModLimitService; + protected botHelper: BotHelper; + protected botGeneratorHelper: BotGeneratorHelper; + protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected localisationService: LocalisationService; + protected botEquipmentModPoolService: BotEquipmentModPoolService; + protected configServer: ConfigServer; + protected botConfig: IBotConfig; + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + /** + * Check mods are compatible and add to array + * @param equipment Equipment item to add mods to + * @param modPool Mod list to choose frm + * @param parentId parentid of item to add mod to + * @param parentTemplate template objet of item to add mods to + * @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type + * @param botRole the bot role being generated for + * @param forceSpawn should this mod be forced to spawn + * @returns Item + compatible mods as an array + */ + generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, botRole: string, forceSpawn?: boolean): Item[]; + /** + * Add mods to a weapon using the provided mod pool + * @param sessionId session id + * @param weapon Weapon to add mods to + * @param modPool Pool of compatible mods to attach to weapon + * @param weaponParentId parentId of weapon + * @param parentTemplate Weapon which mods will be generated on + * @param modSpawnChances Mod spawn chances + * @param ammoTpl Ammo tpl to use when generating magazines/cartridges + * @param botRole Role of bot weapon is generated for + * @param botLevel lvel of the bot weapon is being generated for + * @param modLimits limits placed on certian mod types per gun + * @param botEquipmentRole role of bot when accessing bot.json equipment config settings + * @returns Weapon + mods array + */ + generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[]; + /** + * Is this modslot a front or rear sight + * @param modSlot Slot to check + * @returns true if it's a front/rear sight + */ + protected modIsFrontOrRearSight(modSlot: string): boolean; + /** + * Does the provided mod details show the mod can hold a scope + * @param modSlot e.g. mod_scope, mod_mount + * @param modsParentId Parent id of mod item + * @returns true if it can hold a scope + */ + protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean; + /** + * Set all scope mod chances to 100% + * @param modSpawnChances Chances objet to update + */ + protected setScopeSpawnChancesToFull(modSpawnChances: ModsChances): void; + protected sortModKeys(unsortedKeys: string[]): string[]; + /** + * Get a Slot property for an item (chamber/cartridge/slot) + * @param modSlot e.g patron_in_weapon + * @param parentTemplate item template + * @returns Slot item + */ + protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot; + /** + * randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot + * never return true for an item that has 0% spawn chance + * @param itemSlot slot the item sits in + * @param modSlot slot the mod sits in + * @param modSpawnChances Chances for various mod spawns + * @returns boolean true if it should spawn + */ + protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean; + /** + * + * @param modSlot Slot mod will fit into + * @param isRandomisableSlot Will generate a randomised mod pool if true + * @param modsParent Parent slot the item will be a part of + * @param botEquipBlacklist Blacklist to prevent mods from being picked + * @param itemModPool Pool of items to pick from + * @param weapon array with only weapon tpl in it, ready for mods to be added + * @param ammoTpl ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) + * @param parentTemplate Parent item the mod will go into + * @returns ITemplateItem + */ + protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem]; + /** + * Create a mod item with parameters as properties + * @param modId _id + * @param modTpl _tpl + * @param parentId parentId + * @param modSlot slotId + * @param modTemplate Used to add additional properites in the upd object + * @returns Item object + */ + protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item; + /** + * Get a list of containers that hold ammo + * e.g. mod_magazine / patron_in_weapon_000 + * @returns string array + */ + protected getAmmoContainers(): string[]; + /** + * Get a random mod from an items compatible mods Filter array + * @param modTpl ???? default value to return if nothing found + * @param parentSlot item mod will go into, used to get combatible items + * @param modSlot Slot to get mod to fill + * @param items items to ensure picked mod is compatible with + * @returns item tpl + */ + protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + /** + * Log errors if mod is not compatible with slot + * @param modToAdd template of mod to check + * @param itemSlot slot the item will be placed in + * @param modSlot slot the mod will fill + * @param parentTemplate template of the mods parent item + * @returns true if valid + */ + protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean; + /** + * Find mod tpls of a provided type and add to modPool + * @param desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope) + * @param modTemplate db object for modItem we get compatible mods from + * @param modPool Pool of mods we are adding to + */ + protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void; + /** + * Get the possible items that fit a slot + * @param parentItemId item tpl to get compatible items for + * @param modSlot Slot item should fit in + * @param botEquipBlacklist equipment that should not be picked + * @returns array of compatible items for that slot + */ + protected getDynamicModPool(parentItemId: string, modSlot: string, botEquipBlacklist: EquipmentFilterDetails): string[]; + /** + * Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist + * @param allowedMods base mods to filter + * @param botEquipBlacklist equipment blacklist + * @param modSlot slot mods belong to + * @returns Filtered array of mod tpls + */ + protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[]; + /** + * With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines. + * Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0. + * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. + * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" + * @param items The items where the CylinderMagazine's camora are appended to + * @param modPool modPool which should include available cartrigdes + * @param parentId The CylinderMagazine's UID + * @param parentTemplate The CylinderMagazine's template + */ + protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void; + /** + * Take a record of camoras and merge the compatable shells into one array + * @param camorasWithShells camoras we want to merge into one array + * @returns string array of shells fro luitple camora sources + */ + protected mergeCamoraPoolsTogether(camorasWithShells: Record): string[]; + /** + * Filter out non-whitelisted weapon scopes + * @param weapon Weapon scopes will be added to + * @param scopes Full scope pool + * @param botWeaponSightWhitelist whitelist of scope types by weapon base type + * @returns array of scope tpls that have been filtered + */ + protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record): string[]; +} diff --git a/Faupi-HideoutArchitect/server/types/generators/BotGenerator.d.ts b/Faupi-HideoutArchitect/server/types/generators/BotGenerator.d.ts index 08ad50a..9581259 100644 --- a/Faupi-HideoutArchitect/server/types/generators/BotGenerator.d.ts +++ b/Faupi-HideoutArchitect/server/types/generators/BotGenerator.d.ts @@ -1,16 +1,16 @@ import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper"; import { BotHelper } from "../helpers/BotHelper"; -import { GameEventHelper } from "../helpers/GameEventHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { Health as PmcHealth, IBotBase, Skills } from "../models/eft/common/tables/IBotBase"; -import { Health, IBotType, Inventory } from "../models/eft/common/tables/IBotType"; +import { Health as PmcHealth, IBotBase, Info, Skills } from "../models/eft/common/tables/IBotBase"; +import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -29,10 +29,10 @@ export declare class BotGenerator { protected weightedRandomHelper: WeightedRandomHelper; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; - protected gameEventHelper: GameEventHelper; + protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -42,23 +42,12 @@ export declare class BotGenerator { */ generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase; /** - * Generate an array of bot objects based on a condition for a raid with - * @param sessionId session id - * @param botGenerationDetails details on how to generate the bots - * @returns Generated bots in array + * Create x number of bots of the type/side/difficulty defined in botGenerationDetails + * @param sessionId Session id + * @param botGenerationDetails details on how to generate bots + * @returns array of bots */ - generateByCondition(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[]; - /** - * Get the PMCs wildSpawnType value - * @param role "usec" / "bear" - * @returns wildSpawnType value as string - */ - protected getPmcRoleByDescription(role: string): string; - /** - * Get a randomised PMC side based on bot config value 'isUsec' - * @returns pmc side as string - */ - protected getRandomisedPmcSide(): string; + prepareAndGenerateBots(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[]; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -94,11 +83,6 @@ export declare class BotGenerator { */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; - /** - * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) - * @param nodeInventory Bots inventory to iterate over - */ - protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; /** * Generate a random Id for a bot and apply to bots _id and aid value * @param bot bot to update @@ -107,11 +91,12 @@ export declare class BotGenerator { protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; /** - * Get the difficulty passed in, if its not "asoline", get selected difficulty from config - * @param requestedDifficulty - * @returns + * Randomise a bots game version and account category + * Chooses from all the game versions (standard, eod etc) + * Chooses account type (default, Sherpa, etc) + * @param botInfo bot info object to update */ - protected getPMCDifficulty(requestedDifficulty: string): string; + protected getRandomisedGameVersionAndCategory(botInfo: Info): void; /** * Add a side-specific (usec/bear) dogtag item to a bots inventory * @param bot bot to add dogtag to diff --git a/Faupi-HideoutArchitect/server/types/generators/BotInventoryGenerator.d.ts b/Faupi-HideoutArchitect/server/types/generators/BotInventoryGenerator.d.ts index a3b5eaa..83a548b 100644 --- a/Faupi-HideoutArchitect/server/types/generators/BotInventoryGenerator.d.ts +++ b/Faupi-HideoutArchitect/server/types/generators/BotInventoryGenerator.d.ts @@ -4,13 +4,15 @@ import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; -import { IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { EquipmentFilterDetails, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator"; import { BotLootGenerator } from "./BotLootGenerator"; import { BotWeaponGenerator } from "./BotWeaponGenerator"; export declare class BotInventoryGenerator { @@ -24,9 +26,11 @@ export declare class BotInventoryGenerator { protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; + protected botEquipmentModPoolService: BotEquipmentModPoolService; + protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -62,6 +66,13 @@ export declare class BotInventoryGenerator { * @param randomisationDetails settings from bot.json to adjust how item is generated */ protected generateEquipment(equipmentSlot: string, equipmentPool: Record, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory, randomisationDetails: RandomisationDetails): void; + /** + * Get all possible mods for item and filter down based on equipment blacklist from bot.json config + * @param itemTpl Item mod pool is being retreived and filtered + * @param equipmentBlacklist blacklist to filter mod pool with + * @returns Filtered pool of mods + */ + protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: EquipmentFilterDetails[]): Record; /** * Work out what weapons bot should have equipped and add them to bot inventory * @param templateInventory bot/x.json data from db diff --git a/Faupi-HideoutArchitect/server/types/generators/BotWeaponGenerator.d.ts b/Faupi-HideoutArchitect/server/types/generators/BotWeaponGenerator.d.ts index b2eaf3b..a68b82f 100644 --- a/Faupi-HideoutArchitect/server/types/generators/BotWeaponGenerator.d.ts +++ b/Faupi-HideoutArchitect/server/types/generators/BotWeaponGenerator.d.ts @@ -12,10 +12,12 @@ import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator"; import { IInventoryMagGen } from "./weapongen/IInventoryMagGen"; export declare class BotWeaponGenerator { protected jsonUtil: JsonUtil; @@ -28,11 +30,13 @@ export declare class BotWeaponGenerator { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected botWeaponModLimitService: BotWeaponModLimitService; + protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -85,9 +89,10 @@ export declare class BotWeaponGenerator { /** * Checks if all required slots are occupied on a weapon and all it's mods * @param weaponItemArray Weapon + mods + * @param botRole role of bot weapon is for * @returns true if valid */ - protected isWeaponValid(weaponItemArray: Item[]): boolean; + protected isWeaponValid(weaponItemArray: Item[], botRole: string): boolean; /** * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer @@ -97,6 +102,13 @@ export declare class BotWeaponGenerator { * @param botRole The bot type we're getting generating extra mags for */ addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + /** + * Add Grendaes for UBGL to bots vest and secure container + * @param weaponMods Weapon array with mods + * @param generatedWeaponResult result of weapon generation + * @param inventory bot inventory to add grenades to + */ + protected addUbglGrenadesToBotInventory(weaponMods: Item[], generatedWeaponResult: GenerateWeaponResult, inventory: PmcInventory): void; /** * Add ammo to the secure container * @param stackCount How many stacks of ammo to add @@ -133,6 +145,13 @@ export declare class BotWeaponGenerator { * @param ammoTpl */ protected fillExistingMagazines(weaponMods: Item[], magazine: Item, ammoTpl: string): void; + /** + * Add desired ammo tpl as item to weaponmods array, placed as child to UBGL + * @param weaponMods + * @param ubglMod + * @param ubglAmmoTpl + */ + protected fillUbgl(weaponMods: Item[], ubglMod: Item, ubglAmmoTpl: string): void; /** * Add cartridge item to weapon Item array, if it already exists, update * @param weaponMods Weapon items array to amend diff --git a/Faupi-HideoutArchitect/server/types/generators/LocationGenerator.d.ts b/Faupi-HideoutArchitect/server/types/generators/LocationGenerator.d.ts index cc61dcf..a617048 100644 --- a/Faupi-HideoutArchitect/server/types/generators/LocationGenerator.d.ts +++ b/Faupi-HideoutArchitect/server/types/generators/LocationGenerator.d.ts @@ -1,5 +1,4 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; -import { GameEventHelper } from "../helpers/GameEventHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; @@ -9,6 +8,8 @@ import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticL import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { LocalisationService } from "../services/LocalisationService"; +import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; import { MathUtil } from "../utils/MathUtil"; import { ObjectId } from "../utils/ObjectId"; @@ -26,12 +27,13 @@ export declare class LocationGenerator { protected ragfairServerHelper: RagfairServerHelper; protected itemHelper: ItemHelper; protected mathUtil: MathUtil; - protected gameEventHelper: GameEventHelper; + protected seasonalEventService: SeasonalEventService; protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, gameEventHelper: GameEventHelper, containerHelper: ContainerHelper, presetHelper: PresetHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; protected getLooseLootMultiplerForLocation(location: string): number; protected getStaticLootMultiplerForLocation(location: string): number; @@ -47,7 +49,8 @@ export declare class LocationGenerator { * Add forced spawn point loot into loot parameter array * @param loot array to add forced loot to * @param forcedSpawnPoints forced loot to add + * @param name of map currently generating forced loot for */ - protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[]): void; + protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[], locationName: string): void; protected createItem(tpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/Faupi-HideoutArchitect/server/types/generators/LootGenerator.d.ts b/Faupi-HideoutArchitect/server/types/generators/LootGenerator.d.ts index bc0d7ec..0d2ef24 100644 --- a/Faupi-HideoutArchitect/server/types/generators/LootGenerator.d.ts +++ b/Faupi-HideoutArchitect/server/types/generators/LootGenerator.d.ts @@ -6,6 +6,7 @@ import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; +import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; export declare class LootGenerator { @@ -14,8 +15,9 @@ export declare class LootGenerator { protected databaseServer: DatabaseServer; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/Faupi-HideoutArchitect/server/types/generators/PMCLootGenerator.d.ts b/Faupi-HideoutArchitect/server/types/generators/PMCLootGenerator.d.ts index b9f2a83..10918e3 100644 --- a/Faupi-HideoutArchitect/server/types/generators/PMCLootGenerator.d.ts +++ b/Faupi-HideoutArchitect/server/types/generators/PMCLootGenerator.d.ts @@ -3,6 +3,7 @@ import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; +import { SeasonalEventService } from "../services/SeasonalEventService"; /** * Handle the generation of dynamic PMC loot in pockets and backpacks * and the removal of blacklisted items @@ -12,10 +13,19 @@ export declare class PMCLootGenerator { protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; + protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService); + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); + /** + * Create an array of loot items a PMC can have in their pockets + * @returns string array of tpls + */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their backpack + * @returns string array of tpls + */ generatePMCBackpackLootPool(): string[]; } diff --git a/Faupi-HideoutArchitect/server/types/generators/PlayerScavGenerator.d.ts b/Faupi-HideoutArchitect/server/types/generators/PlayerScavGenerator.d.ts index bb2c730..3641268 100644 --- a/Faupi-HideoutArchitect/server/types/generators/PlayerScavGenerator.d.ts +++ b/Faupi-HideoutArchitect/server/types/generators/PlayerScavGenerator.d.ts @@ -1,4 +1,7 @@ +import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Skills, Stats } from "../models/eft/common/tables/IBotBase"; @@ -10,21 +13,30 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { BotLootCacheService } from "../services/BotLootCacheService"; import { FenceService } from "../services/FenceService"; +import { LocalisationService } from "../services/LocalisationService"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { BotGenerator } from "./BotGenerator"; export declare class PlayerScavGenerator { protected logger: ILogger; + protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; + protected hashUtil: HashUtil; + protected itemHelper: ItemHelper; + protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected botGeneratorHelper: BotGeneratorHelper; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected botHelper: BotHelper; protected jsonUtil: JsonUtil; protected fenceService: FenceService; protected botLootCacheService: BotLootCacheService; + protected localisationService: LocalisationService; protected botGenerator: BotGenerator; protected configServer: ConfigServer; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, botGenerator: BotGenerator, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/Faupi-HideoutArchitect/server/types/generators/RagfairAssortGenerator.d.ts b/Faupi-HideoutArchitect/server/types/generators/RagfairAssortGenerator.d.ts index db4811d..630e863 100644 --- a/Faupi-HideoutArchitect/server/types/generators/RagfairAssortGenerator.d.ts +++ b/Faupi-HideoutArchitect/server/types/generators/RagfairAssortGenerator.d.ts @@ -4,6 +4,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; export declare class RagfairAssortGenerator { @@ -11,10 +12,11 @@ export declare class RagfairAssortGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; + protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected generatedAssortItems: Item[]; protected ragfairConfig: IRagfairConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Get an array of unique items that can be sold on the flea * @returns array of unique items diff --git a/Faupi-HideoutArchitect/server/types/generators/RagfairOfferGenerator.d.ts b/Faupi-HideoutArchitect/server/types/generators/RagfairOfferGenerator.d.ts index 23882d2..35fceff 100644 --- a/Faupi-HideoutArchitect/server/types/generators/RagfairOfferGenerator.d.ts +++ b/Faupi-HideoutArchitect/server/types/generators/RagfairOfferGenerator.d.ts @@ -7,7 +7,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairOffer, OfferRequirement } from "../models/eft/ragfair/IRagfairOffer"; -import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; +import { Dynamic, IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -88,13 +88,49 @@ export declare class RagfairOfferGenerator { * Create multiple offers for items by using a unique list of items we've generated previously * @param expiredOffers optional, expired offers to regenerate */ - generateDynamicOffers(expiredOffers?: Item[]): void; + generateDynamicOffers(expiredOffers?: Item[]): Promise; + protected createOffersForItems(assortItemIndex: string, assortItemsToProcess: Item[], expiredOffers: Item[], config: Dynamic): Promise; + /** + * Create one flea offer for a specific item + * @param items Item to create offer for + * @param isPreset Is item a weapon preset + * @param itemDetails raw db item details + * @returns + */ + protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise; /** * Generate trader offers on flea using the traders assort data * @param traderID Trader to generate offers for */ generateFleaOffersForTrader(traderID: string): void; - protected getItemCondition(userID: string, items: Item[], itemDetails: ITemplateItem): Item[]; + /** + * Get array of an item with its mods + condition properties (e.g durability) + * Apply randomisation adjustments to condition if item base is found in ragfair.json/dynamic/condition + * @param userID id of owner of item + * @param itemWithMods Item and mods, get condition of first item (only first array item is used) + * @param itemDetails db details of first item + * @returns + */ + protected getItemCondition(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[]; + /** + * Get the relevant condition id if item tpl matches in ragfair.json/condition + * @param tpl Item to look for matching condition object + * @returns condition id + */ + protected getDynamicConditionIdForTpl(tpl: string): string; + /** + * Alter an items condition based on its item base type + * @param conditionSettingsId also the parentId of item being altered + * @param item Item to adjust condition details of + * @param itemDetails db item details of first item in array + */ + protected randomiseItemCondition(conditionSettingsId: string, item: Item, itemDetails: ITemplateItem): void; + /** + * Adjust an items durability/maxDurability value + * @param item item (weapon/armor) to adjust + * @param multiplier Value to multiple durability by + */ + protected randomiseDurabilityValues(item: Item, multiplier: number): void; /** * Add missing conditions to an item if needed * Durabiltiy for repairable items @@ -102,7 +138,7 @@ export declare class RagfairOfferGenerator { * @param item item to add conditions to * @returns Item with conditions added */ - protected addMissingCondition(item: Item): Item; + protected addMissingConditions(item: Item): Item; /** * Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based * @param offerItems Items for sale in offer @@ -110,7 +146,7 @@ export declare class RagfairOfferGenerator { */ protected createBarterRequirement(offerItems: Item[]): IBarterScheme[]; /** - * Get an array of flea prices + item tpl, cached in generator class + * Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter` * @returns array with tpl/price values */ protected getFleaPricesAsArray(): { diff --git a/Faupi-HideoutArchitect/server/types/generators/ScavCaseRewardGenerator.d.ts b/Faupi-HideoutArchitect/server/types/generators/ScavCaseRewardGenerator.d.ts index 89cb5c8..394eeb0 100644 --- a/Faupi-HideoutArchitect/server/types/generators/ScavCaseRewardGenerator.d.ts +++ b/Faupi-HideoutArchitect/server/types/generators/ScavCaseRewardGenerator.d.ts @@ -2,7 +2,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { Product } from "../models/eft/common/tables/IBotBase"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase"; -import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData"; import { IScavCaseConfig } from "../models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "../models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -28,21 +27,15 @@ export declare class ScavCaseRewardGenerator { constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build - * @param body client request + * @param recipeId recipe of the scav case craft * @returns Product array */ - generate(body: IHideoutScavCaseStartRequestData): Product[]; + generate(recipeId: string): Product[]; /** * Get all db items that are not blacklisted in scavcase config * @returns filtered array of db items */ protected getDbItems(): ITemplateItem[]; - /** - * Check if a template id has a blacklisted parent id - * @param tplid template id to check - * @returns true if item is blacklisted - */ - protected itemHasBlacklistedParent(tplid: string): boolean; /** * Pick a number of items to be rewards, the count is defined by the values in * @param items item pool to pick rewards from diff --git a/Faupi-HideoutArchitect/server/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts b/Faupi-HideoutArchitect/server/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts new file mode 100644 index 0000000..75395be --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts @@ -0,0 +1,10 @@ +import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper"; +import { IInventoryMagGen } from "../IInventoryMagGen"; +import { InventoryMagGen } from "../InventoryMagGen"; +export declare class UbglExternalMagGen implements IInventoryMagGen { + protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + constructor(botWeaponGeneratorHelper: BotWeaponGeneratorHelper); + getPriority(): number; + canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean; + process(inventoryMagGen: InventoryMagGen): void; +} diff --git a/Faupi-HideoutArchitect/server/types/helpers/AssortHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/AssortHelper.d.ts index bfc157f..13512b2 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/AssortHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/AssortHelper.d.ts @@ -2,28 +2,31 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { LocalisationService } from "../services/LocalisationService"; import { ItemHelper } from "./ItemHelper"; import { QuestHelper } from "./QuestHelper"; export declare class AssortHelper { protected logger: ILogger; protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; protected questHelper: QuestHelper; - constructor(logger: ILogger, itemHelper: ItemHelper, databaseServer: DatabaseServer, questHelper: QuestHelper); + constructor(logger: ILogger, itemHelper: ItemHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, questHelper: QuestHelper); /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile * @param traderId traders id * @param assort assort items from a trader + * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile * @param traderId traders id * @param assort traders assorts - * @returns traders assorts minus locked loyality assorts + * @returns traders assorts minus locked loyalty assorts */ stripLockedLoyaltyAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort): ITraderAssort; /** diff --git a/Faupi-HideoutArchitect/server/types/helpers/BotDifficultyHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/BotDifficultyHelper.d.ts index a58ebdb..df2c269 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/BotDifficultyHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/BotDifficultyHelper.d.ts @@ -20,7 +20,7 @@ export declare class BotDifficultyHelper { getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** * Get difficulty settings for desired bot type, if not found use assault bot types - * @param type bot type to retreive difficulty of + * @param type bot type to retrieve difficulty of * @param difficulty difficulty to get settings for (easy/normal etc) * @returns Difficulty object */ diff --git a/Faupi-HideoutArchitect/server/types/helpers/BotGeneratorHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/BotGeneratorHelper.d.ts index 9ee017f..c7dd606 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/BotGeneratorHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/BotGeneratorHelper.d.ts @@ -1,217 +1,42 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; -import { Mods, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; -import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem"; -import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; -import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; -import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; -import { BotHelper } from "./BotHelper"; -import { BotWeaponGeneratorHelper } from "./BotWeaponGeneratorHelper"; -import { ContainerHelper } from "./ContainerHelper"; -import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; -import { ProbabilityHelper } from "./ProbabilityHelper"; -import { ProfileHelper } from "./ProfileHelper"; -export declare class BotModLimits { - scope: ItemCount; - scopeMax: number; - scopeBaseTypes: string[]; - flashlightLaser: ItemCount; - flashlightLaserMax: number; - flashlgihtLaserBaseTypes: string[]; -} -export declare class ItemCount { - count: number; -} export declare class BotGeneratorHelper { protected logger: ILogger; - protected jsonUtil: JsonUtil; - protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected probabilityHelper: ProbabilityHelper; protected databaseServer: DatabaseServer; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; - protected inventoryHelper: InventoryHelper; - protected containerHelper: ContainerHelper; - protected botEquipmentFilterService: BotEquipmentFilterService; - protected itemFilterService: ItemFilterService; - protected profileHelper: ProfileHelper; - protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; - protected botHelper: BotHelper; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botHelper: BotHelper, localisationService: LocalisationService, configServer: ConfigServer); - /** - * Check mods are compatible and add to array - * @param equipment Equipment item to add mods to - * @param modPool Mod list to choose frm - * @param parentId parentid of item to add mod to - * @param parentTemplate template objet of item to add mods to - * @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type - * @param botRole the bot role being generated for - * @param forceSpawn should this mod be forced to spawn - * @returns Item + compatible mods as an array - */ - generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, botRole: string, forceSpawn?: boolean): Item[]; - /** - * Add mods to a weapon using the provided mod pool - * @param sessionId session id - * @param weapon Weapon to add mods to - * @param modPool Pool of compatible mods to attach to weapon - * @param weaponParentId parentId of weapon - * @param parentWeaponTemplate Weapon which mods will be generated on - * @param modSpawnChances Mod spawn chances - * @param ammoTpl Ammo tpl to use when generating magazines/cartridges - * @param botRole Role of bot weapon is generated for - * @returns Weapon + mods array - */ - generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentWeaponTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number): Item[]; - /** - * - * @param modSlot Slot mod will fit into - * @param isRandomisableSlot Will generate a randomised mod pool if true - * @param modsParent Parent slot the item will be a part of - * @param botEquipBlacklist Blacklist to prevent mods from being picked - * @param itemModPool Pool of items to pick from - * @param weapon array with only weapon tpl in it, ready for mods to be added - * @param ammoTpl ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) - * @param parentTemplate Parent item the mod will go into - * @returns ITemplateItem - */ - protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, modsParent: Slot, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem]; - /** - * Find mod tpls of a provided type and add to modPool - * @param desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope) - * @param modTemplate db object for modItem we get compatible mods from - * @param modPool Pool of mods we are adding to - */ - protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void; - /** - * Check if mod item is on limited list + has surpassed the limit set for it - * @param botRole role the bot has e.g. assault - * @param modTemplate mods template data - * @param modLimits limits set for weapon being generated for this bot - * @returns true if over item limit - */ - protected modHasReachedItemLimit(botRole: string, modTemplate: ITemplateItem, modLimits: BotModLimits): boolean; - /** - * Initalise mod limits to be used when generating a weapon - * @param botRole "assault", "bossTagilla" or "pmc" - * @returns BotModLimits object - */ - protected initModLimits(botRole: string): BotModLimits; - /** - * Generate a pool of mods for this bots mod type if bot has values inside `randomisedWeaponModSlots` array found in bot.json/equipment[botrole] - * @param allowedMods Mods to be added to mod pool - * @param botEquipBlacklist blacklist of items not allowed to be added to mod pool - * @param modSlot Slot to generate mods for - * @param itemModPool base mod pool to replace values of - */ - protected generateDynamicWeaponModPool(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string, itemModPool: Record): void; - /** - * Find all compatible mods for equipment item and add to modPool - * @param itemDetails item to find mods for - * @param modPool ModPool to add mods to - * @param equipmentBlacklist equipment not allowed to be used by the bot - * @param botEquipmentRole bot type to generate pool for (e.g. assault, pmcBot, pmc for usec/bear) - */ - generateDynamicModPool(itemDetails: ITemplateItem, modPool: Mods, equipmentBlacklist: EquipmentFilterDetails[], botEquipmentRole: string): void; - /** - * Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist - * @param allowedMods base mods to filter - * @param botEquipBlacklist equipment blacklist - * @param modSlot slot mods belong to - * @returns Filtered array of mod tpls - */ - protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[]; - /** - * Check if the specific item type on the weapon has reached the set limit - * @param modTpl log mod tpl if over type limit - * @param currentCount current number of this item on gun - * @param maxLimit mod limit allowed - * @param botRole role of bot we're checking weapon of - * @returns true if limit reached - */ - protected weaponModLimitReached(modTpl: string, currentCount: { - count: number; - }, maxLimit: number, botRole: string): boolean; - /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param itemSlot slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate tempalte of the mods parent item - * @returns true if valid - */ - protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean; - /** - * Create a mod item with parameters as properties - * @param modId _id - * @param modTpl _tpl - * @param parentId parentId - * @param modSlot slotId - * @param modTemplate Used to add additional properites in the upd object - * @returns Item object - */ - protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item; - /** - * randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot - * never return true for an item that has 0% spawn chance - * @param itemSlot slot the item sits in - * @param modSlot slot the mod sits in - * @param modSpawnChances Chances for various mod spawns - * @returns boolean true if it should spawn - */ - protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean; - /** - * Get a list of containers that hold ammo - * e.g. mod_magazine / patron_in_weapon_000 - * @returns string array - */ - protected getAmmoContainers(): string[]; - /** - * Get a Slot property for an item (chamber/cartridge/slot) - * @param modSlot e.g patron_in_weapon - * @param parentTemplate item template - * @returns Slot item - */ - protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot; - /** - * With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines. - * Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0. - * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. - * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" - * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes - * @param parentId The CylinderMagazine's UID - * @param parentTemplate The CylinderMagazine's template - */ - protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void; - /** - * Take a record of camoras and merge the compatable shells into one array - * @param camorasWithShells camoras we want to merge into one array - * @returns string array of shells fro luitple camora sources - */ - protected mergeCamoraPoolsTogether(camorasWithShells: Record): string[]; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability * @param itemTemplate Item extra properties are being generated for - * @param botRole Used by weapons to randomise the durability values. Null for non-equipped items + * @param botRole Used by weapons to randomize the durability values. Null for non-equipped items * @returns Item Upd object with extra properties */ generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): { upd?: Upd; }; + /** + * Get the chance for the weapon attachment or helmet equipment to be set as activated + * @param botRole role of bot with weapon/helmet + * @param setting the setting of the weapon attachment/helmet equipment to be activated + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @returns Percent chance to be active + */ + protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for @@ -227,22 +52,16 @@ export declare class BotGeneratorHelper { */ protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; /** - * Get a random mod from an items compatible mods Filter array - * @param modTpl ???? - * @param parentSlot item mod will go into, used to get combatible items - * @param modSlot Slot to get mod to fill - * @param items items to ensure picked mod is compatible with - * @returns item tpl - */ - protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; - /** - * Can an item be added to an item without issue - * @param items items to check compatiblilities with - * @param tplToCheck tpl of the item to check for incompatibilities + * Can item be added to another item without conflict + * @param items Items to check compatibilities with + * @param tplToCheck Tpl of the item to check for incompatibilities * @param equipmentSlot Slot the item will be placed into - * @returns false if no incompatibilties + * @returns false if no incompatibilities, also has incompatibility reason */ - isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): boolean; + isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): { + incompatible: boolean; + reason: string; + }; /** * Convert a bots role to the equipment role used in config/bot.json * @param botRole Role to convert diff --git a/Faupi-HideoutArchitect/server/types/helpers/BotHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/BotHelper.d.ts index 2752a0e..3b49501 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/BotHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/BotHelper.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -22,11 +23,11 @@ export declare class BotHelper { */ getBotTemplate(role: string): IBotType; /** - * Randomise the chance the PMC will attack their own side + * Randomize the chance the PMC will attack their own side * Look up value in bot.json/chanceSameSideIsHostilePercent * @param difficultySettings pmc difficulty settings */ - randomisePmcHostility(difficultySettings: Difficulty): void; + randomizePmcHostility(difficultySettings: Difficulty): void; /** * Is the passed in bot role a PMC (usec/bear/pmc) * @param botRole bot role to check @@ -59,11 +60,29 @@ export declare class BotHelper { * @returns true if should be a pmc */ shouldBotBePmc(botRole: string): boolean; + rollChanceToBePmc(role: string, botConvertMinMax: MinMax): boolean; + botRoleIsPmc(botRole: string): boolean; /** - * Get randomisation settings for bot from config/bot.json + * Get randomization settings for bot from config/bot.json * @param botLevel level of bot * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomisationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + /** + * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * @returns pmc role + */ + getRandomizedPmcRole(): string; + /** + * Get the corresponding side when sptBear or sptUsec is passed in + * @param botRole role to get side for + * @returns side (usec/bear) + */ + getPmcSideByRole(botRole: string): string; + /** + * Get a randomized PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomizedPmcSide(): string; } diff --git a/Faupi-HideoutArchitect/server/types/helpers/BotWeaponGeneratorHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/BotWeaponGeneratorHelper.d.ts index 7e25f56..cefc3bd 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -2,8 +2,10 @@ import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { EquipmentSlots } from "../models/enums/EquipmentSlots"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; @@ -16,21 +18,22 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** - * Get a randomised number of bullets for a specific magazine + * Get a randomized number of bullets for a specific magazine * @param magCounts min and max count of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomisedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; /** - * Get a randomised count of magazines + * Get a randomized count of magazines * @param magCounts min and max value returned value can be between - * @returns numberical value of magazine count + * @returns numerical value of magazine count */ - getRandomisedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: MinMax): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -46,12 +49,13 @@ export declare class BotWeaponGeneratorHelper { */ createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** - * Add a specific number of cartrdiges to a bots inventory (vest/pocket) + * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets * @param cartridgeCount number of cartridges to add to vest/pockets * @param inventory bot inventory to add cartridges to + * @param equipmentSlotsToAddTo what equipment slots should bullets be added into */ - addBulletsToVestAndPockets(ammoTpl: string, cartridgeCount: number, inventory: Inventory): void; + addAmmoIntoEquipmentSlots(ammoTpl: string, cartridgeCount: number, inventory: Inventory, equipmentSlotsToAddTo?: EquipmentSlots[]): void; /** * Get a weapons default magazine template id * @param weaponTemplate weapon to get default magazine for @@ -59,7 +63,8 @@ export declare class BotWeaponGeneratorHelper { */ getWeaponsDefaultMagazineTpl(weaponTemplate: ITemplateItem): string; /** - * Adds an item with all its childern into specified equipmentSlots, wherever it fits. + * TODO - move into BotGeneratorHelper, this is not the class for it + * Adds an item with all its children into specified equipmentSlots, wherever it fits. * @param equipmentSlots * @param parentId * @param parentTpl diff --git a/Faupi-HideoutArchitect/server/types/helpers/DialogueHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/DialogueHelper.d.ts index 88a726e..8f03b81 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/DialogueHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/DialogueHelper.d.ts @@ -4,6 +4,7 @@ import { MessageType } from "../models/enums/MessageType"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; +import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; @@ -15,8 +16,9 @@ export declare class DialogueHelper { protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; + protected localisationService: LocalisationService; protected itemHelper: ItemHelper; - constructor(logger: ILogger, 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, localisationService: LocalisationService, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. diff --git a/Faupi-HideoutArchitect/server/types/helpers/DurabilityLimitsHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/DurabilityLimitsHelper.d.ts index 07a5db1..7122376 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/DurabilityLimitsHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/DurabilityLimitsHelper.d.ts @@ -9,10 +9,10 @@ export declare class DurabilityLimitsHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; constructor(randomUtil: RandomUtil, botHelper: BotHelper, configServer: ConfigServer); - getRandomisedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; - getRandomisedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; - getRandomisedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - getRandomisedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; protected generateMaxWeaponDurability(botRole: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; protected getLowestMaxWeaponFromConfig(botRole: string): number; @@ -23,4 +23,6 @@ export declare class DurabilityLimitsHelper { protected getMaxWeaponDeltaFromConfig(botRole: string): number; protected getMinArmorDeltaFromConfig(botRole: string): number; protected getMaxArmorDeltaFromConfig(botRole: string): number; + protected getMinArmorLimitPercentFromConfig(botRole: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole: string): number; } diff --git a/Faupi-HideoutArchitect/server/types/helpers/GameEventHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/GameEventHelper.d.ts index fa25eff..f502c95 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/GameEventHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/GameEventHelper.d.ts @@ -1,4 +1,4 @@ -import { ISeasonalEvent, ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig"; +import { ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; export declare class GameEventHelper { @@ -6,24 +6,4 @@ export declare class GameEventHelper { protected configServer: ConfigServer; protected seasonalEventConfig: ISeasonalEventConfig; constructor(databaseServer: DatabaseServer, configServer: ConfigServer); - get events(): Record; - get christmasEventItems(): string[]; - itemIsChristmasRelated(itemId: string): boolean; - christmasEventEnabled(): boolean; - /** - * Get the dates each seasonal event starts and ends - * @returns Record with event name + start/end date - */ - getEventDetails(): ISeasonalEvent[]; - /** - * Is detection of seasonal events enabled (halloween / christmas) - * @returns true if seasonal events should be checked for - */ - isAutomaticEventDetectionEnabled(): boolean; - /** - * Get a dictionary of gear changes to apply to bots for a specific event e.g. Christmas/Halloween - * @param eventName Name of event to get gear changes for - * @returns bots with equipment changes - */ - getEventBotGear(eventName: string): Record>>; } diff --git a/Faupi-HideoutArchitect/server/types/helpers/HandbookHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/HandbookHelper.d.ts index 1ab7800..aa329a9 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/HandbookHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/HandbookHelper.d.ts @@ -11,6 +11,7 @@ export declare class LookupCollection { } export declare class HandbookHelper { protected databaseServer: DatabaseServer; + protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; constructor(databaseServer: DatabaseServer); hydrateLookup(): void; @@ -35,18 +36,18 @@ export declare class HandbookHelper { isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Convert currency into roubles - * @param {number} value - * @param {string} currencyFrom - * @returns get rouble value of inputted currency - */ - inRUB(value: number, currencyFrom: string): number; - /** - * Gets Ruble to Currency conversion Value - * @param {number} value - * @param {string} currencyTo - * @returns number + * Convert non-roubles into roubles + * @param nonRoubleCurrencyCount Currency count to convert + * @param currencyTypeFrom What current currency is + * @returns Count in roubles */ - fromRUB(value: number, currencyTo: string): number; + inRUB(nonRoubleCurrencyCount: number, currencyTypeFrom: string): number; + /** + * Convert roubles into another currency + * @param roubleCurrencyCount roubles to convert + * @param currencyTypeTo Currency to convert roubles into + * @returns currency count in desired type + */ + fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; } export {}; diff --git a/Faupi-HideoutArchitect/server/types/helpers/HealthHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/HealthHelper.d.ts index 3116c9c..7a6d41d 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/HealthHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/HealthHelper.d.ts @@ -1,6 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; -import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { Effects, IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IHealthConfig } from "../models/spt/config/IHealthConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -16,7 +16,7 @@ export declare class HealthHelper { protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); /** - * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * Resets the profiles vitality/health and vitality/effects properties to their defaults * @param sessionID Session Id * @returns updated profile */ @@ -24,28 +24,34 @@ export declare class HealthHelper { /** * Update player profile with changes from request object * @param pmcData Player profile - * @param info Request object + * @param request Heal request * @param sessionID Session id * @param addEffects Should effects be added or removed (default - add) */ - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; + /** + * Adjust hydration/energy/temperate and body part hp values in player profile to values in profile.vitality + * @param pmcData Profile to update + * @param sessionId Session id + */ protected saveHealth(pmcData: IPmcData, sessionID: string): void; /** * Save effects to profile * Works by removing all effects and adding them back from profile - * Remoces empty 'Effects' objects if found + * Removes empty 'Effects' objects if found * @param pmcData Player profile - * @param sessionID Session id + * @param sessionId Session id + * @param bodyPartsWithEffects dict of body parts with effects that should be added to profile * @param addEffects Should effects be added back to profile - * @returns */ - protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + protected saveEffects(pmcData: IPmcData, sessionId: string, bodyPartsWithEffects: Effects, deleteExistingEffects?: boolean): void; /** * Add effect to body part in profile * @param pmcData Player profile * @param effectBodyPart body part to edit * @param effectType Effect to add to body part + * @param duration How long the effect has left in seconds (-1 by default, no duration). */ - protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string, duration?: number): void; protected isEmpty(map: any): boolean; } diff --git a/Faupi-HideoutArchitect/server/types/helpers/HideoutHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/HideoutHelper.d.ts index 9d51fed..a5849e3 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/HideoutHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/HideoutHelper.d.ts @@ -1,8 +1,9 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Common, HideoutArea, Production, Productive } from "../models/eft/common/tables/IBotBase"; +import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "../models/eft/common/tables/IBotBase"; import { Upd } from "../models/eft/common/tables/IItem"; import { StageBonus } from "../models/eft/hideout/IHideoutArea"; -import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; +import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; +import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData"; import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -15,7 +16,6 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { HashUtil } from "../utils/HashUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; -import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { InventoryHelper } from "./InventoryHelper"; import { ProfileHelper } from "./ProfileHelper"; @@ -23,7 +23,6 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -36,11 +35,13 @@ export declare class HideoutHelper { static waterCollector: string; static bitcoin: string; static expeditionaryFuelTank: string; + static maxSkillPoint: number; + private static generatorOffMultipler; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, configServer: ConfigServer); - registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, configServer: ConfigServer); + registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** - * This convinience function intialies new Production Object + * This convenience function initializes new Production Object * with all the constants. */ initProduction(recipeId: string, productionTime: number): Production; @@ -81,6 +82,26 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; + /** + * Update a productions progress value based on the amount of time that has passed + * @param pmcData Player profile + * @param prodId Production id being crafted + * @param recipe Recipe data being crafted + * @param hideoutProperties + */ + protected updateProductionProgress(pmcData: IPmcData, prodId: string, recipe: IHideoutProduction, hideoutProperties: { + btcFarmCGs?: number; + isGeneratorOn: boolean; + waterCollectorHasFilter?: boolean; + }): void; + /** + * Check if a productions progress value matches its corresponding recipes production time value + * @param pmcData Player profile + * @param prodId Production id + * @param recipe Recipe being crafted + * @returns progress matches productionTime from recipe + */ + protected doesProgressMatchProductionTime(pmcData: IPmcData, prodId: string): boolean; /** * Update progress timer for scav case * @param pmcData Profile to update @@ -105,7 +126,7 @@ export declare class HideoutHelper { * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update * @param production production object - * @param isGeneratorOn is generatory enabled + * @param isGeneratorOn is generator enabled * @param pmcData Player profile * @returns Updated HideoutArea object */ @@ -113,11 +134,53 @@ export declare class HideoutHelper { protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): void; protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + /** + * Get a count of how many BTC can be gathered by the profile + * @param pmcData Profile to look up + * @returns coin slot count + */ protected getBTCSlots(pmcData: IPmcData): number; protected getManagementSkillsSlots(): number; protected hasManagementSkillSlots(pmcData: IPmcData): boolean; protected getHideoutManagementSkill(pmcData: IPmcData): Common; protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; + /** + * Get the crafting skill details from player profile + * @param pmcData Player profile + * @returns crafting skill, null if not found + */ + protected getCraftingSkill(pmcData: IPmcData): Common; + /** + * Adjust craft time based on crafting skill level found in player profile + * @param pmcData Player profile + * @param productionTime Time to complete hideout craft in seconds + * @returns Adjusted craft time in seconds + */ + protected getCraftingSkillProductionTimeReduction(pmcData: IPmcData, productionTime: number): number; isProduction(productive: Productive): productive is Production; - getBTC(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Gather crafted BTC from hideout area and add to inventory + * Reset production start timestamp if hideout area at full coin capacity + * @param pmcData Player profile + * @param request Take production request + * @param sessionId Session id + * @returns IItemEventRouterResponse + */ + getBTC(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Upgrade hideout wall from starting level to interactable level if enough time has passed + * @param pmcProfile Profile to upgrade wall in + */ + unlockHideoutWallInProfile(pmcProfile: IPmcData): void; + /** + * Hideout improvement is flagged as complete + * @param improvement hideout improvement object + * @returns true if complete + */ + protected hideoutImprovementIsComplete(improvement: IHideoutImprovement): boolean; + /** + * Iterate over hideout improvements not completed and check if they need to be adjusted + * @param pmcProfile Profile to adjust + */ + setHideoutImprovementsToCompleted(pmcProfile: IPmcData): void; } diff --git a/Faupi-HideoutArchitect/server/types/helpers/InRaidHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/InRaidHelper.d.ts index 962df38..c69a810 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/InRaidHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/InRaidHelper.d.ts @@ -5,6 +5,7 @@ import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; +import { LocalisationService } from "../services/LocalisationService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { JsonUtil } from "../utils/JsonUtil"; import { InventoryHelper } from "./InventoryHelper"; @@ -16,8 +17,9 @@ export declare class InRaidHelper { protected databaseServer: DatabaseServer; protected inventoryHelper: InventoryHelper; protected paymentHelper: PaymentHelper; + protected localisationService: LocalisationService; protected profileFixerService: ProfileFixerService; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, profileFixerService: ProfileFixerService); + constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService); /** * Check an array of items and add an upd object to money items with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues @@ -38,10 +40,16 @@ export declare class InRaidHelper { * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data - * @param sessionID Sessino id + * @param sessionID Session id * @returns Reset profile object */ updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): IPmcData; + /** + * Take body part effects from client profile and apply to server profile + * @param saveProgressRequest post-raid request + * @param profileData player profile on server + */ + protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -58,7 +66,7 @@ export declare class InRaidHelper { * Adds SpawnedInSession property to items found in a raid * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true * @param preRaidProfile profile to update - * @param postRaidProfile profile to upate inventory contents of + * @param postRaidProfile profile to update inventory contents of * @param isPlayerScav Was this a p scav raid * @returns */ diff --git a/Faupi-HideoutArchitect/server/types/helpers/InventoryHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/InventoryHelper.d.ts index 6419f93..8855d1e 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/InventoryHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/InventoryHelper.d.ts @@ -1,6 +1,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; -import { IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData"; +import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData"; +import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; @@ -43,7 +44,44 @@ export declare class InventoryHelper { protected configServer: ConfigServer; protected inventoryConfig: IInventoryConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, httpResponse: HttpResponseUtil, fenceService: FenceService, databaseServer: DatabaseServer, paymentHelper: PaymentHelper, traderAssortHelper: TraderAssortHelper, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, containerHelper: ContainerHelper, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer); - addItem(pmcData: IPmcData, body: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: any, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse; + /** + * BUG: Passing the same item multiple times with a count of 1 will cause multiples of that item to be added (e.g. x3 separate objects of tar cola with count of 1 = 9 tarcolas being added to inventory) + * @param pmcData Profile to add items to + * @param request request data to add items + * @param output response to send back to client + * @param sessionID Session id + * @param callback Code to execute later (function) + * @param foundInRaid Will results added to inventory be set as found in raid + * @param addUpd Additional upd properties for items being added to inventory + * @returns IItemEventRouterResponse + */ + addItem(pmcData: IPmcData, request: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: { + (): void; + }, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse; + /** + * Add ammo to ammo boxes + * @param itemToAdd Item to check is ammo box + * @param toDo + * @param output IItemEventRouterResponse object + * @param sessionID Session id + * @param pmcData Profile to add ammobox to + */ + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, toDo: string[][], sessionID: string, output: IItemEventRouterResponse): void; + /** + * + * @param assortItems Items to add to inventory + * @param requestItem Details of purchased item to add to inventory + * @param result Array split stacks are added to + */ + protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; + /** + * Remove item from player inventory + * @param pmcData Profile to remove item from + * @param itemId Items id to remove + * @param sessionID Session id + * @param output Existing IItemEventRouterResponse object to append data to, creates new one by default if not supplied + * @returns IItemEventRouterResponse + */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): Record; diff --git a/Faupi-HideoutArchitect/server/types/helpers/ItemHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/ItemHelper.d.ts index fc88a46..de424d2 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/ItemHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/ItemHelper.d.ts @@ -5,12 +5,15 @@ import { IStaticAmmoDetails } from "../models/eft/common/tables/ILootBase"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocaleService } from "../services/LocaleService"; +import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { MathUtil } from "../utils/MathUtil"; import { ObjectId } from "../utils/ObjectId"; import { RandomUtil } from "../utils/RandomUtil"; +import { HandbookHelper } from "./HandbookHelper"; declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; @@ -19,22 +22,32 @@ declare class ItemHelper { protected objectId: ObjectId; protected mathUtil: MathUtil; protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemBaseClassService: ItemBaseClassService; + protected localisationService: LocalisationService; protected localeService: LocaleService; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl - * @returns boolean; true for items that may be in player posession and not quest items + * @returns boolean; true for items that may be in player possession and not quest items */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** * Check if the tpl / template Id provided is a descendent of the baseclass * * @param {string} tpl the item template id to check - * @param {string} baseclassTpl the baseclass to check for + * @param {string} baseClassTpl the baseclass to check for * @return {boolean} is the tpl a descendent? */ - isOfBaseclass(tpl: string, baseclassTpl: string): boolean; + isOfBaseclass(tpl: string, baseClassTpl: string): boolean; + /** + * Check if item has any of the supplied base classes + * @param tpl Item to check base classes of + * @param baseClassTpls base classes to check for + * @returns true if any supplied base classes match + */ + isOfBaseclasses(tpl: string, baseClassTpls: string[]): boolean; /** * Returns the item price based on the handbook or as a fallback from the prices.json if the item is not * found in the handbook. If the price can't be found at all return 0 @@ -152,7 +165,7 @@ declare class ItemHelper { */ getChildId(item: Item): string; /** - * Can the pased in item be stacked + * Can the passed in item be stacked * @param tpl item to check * @returns true if it can be stacked */ @@ -179,7 +192,7 @@ declare class ItemHelper { */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** - * Recursivly loop down through an items hierarchy to see if any of the ids match the supplied list, return true if any do + * WARNING, SLOW. Recursively loop down through an items hierarchy to see if any of the ids match the supplied list, return true if any do * @param {string} tpl * @param {Array} tplsToCheck * @returns boolean @@ -207,7 +220,15 @@ declare class ItemHelper { createRandomMagCartridges(magTemplate: ITemplateItem, parentId: string, staticAmmoDist: Record, caliber?: string): Item; protected getRandomValidCaliber(magTemplate: ITemplateItem): string; protected drawAmmoTpl(caliber: string, staticAmmoDist: Record): string; - createCartidges(parentId: string, ammoTpl: string, stackCount: number): Item; + /** + * + * @param parentId container cartridges will be placed in + * @param ammoTpl Cartridge to insert + * @param stackCount Count of cartridges inside parent + * @param location Location inside parent (e.g. 0, 1) + * @returns Item + */ + createCartridges(parentId: string, ammoTpl: string, stackCount: number, location: number): Item; /** * Get the size of a stack, return 1 if no stack object count property found * @param item Item to get stack size of diff --git a/Faupi-HideoutArchitect/server/types/helpers/NotificationSendHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/NotificationSendHelper.d.ts index 014ac95..c80f22d 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/NotificationSendHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/NotificationSendHelper.d.ts @@ -6,7 +6,7 @@ export declare class NotificationSendHelper { protected notificationService: NotificationService; constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** - * Send notification message to the appropiate channel + * Send notification message to the appropriate channel */ sendMessage(sessionID: string, notificationMessage: INotification): void; } diff --git a/Faupi-HideoutArchitect/server/types/helpers/PresetHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/PresetHelper.d.ts index a469582..cea210e 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/PresetHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/PresetHelper.d.ts @@ -5,8 +5,10 @@ export declare class PresetHelper { protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; + protected defaultPresets: Record; constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; + getDefaultPresets(): Record; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): Preset; diff --git a/Faupi-HideoutArchitect/server/types/helpers/ProfileHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/ProfileHelper.d.ts index 9c6560a..79652ad 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/ProfileHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/ProfileHelper.d.ts @@ -5,7 +5,6 @@ import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNic import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; -import { FenceService } from "../services/FenceService"; import { ProfileSnapshotService } from "../services/ProfileSnapshotService"; import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -20,9 +19,13 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - protected fenceService: FenceService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService); + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); resetProfileQuestCondition(sessionID: string, conditionId: string): void; + /** + * Get all profiles from server + * @returns Dictionary of profiles + */ + getProfiles(): Record; getCompleteProfile(sessionID: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen @@ -41,7 +44,7 @@ export declare class ProfileHelper { /** * Add experience to a PMC inside the players profile * @param sessionID Session id - * @param experienceToAdd Experiecne to add to PMC character + * @param experienceToAdd Experience to add to PMC character */ addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; diff --git a/Faupi-HideoutArchitect/server/types/helpers/QuestHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/QuestHelper.d.ts index edbd2e1..de7cba2 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/QuestHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/QuestHelper.d.ts @@ -1,8 +1,9 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { Quest } from "../models/eft/common/tables/IBotBase"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; -import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData"; +import { IFailQuestRequestData } from "../models/eft/quests/IFailQuestRequestData"; import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -10,6 +11,7 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; +import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -32,15 +34,16 @@ export declare class QuestHelper { protected dialogueHelper: DialogueHelper; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected localisationService: LocalisationService; protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search * @param questID Quest id to look up - * @returns QuestStauts enum + * @returns QuestStatus enum */ getQuestStatus(pmcData: IPmcData, questID: string): QuestStatus; /** @@ -52,7 +55,7 @@ export declare class QuestHelper { doesPlayerLevelFulfilCondition(playerLevel: number, condition: AvailableForConditions): boolean; /** * Get the quests found in both arrays (inner join) - * @param before Array of qeusts #1 + * @param before Array of quests #1 * @param after Array of quests #2 * @returns Reduction of cartesian product between two quest arrays */ @@ -61,22 +64,21 @@ export declare class QuestHelper { * Increase skill points of a skill on player profile * @param sessionID Session id * @param pmcData Player profile - * @param output output object to send back to client * @param skillName Name of skill to increase skill points of * @param progressAmount Amount of skill points to add to skill */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, output: IItemEventRouterResponse, skillName: string, progressAmount: number): void; - getQuestLocale(questId: string): any; + rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; /** - * Debug Routine for showing some information on the - * quest list in question. + * Get quest name by quest id + * @param questId id to get + * @returns */ - dumpQuests(quests: any): void; + getQuestNameFromLocale(questId: string): string; /** - * Check if trader has sufficient loyalty to fullfill quest requirement + * Check if trader has sufficient loyalty to fulfill quest requirement * @param questProperties Quest props * @param profile Player profile - * @returns true if loyalty is high enough to fulfil quest requirement + * @returns true if loyalty is high enough to fulfill quest requirement */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; protected processReward(reward: Reward): Reward[]; @@ -88,12 +90,12 @@ export declare class QuestHelper { */ getQuestRewardItems(quest: IQuest, state: QuestStatus): Reward[]; /** - * Update player profile with quest status (e.g. Fail/Success) - * @param pmcData profile to add quest to - * @param newState state the new quest should be in when added - * @param acceptedQuest Details of quest being added + * Look up quest in db by accepted quest id and construct a profile-ready object ready to store in profile + * @param pmcData Player profile + * @param newState State the new quest should be in when returned + * @param acceptedQuest Details of accepted quest from client */ - addQuestToPMCData(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): void; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; /** * TODO: what is going on here * @param acceptedQuestId Quest to add to profile @@ -109,12 +111,12 @@ export declare class QuestHelper { */ failedUnlocked(failedQuestId: string, sessionID: string): IQuest[]; /** - * Adjust quest money rewards by passed in multipler + * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards - * @param multipler Value to adjust money rewards by + * @param multiplier Value to adjust money rewards by * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multipler: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization @@ -125,12 +127,6 @@ export declare class QuestHelper { * @param output ItemEvent router response */ changeItemStack(pmcData: IPmcData, itemId: string, newStackSize: number, sessionID: string, output: IItemEventRouterResponse): void; - /** - * Get List of All Quests from db - * NOT CLONED - * @returns Array of IQuest objects - */ - getQuestsFromDb(): IQuest[]; /** * Get quests, strip all requirement conditions except level * @param quests quests to process @@ -145,45 +141,62 @@ export declare class QuestHelper { getQuestWithOnlyLevelRequirementStartCondition(quest: IQuest): IQuest; /** * Fail a quest in a player profile - * @param pmcData Profile - * @param failRequest fail quest request data + * @param pmcData Player profile + * @param failRequest Fail quest request data * @param sessionID Session id * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: any, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; /** - * Get quest by id from database - * @param questId questid to look for - * @param pmcData player profile + * Get List of All Quests from db + * NOT CLONED + * @returns Array of IQuest objects + */ + getQuestsFromDb(): IQuest[]; + /** + * Get quest by id from database (repeatables are stored in profile, check there if questId not found) + * @param questId Id of quest to find + * @param pmcData Player profile * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; /** * Get the locale Id from locale db for a quest message - * @param questMessageId Quest mesage id to look up + * @param questMessageId Quest message id to look up * @returns Locale Id from locale db */ getQuestLocaleIdFromDb(questMessageId: string): string; /** - * Alter a quests state + Add a record to tis status timers object + * Alter a quests state + Add a record to its status timers object * @param pmcData Profile to update - * @param newQuestState new state the qeust should be in - * @param questId id of the quest to alter the status of + * @param newQuestState New state the quest should be in + * @param questId Id of the quest to alter the status of */ updateQuestState(pmcData: IPmcData, newQuestState: QuestStatus, questId: string): void; /** - * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks - Returns reward items player earned * @param pmcData Player profile - * @param body complete quest request - * @param state State of the quest now its complete - * @param sessionID Seession id - * @returns array of reward objects + * @param questId questId of quest to get rewards for + * @param state State of the quest to get rewards for + * @param sessionId Session id + * @param questResponse Response to send back to client + * @returns Array of reward objects */ - applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: QuestStatus, sessionID: string): Reward[]; + applyQuestReward(pmcData: IPmcData, questId: string, state: QuestStatus, sessionId: string, questResponse: IItemEventRouterResponse): Reward[]; /** - * Get the intel center bonus a player has + * WIP - Find hideout craft id and add to unlockedProductionRecipe array in player profile + * also update client response recipeUnlocked array with craft id + * @param pmcData Player profile + * @param craftUnlockReward Reward item from quest with craft unlock details + * @param questDetails Quest with craft unlock reward + * @param sessionID Session id + * @param response Response to send back to client + */ + protected findAndAddHideoutProductionIdToProfile(pmcData: IPmcData, craftUnlockReward: Reward, questDetails: IQuest, sessionID: string, response: IItemEventRouterResponse): void; + /** + * Get players intel center bonus from profile * @param pmcData player profile - * @returns bonus in percent + * @returns bonus as a percent */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** @@ -192,4 +205,10 @@ export declare class QuestHelper { * @returns 'FindItem' condition id */ getFindItemIdForQuestHandIn(itemTpl: string): string; + /** + * Add all quests to a profile with the provided statuses + * @param pmcProfile profile to update + * @param statuses statuses quests should have + */ + addAllQuestsToProfile(pmcProfile: IPmcData, statuses: QuestStatus[]): void; } diff --git a/Faupi-HideoutArchitect/server/types/helpers/RagfairOfferHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/RagfairOfferHelper.d.ts index b73f786..3d0d570 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/RagfairOfferHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/RagfairOfferHelper.d.ts @@ -46,8 +46,14 @@ export declare class RagfairOfferHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); - getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Has a traders offer ran out of stock to sell to player + * @param offer Offer to check stock of + * @returns true if out of stock + */ + protected traderOutOfStock(offer: IRagfairOffer): boolean; /** * Check if trader offers' BuyRestrictionMax value has been reached * @param offer offer to check restriction properties of @@ -64,5 +70,5 @@ export declare class RagfairOfferHelper { protected getProfileOffers(sessionID: string): IRagfairOffer[]; protected deleteOfferByOfferId(sessionID: string, offerId: string): void; protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/Faupi-HideoutArchitect/server/types/helpers/RagfairSellHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/RagfairSellHelper.d.ts index 91b8a20..bf7aeb6 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/RagfairSellHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/RagfairSellHelper.d.ts @@ -11,12 +11,26 @@ export declare class RagfairSellHelper { protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); - calculateSellChance(baseChancePercent: number, offerPriceRub: number, playerListedPriceRub: number): number; + /** + * Get the percent chance to sell an item based on its average listed price vs player chosen listing price + * @param baseChancePercent Base chance to sell item + * @param averageOfferPriceRub Price of average offer in roubles + * @param playerListedPriceRub Price player listed item for in roubles + * @returns percent value + */ + calculateSellChance(baseChancePercent: number, averageOfferPriceRub: number, playerListedPriceRub: number): number; + /** + * Get percent chance to sell an item when price is below items average listing price + * @param playerListedPriceRub Price player listed item for in roubles + * @param averageOfferPriceRub Price of average offer in roubles + * @returns percent value + */ + protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Determine if the offer being listed will be sold * @param sellChancePercent chance item will sell * @param itemSellCount count of items to sell - * @returns Array of purchases of item(s) lsited + * @returns Array of purchases of item(s) listed */ rollForSale(sellChancePercent: number, itemSellCount: number): SellResult[]; } diff --git a/Faupi-HideoutArchitect/server/types/helpers/RagfairServerHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/RagfairServerHelper.d.ts index ec388d8..bfe6cc3 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/RagfairServerHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/RagfairServerHelper.d.ts @@ -42,7 +42,7 @@ export declare class RagfairServerHelper { protected isItemBlacklisted(itemTemplateId: string): boolean; isTrader(userID: string): boolean; isPlayer(userID: string): boolean; - returnItems(sessionID: string, items: any[]): void; + returnItems(sessionID: string, items: Item[]): void; calculateDynamicStackCount(tplId: string, isWeaponPreset: boolean): number; /** * Choose a currency at random with bias diff --git a/Faupi-HideoutArchitect/server/types/helpers/RagfairSortHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/RagfairSortHelper.d.ts index 4669ce6..6a06528 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/RagfairSortHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/RagfairSortHelper.d.ts @@ -7,7 +7,7 @@ export declare class RagfairSortHelper { protected localeService: LocaleService; constructor(databaseServer: DatabaseServer, localeService: LocaleService); /** - * Sort a list of ragfair offers by something (id/rating/offer name/price/expirty time) + * Sort a list of ragfair offers by something (id/rating/offer name/price/expiry time) * @param offers Offers to sort * @param type How to sort it * @param direction Ascending/descending diff --git a/Faupi-HideoutArchitect/server/types/helpers/RepairHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/RepairHelper.d.ts index 5b09320..0d0257a 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/RepairHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/RepairHelper.d.ts @@ -15,7 +15,7 @@ export declare class RepairHelper { protected repairConfig: IRepairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * + * Alter an items durability after a repair by trader/repair kit * @param itemToRepair item to update durability details * @param itemToRepairDetails db details of item to repair * @param isArmor Is item being repaired a piece of armor @@ -24,7 +24,12 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegredationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegredationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; + /** + * Is the supplied tpl a weapon + * @param tpl tplId to check is a weapon + * @returns true if tpl is a weapon + */ isWeaponTemplate(tpl: string): boolean; } diff --git a/Faupi-HideoutArchitect/server/types/helpers/TradeHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/TradeHelper.d.ts index 2a8f0b7..6811dd1 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/TradeHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/TradeHelper.d.ts @@ -6,8 +6,10 @@ import { Item, Upd } from "../models/eft/common/tables/IItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; @@ -20,28 +22,30 @@ export declare class TradeHelper { protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer, configServer: ConfigServer); /** * Buy item from flea or trader - * @param pmcData + * @param pmcData Player profile * @param buyRequestData data from client - * @param sessionID - * @param foundInRaid + * @param sessionID Session id + * @param foundInRaid Should item be found in raid * @param upd optional item details used when buying from flea * @returns */ buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData - * @param body - * @param sessionID - * @returns + * @param pmcData Profile to update + * @param sellRequest request data + * @param sessionID Session id + * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, body: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased - * Show error on screen if player attepts to buy more than what the buy max allows + * Show error on screen if player attempts to buy more than what the buy max allows * @param assortBeingPurchased assort being bought * @param itemsPurchasedCount number of items being bought */ diff --git a/Faupi-HideoutArchitect/server/types/helpers/TraderAssortHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/TraderAssortHelper.d.ts index 025efd6..a0294a1 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/TraderAssortHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/TraderAssortHelper.d.ts @@ -7,7 +7,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; +import { LocalisationService } from "../services/LocalisationService"; import { TraderAssortService } from "../services/TraderAssortService"; +import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; import { MathUtil } from "../utils/MathUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -27,11 +29,15 @@ export declare class TraderAssortHelper { protected ragfairAssortGenerator: RagfairAssortGenerator; protected ragfairOfferGenerator: RagfairOfferGenerator; protected traderAssortService: TraderAssortService; + protected localisationService: LocalisationService; + protected traderPurchasePersisterService: TraderPurchasePersisterService; protected traderHelper: TraderHelper; protected fenceService: FenceService; protected configServer: ConfigServer; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer); + protected mergedQuestAssorts: Record>; + protected createdMergedQuestAssorts: boolean; + constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, localisationService: LocalisationService, traderPurchasePersisterService: TraderPurchasePersisterService, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer); /** * Get a traders assorts * Can be used for returning ragfair / fence assorts @@ -41,6 +47,10 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Create a dict of all assort id = quest id mappings used to work out what items should be shown to player based on the quests they've started/completed/failed + */ + protected hydrateMergedQuestAssorts(): void; /** * Reset a traders assorts and move nextResupply value to future * Flag trader as needing a flea offer reset to be picked up by flea update() function @@ -57,7 +67,7 @@ export declare class TraderAssortHelper { * Iterate over all assorts barter_scheme values, find barters selling for money and multiply by multipler in config * @param traderAssort Assorts to multiple price of */ - protected multiplyItemPricesByConfigMultipler(traderAssort: ITraderAssort): void; + protected multiplyItemPricesByConfigMultiplier(traderAssort: ITraderAssort): void; /** * Get an array of pristine trader items prior to any alteration by player (as they were on server start) * @param traderId trader id diff --git a/Faupi-HideoutArchitect/server/types/helpers/TraderHelper.d.ts b/Faupi-HideoutArchitect/server/types/helpers/TraderHelper.d.ts index 0dc93e8..49aea28 100644 --- a/Faupi-HideoutArchitect/server/types/helpers/TraderHelper.d.ts +++ b/Faupi-HideoutArchitect/server/types/helpers/TraderHelper.d.ts @@ -8,6 +8,7 @@ import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { FenceService } from "../services/FenceService"; +import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; @@ -23,11 +24,14 @@ export declare class TraderHelper { protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; + protected localisationService: LocalisationService; protected fenceService: FenceService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + /** Dictionary of item tpl and the highest trader rouble price */ + protected highestTraderPriceItems: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -39,11 +43,11 @@ export declare class TraderHelper { resetTrader(sessionID: string, traderID: string): void; /** * Alter a traders unlocked status - * @param traderID Trader to alter + * @param traderId Trader to alter * @param status New status to use - * @param sessionID Session id + * @param sessionId Session id */ - setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; + setTraderUnlockedState(traderId: string, status: boolean, sessionId: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -53,22 +57,29 @@ export declare class TraderHelper { getPurchasesData(traderID: string, sessionID: string): Record; /** * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData - * @param item - * @param sellCategory + * @param pmcData Profile + * @param item Item to be checked is sellable to trader + * @param sellCategory categories trader will buy + * @param traderId Trader item is being checked can be sold to * @returns true if should NOT be sold to trader */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[]): boolean; + protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; /** - * Can this weapon be sold to a trader with its current durabiltiy level - * @param traderID - * @param item - * @returns boolean + * Check if item has durability so low it precludes it from being sold to the trader (inclusive) + * @param item Item to check durability of + * @param traderId Trader item is sold to + * @returns */ - protected isWeaponBelowTraderBuyDurability(traderID: string, item: Item): boolean; + protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; /** - * Get the price of an item and all of its attached children - * Take into account bonuses/adjsutments e.g. discounts + * Get the percentage threshold value a trader will buy armor/weapons above + * @param traderId Trader to look up + * @returns percentage + */ + protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; + /** + * Get the price of passed in item and all of its attached children (mods) + * Take into account bonuses/adjustments e.g. discounts * @param pmcData profile data * @param item item to calculate price of * @param buyPriceCoefficient @@ -85,14 +96,21 @@ export declare class TraderHelper { * @returns price as number */ protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; + /** + * Get discount modifier for desired trader + * @param trader Trader to get discount for + * @param buyPriceCoefficient + * @param fenceInfo fence info, needed if getting fence modifier value + * @returns discount modifier value + */ + protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold - * @param sessionID Session id - * @param traderId traders id + * @param sessionId Session id + * @param traderId Traders id * @param standingToAdd Standing value to add to trader */ - addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + addStandingToTrader(sessionId: string, traderId: string, standingToAdd: number): void; /** * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process @@ -113,10 +131,28 @@ export declare class TraderHelper { getTraderUpdateSeconds(traderId: string): number; /** * check if an item is allowed to be sold to a trader - * @param traderFilters array of allowed categories + * @param categoriesTraderBuys array of allowed categories * @param tplToCheck itemTpl of inventory - * @returns boolean + * @returns boolean if item can be sold to trader */ - traderFilter(traderFilters: string[], tplToCheck: string): boolean; + doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; + /** + * Store the purchase of an assort from a trader in the player profile + * @param sessionID Session id + * @param newPurchaseDetails New item assort id + count + */ + addTraderPurchasesToPlayerProfile(sessionID: string, newPurchaseDetails: { + items: { + item_id: string; + count: number; + }[]; + tid: string; + }): void; + /** + * Get the highest rouble price for an item from traders + * @param tpl Item to look up highest pride for + * @returns highest rouble cost for item + */ + getHighestTraderPriceRouble(tpl: string): number; } diff --git a/Faupi-HideoutArchitect/server/types/loaders/BundleLoader.d.ts b/Faupi-HideoutArchitect/server/types/loaders/BundleLoader.d.ts index 06ad698..b88723c 100644 --- a/Faupi-HideoutArchitect/server/types/loaders/BundleLoader.d.ts +++ b/Faupi-HideoutArchitect/server/types/loaders/BundleLoader.d.ts @@ -19,4 +19,11 @@ export declare class BundleLoader { getBundle(key: string, local: boolean): BundleInfo; addBundles(modpath: string): void; } +export interface BundleManifest { + manifest: Array; +} +export interface BundleManifestEntry { + key: string; + path: string; +} export {}; diff --git a/Faupi-HideoutArchitect/server/types/loaders/ModTypeCheck.d.ts b/Faupi-HideoutArchitect/server/types/loaders/ModTypeCheck.d.ts new file mode 100644 index 0000000..e907341 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/loaders/ModTypeCheck.d.ts @@ -0,0 +1,43 @@ +import { IPostAkiLoadMod } from "../models/external/IPostAkiLoadMod"; +import { IPostAkiLoadModAsync } from "../models/external/IPostAkiLoadModAsync"; +import { IPostDBLoadMod } from "../models/external/IPostDBLoadMod"; +import { IPostDBLoadModAsync } from "../models/external/IPostDBLoadModAsync"; +import { IPreAkiLoadMod } from "../models/external/IPreAkiLoadMod"; +import { IPreAkiLoadModAsync } from "../models/external/IPreAkiLoadModAsync"; +export declare class ModTypeCheck { + /** + * Use defined safe guard to check if the mod is a IPreAkiLoadMod + * @returns boolean + */ + isPreAkiLoad(mod: any): mod is IPreAkiLoadMod; + /** + * Use defined safe guard to check if the mod is a IPostAkiLoadMod + * @returns boolean + */ + isPostAkiLoad(mod: any): mod is IPostAkiLoadMod; + /** + * Use defined safe guard to check if the mod is a IPostDBLoadMod + * @returns boolean + */ + isPostDBAkiLoad(mod: any): mod is IPostDBLoadMod; + /** + * Use defined safe guard to check if the mod is a IPreAkiLoadModAsync + * @returns boolean + */ + isPreAkiLoadAsync(mod: any): mod is IPreAkiLoadModAsync; + /** + * Use defined safe guard to check if the mod is a IPostAkiLoadModAsync + * @returns boolean + */ + isPostAkiLoadAsync(mod: any): mod is IPostAkiLoadModAsync; + /** + * Use defined safe guard to check if the mod is a IPostDBLoadModAsync + * @returns boolean + */ + isPostDBAkiLoadAsync(mod: any): mod is IPostDBLoadModAsync; + /** + * Checks for mod to be compatible with 3.X+ + * @returns boolean + */ + isPostV3Compatible(mod: any): boolean; +} diff --git a/Faupi-HideoutArchitect/server/types/loaders/PostAkiModLoader.d.ts b/Faupi-HideoutArchitect/server/types/loaders/PostAkiModLoader.d.ts index edc6e5d..5df8c6c 100644 --- a/Faupi-HideoutArchitect/server/types/loaders/PostAkiModLoader.d.ts +++ b/Faupi-HideoutArchitect/server/types/loaders/PostAkiModLoader.d.ts @@ -1,21 +1,17 @@ import { DependencyContainer } from "tsyringe"; -import { HandbookController } from "../controllers/HandbookController"; import { IModLoader } from "../models/spt/mod/IModLoader"; -import { ModCompilerService } from "../services/ModCompilerService"; import { VFS } from "../utils/VFS"; import { BundleLoader } from "./BundleLoader"; +import { ModTypeCheck } from "./ModTypeCheck"; import { PreAkiModLoader } from "./PreAkiModLoader"; export declare class PostAkiModLoader implements IModLoader { protected bundleLoader: BundleLoader; - protected handbookController: HandbookController; protected vfs: VFS; - protected modCompilerService: ModCompilerService; protected preAkiModLoader: PreAkiModLoader; - constructor(bundleLoader: BundleLoader, handbookController: HandbookController, vfs: VFS, modCompilerService: ModCompilerService, preAkiModLoader: PreAkiModLoader); - getBundles(local: boolean): string; - getBundle(key: string, local: boolean): void; + protected modTypeCheck: ModTypeCheck; + constructor(bundleLoader: BundleLoader, vfs: VFS, preAkiModLoader: PreAkiModLoader, modTypeCheck: ModTypeCheck); getModPath(mod: string): string; - load(): void; - protected executeMods(container: DependencyContainer): void; + load(): Promise; + protected executeMods(container: DependencyContainer): Promise; protected addBundles(): void; } diff --git a/Faupi-HideoutArchitect/server/types/loaders/PostDBModLoader.d.ts b/Faupi-HideoutArchitect/server/types/loaders/PostDBModLoader.d.ts index 5101b7b..c4cda5c 100644 --- a/Faupi-HideoutArchitect/server/types/loaders/PostDBModLoader.d.ts +++ b/Faupi-HideoutArchitect/server/types/loaders/PostDBModLoader.d.ts @@ -1,11 +1,13 @@ import { DependencyContainer } from "tsyringe"; import { OnLoad } from "../di/OnLoad"; +import { ModTypeCheck } from "./ModTypeCheck"; import { PreAkiModLoader } from "./PreAkiModLoader"; export declare class PostDBModLoader implements OnLoad { protected preAkiModLoader: PreAkiModLoader; - constructor(preAkiModLoader: PreAkiModLoader); - onLoad(): void; + protected modTypeCheck: ModTypeCheck; + constructor(preAkiModLoader: PreAkiModLoader, modTypeCheck: ModTypeCheck); + onLoad(): Promise; getRoute(): string; getModPath(mod: string): string; - protected executeMods(container: DependencyContainer): void; + protected executeMods(container: DependencyContainer): Promise; } diff --git a/Faupi-HideoutArchitect/server/types/loaders/PreAkiModLoader.d.ts b/Faupi-HideoutArchitect/server/types/loaders/PreAkiModLoader.d.ts index f486a28..1949696 100644 --- a/Faupi-HideoutArchitect/server/types/loaders/PreAkiModLoader.d.ts +++ b/Faupi-HideoutArchitect/server/types/loaders/PreAkiModLoader.d.ts @@ -1,9 +1,5 @@ import { DependencyContainer } from "tsyringe"; -import { IPostAkiLoadMod } from "../models/external/IPostAkiLoadMod"; -import { IPostDBLoadMod } from "../models/external/IPostDBLoadMod"; -import { IPreAkiLoadMod } from "../models/external/IPreAkiLoadMod"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; -import { ModLoader } from "../models/spt/mod/IMod"; import { IModLoader } from "../models/spt/mod/IModLoader"; import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,6 +9,7 @@ import { ModCompilerService } from "../services/ModCompilerService"; import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; import { BundleLoader } from "./BundleLoader"; +import { ModTypeCheck } from "./ModTypeCheck"; export declare class PreAkiModLoader implements IModLoader { protected logger: ILogger; protected vfs: VFS; @@ -21,21 +18,22 @@ export declare class PreAkiModLoader implements IModLoader { protected bundleLoader: BundleLoader; protected localisationService: LocalisationService; protected configServer: ConfigServer; + protected modTypeCheck: ModTypeCheck; protected static container: DependencyContainer; protected readonly basepath = "user/mods/"; - protected imported: Record; + protected readonly modOrderPath = "user/mods/order.json"; + protected order: Record; + protected imported: Record; protected akiConfig: ICoreConfig; - constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; - getBundles(local: boolean): string; - getBundle(key: string, local: boolean): void; /** * Returns a list of mods with preserved load order * @returns Array of mod names in load order */ getImportedModsNames(): string[]; + getImportedModDetails(): Record; getModPath(mod: string): string; - protected importClass(name: string, filepath: string, container: DependencyContainer): void; protected importMods(): Promise; /** * Check for duplciate mods loaded, show error if duplicate mod found @@ -60,29 +58,8 @@ export declare class PreAkiModLoader implements IModLoader { * @returns dictionary */ protected getModsPackageData(mods: string[]): Record; - /** - * Use defined safe guard to check if the mod is a IPreAkiLoadMod - * @returns boolean - */ - protected isPreAkiLoad(mod: any): mod is IPreAkiLoadMod; - /** - * Use defined safe guard to check if the mod is a IPostAkiLoadMod - * @returns boolean - */ - protected isPostAkiLoad(mod: any): mod is IPostAkiLoadMod; - /** - * Use defined safe guard to check if the mod is a IPostDBLoadMod - * @returns boolean - */ - protected isPostDBAkiLoad(mod: any): mod is IPostDBLoadMod; - /** - * Check that the mod is compatible with SPT 3.X.X - * @param mod the mod to check - * @returns boolean - */ - protected isModSpt3XXCompatible(mod: any): boolean; protected isModCombatibleWithAki(mod: IPackageJsonData): boolean; - protected executeMods(container: DependencyContainer): void; + protected executeMods(container: DependencyContainer): Promise; sortModsLoadOrder(): string[]; protected addMod(mod: string): Promise; protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; @@ -94,6 +71,6 @@ export declare class PreAkiModLoader implements IModLoader { */ protected validMod(modName: string): boolean; protected getLoadOrderRecursive(mod: string, result: Record, visited: Record): void; - protected getLoadOrder(mods: Record): Record; + protected getLoadOrder(mods: Record): Record; getContainer(): DependencyContainer; } diff --git a/Faupi-HideoutArchitect/server/types/models/eft/common/IGlobals.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/common/IGlobals.d.ts index b53f106..b5ed401 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/common/IGlobals.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,9 @@ export interface Config { GlobalLootChanceModifier: number; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; + TradingSetting: number; + TradingSettings: ITradingSettings; + ItemsCommonSettings: IItemsCommonSettings; LoadTimeSpeedProgress: number; BaseLoadTime: number; BaseUnloadTime: number; @@ -36,6 +39,7 @@ export interface Config { Customization: Customization; UncheckOnShot: boolean; BotsEnabled: boolean; + BufferZone: IBufferZone; ArmorMaterials: ArmorMaterials; LegsOverdamage: number; HandsOverdamage: number; @@ -55,7 +59,6 @@ export interface Config { StaminaRestoration: StaminaRestoration; StaminaDrain: StaminaDrain; RequirementReferences: RequirementReferences; - RepairKitSettings: RepairKitSettings; RestrictionsInRaid: RestrictionsInRaid[]; SkillMinEffectiveness: number; SkillFatiguePerPoint: number; @@ -82,6 +85,23 @@ export interface Config { TestValue: number; Inertia: Inertia; Ballistic: Ballistic; + RepairSettings: RepairSettings; +} +export interface IBufferZone { + CustomerAccessTime: number; + CustomerCriticalTimeStart: number; + CustomerKickNotifTime: number; +} +export interface IItemsCommonSettings { + ItemRemoveAfterInterruptionTime: number; +} +export interface ITradingSettings { + BuyoutRestrictions: IBuyoutRestrictions; +} +export interface IBuyoutRestrictions { + MinDurability: number; + MinFoodDrinkResource: number; + MinMedsResource: number; } export interface Content { ip: string; @@ -321,6 +341,8 @@ export interface Effects { Pain: Pain; PainKiller: PainKiller; SandingScreen: SandingScreen; + MildMusclePain: IMusclePainEffect; + SevereMusclePain: IMusclePainEffect; Stimulator: Stimulator; Tremor: Tremor; ChronicStaminaFatigue: ChronicStaminaFatigue; @@ -457,6 +479,12 @@ export interface PainKiller { export interface SandingScreen { Dummy: number; } +export interface IMusclePainEffect { + GymEffectivity: number; + OfflineDurationMax: number; + OfflineDurationMin: number; + TraumaChance: number; +} export interface Stimulator { BuffLoopTime: number; Buffs: Buffs; @@ -803,7 +831,7 @@ export interface SkillsSettings { HMG: any[]; Launcher: any[]; AttachedLauncher: any[]; - Melee: any[]; + Melee: IMeleeSkill; DMR: WeaponSkills; BearAssaultoperations: any[]; BearAuthority: any[]; @@ -847,10 +875,25 @@ export interface SkillsSettings { BotSound: any[]; TroubleShooting: TroubleShooting; } +export interface IMeleeSkill { + BuffSettings: IBuffSettings; +} export interface ArmorSkills { + BuffMaxCount: number; + BuffSettings: IBuffSettings; + Counters: IArmorCounters; + MoveSpeedPenaltyReductionHVestsReducePerLevel: number; + RicochetChanceHVestsCurrentDurabilityThreshold: number; + RicochetChanceHVestsEliteLevel: number; + RicochetChanceHVestsMaxDurabilityThreshold: number; + MeleeDamageLVestsReducePerLevel: number; + MoveSpeedPenaltyReductionLVestsReducePerLevel: number; WearAmountRepairLVestsReducePerLevel: number; WearChanceRepairLVestsReduceEliteLevel: number; } +export interface IArmorCounters { + armorDurability: ISkillCounter; +} export interface HideoutManagement { SkillPointsPerAreaUpgrade: number; SkillPointsPerCraft: number; @@ -907,6 +950,7 @@ export interface Endurance { MovementAction: number; SprintAction: number; GainPerFatigueStack: number; + QTELevelMultipliers: Record>; } export interface Strength { SprintActionMin: number; @@ -915,9 +959,14 @@ export interface Strength { MovementActionMax: number; PushUpMin: number; PushUpMax: number; + QTELevelMultipliers: IQTELevelMultiplier[]; FistfightAction: number; ThrowAction: number; } +export interface IQTELevelMultiplier { + Level: number; + Multiplier: number; +} export interface Vitality { DamageTakenAction: number; HealthNegativeEffect: number; @@ -950,22 +999,42 @@ export interface Search { FindAction: number; } export interface WeaponTreatment { + BuffMaxCount: number; + BuffSettings: IBuffSettings; + Counters: IWeaponTreatmentCounters; DurLossReducePerLevel: number; SkillPointsPerRepair: number; Filter: any[]; WearAmountRepairGunsReducePerLevel: number; WearChanceRepairGunsReduceEliteLevel: number; } +export interface IWeaponTreatmentCounters { + firearmsDurability: ISkillCounter; +} +export interface IBuffSettings { + CommonBuffChanceLevelBonus: number; + CommonBuffMinChanceValue: number; + CurrentDurabilityLossToRemoveBuff?: number; + MaxDurabilityLossToRemoveBuff?: number; + RareBuffChanceCoff: number; + ReceivedDurabilityMaxPercent: number; +} export interface MagDrills { RaidLoadedAmmoAction: number; RaidUnloadedAmmoAction: number; MagazineCheckAction: number; } export interface Perception { + DependentSkillRatios: ISkillRatio[]; OnlineAction: number; UniqueLoot: number; } +export interface ISkillRatio { + Ratio: number; + SkillId: string; +} export interface Intellect { + Counters: IIntellectCounters; ExamineAction: number; SkillProgress: number; RepairAction: number; @@ -973,16 +1042,52 @@ export interface Intellect { WearChanceReduceEliteLevel: number; RepairPointsCostReduction: number; } +export interface IIntellectCounters { + armorDurability: ISkillCounter; + firearmsDurability: ISkillCounter; + meleeWeaponDurability: ISkillCounter; +} +export interface ISkillCounter { + divisor: number; + points: number; +} export interface Attention { + DependentSkillRatios: ISkillRatio[]; ExamineWithInstruction: number; FindActionFalse: number; FindActionTrue: number; } export interface Charisma { + BonusSettings: IBonusSettings; + Counters: ICharismaSkillCounters; SkillProgressInt: number; SkillProgressAtn: number; SkillProgressPer: number; } +export interface ICharismaSkillCounters { + insuranceCost: ISkillCounter; + repairCost: ISkillCounter; + repeatableQuestCompleteCount: ISkillCounter; + restoredHealthCost: ISkillCounter; + scavCaseCost: ISkillCounter; +} +export interface IBonusSettings { + EliteBonusSettings: IEliteBonusSettings; + LevelBonusSettings: ILevelBonusSettings; +} +export interface IEliteBonusSettings { + FenceStandingLossDiscount: number; + RepeatableQuestExtraCount: number; + ScavCaseDiscount: number; +} +export interface ILevelBonusSettings { + HealthRestoreDiscount: number; + HealthRestoreTraderDiscount: number; + InsuranceDiscount: number; + InsuranceTraderDiscount: number; + PaidExitDiscount: number; + RepeatableQuestChangeDiscount: number; +} export interface Memory { AnySkillUp: number; SkillProgress: number; @@ -1145,11 +1250,30 @@ export interface xyz { export interface Ballistic { GlobalDamageDegradationCoefficient: number; } -export interface RepairKitSettings { +export interface RepairSettings { + ItemEnhancementSettings: IItemEnhancementSettings; + MinimumLevelToApplyBuff: number; + RepairStrategies: IRepairStrategies; armorClassDivisor: number; durabilityPointCostArmor: number; durabilityPointCostGuns: number; } +export interface IItemEnhancementSettings { + DamageReduction: IPriceModifier; + MalfunctionProtections: IPriceModifier; + WeaponSpread: IPriceModifier; +} +export interface IPriceModifier { + PriceModifier: number; +} +export interface IRepairStrategies { + Armor: IRepairStrategy; + Firearms: IRepairStrategy; +} +export interface IRepairStrategy { + BuffTypes: string[]; + Filter: string[]; +} export interface BotPreset { UseThis: boolean; Role: string; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/common/ILocationBase.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/common/ILocationBase.d.ts index 78ade9a..1c3a2fa 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/common/ILocationBase.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/common/ILocationBase.d.ts @@ -118,6 +118,7 @@ export interface BossLocationSpawn { TriggerName: string; Delay?: number; Supports?: BossSupport[]; + sptId?: string; } export interface BossSupport { BossEscortAmount: string; @@ -179,6 +180,7 @@ export interface Exit { EntryPoints: string; ExfiltrationTime: number; ExfiltrationType: string; + RequiredSlot?: string; Id: string; MaxTime: number; MinTime: number; @@ -202,6 +204,7 @@ export interface Wave { slots_min: number; time_max: number; time_min: number; + sptId?: string; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IBotBase.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IBotBase.d.ts index 1c28ae0..dd7c478 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IBotBase.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IBotBase.d.ts @@ -21,6 +21,7 @@ export interface IBotBase { Hideout: Hideout; Quests: Quest[]; TradersInfo: Record; + UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; RepeatableQuests: IPmcDataRepeatableQuest[]; Bonuses: Bonus[]; @@ -31,6 +32,9 @@ export interface IBotBase { /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IUnlockedInfo { + unlockedProductionRecipe: string[]; +} export interface Info { EntryPoint: string; Nickname: string; @@ -100,7 +104,10 @@ export interface BodyPartsHealth { } export interface BodyPartHealth { Health: CurrentMax; - Effects?: Record; + Effects?: Record; +} +export interface BodyPartEffectProperties { + Time: number; } export interface CurrentMax { Current: number; @@ -120,7 +127,6 @@ export interface FastPanel { export interface Skills { Common: Common[]; Mastering: Mastering[]; - Bonuses?: any[]; Points: number; } export interface Common { @@ -265,12 +271,24 @@ export interface InsuredItem { export interface Hideout { Production: Record; Areas: HideoutArea[]; + Improvements: Record; + sptUpdateLastRunTimestamp: number; +} +export interface IHideoutImprovement { + completed: boolean; + improveCompleteTimestamp: number; } export interface Productive { Products: Product[]; + /** Seconds passed of production */ Progress?: number; + /** Is craft in some state of being worked on by client (crafting/ready to pick up) */ inProgress?: boolean; StartTimestamp?: number; + SkipTime?: number; + /** Seconds needed to fully craft */ + ProductionTime?: number; + sptIsScavCase?: boolean; } export interface Production extends Productive { RecipeId: string; @@ -327,10 +345,12 @@ export interface Quest { statusTimers?: Record; /** SPT specific property */ completedConditions?: string[]; + availableAfter?: number; } export interface TraderInfo { loyaltyLevel: number; salesSum: number; + disabled: boolean; standing: number; nextResupply: number; unlocked: boolean; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IBotType.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IBotType.d.ts index 55b4bd9..e02d990 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IBotType.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IBotType.d.ts @@ -57,6 +57,10 @@ export interface ModsChances { mod_pistol_grip: number; mod_reciever: number; mod_scope: number; + mod_scope_000: number; + mod_scope_001: number; + mod_scope_002: number; + mod_scope_003: number; mod_sight_front: number; mod_sight_rear: number; mod_stock: number; @@ -152,4 +156,4 @@ export interface Items { SpecialLoot: string[]; TacticalVest: string[]; } -export declare type Mods = Record>; +export type Mods = Record>; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IItem.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IItem.d.ts index 2dd2c03..ce00ae9 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IItem.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IItem.d.ts @@ -7,6 +7,7 @@ export interface Item { upd?: Upd; } export interface Upd { + Buff?: Buff; OriginalStackObjectsCount?: number; Togglable?: Togglable; Map?: Map; @@ -16,6 +17,7 @@ export interface Upd { StackObjectsCount?: number; UnlimitedCount?: boolean; Repairable?: Repairable; + RecodableComponent?: RecodableComponent; FireMode?: FireMode; SpawnedInSession?: boolean; Light?: Light; @@ -31,6 +33,12 @@ export interface Upd { SideEffect?: SideEffect; RepairKit?: RepairKit; } +export interface Buff { + rarity: string; + buffType: string; + value: number; + thresholdDurability?: number; +} export interface Togglable { On: boolean; } @@ -52,6 +60,9 @@ export interface Repairable { Durability: number; MaxDurability: number; } +export interface RecodableComponent { + IsEncoded: boolean; +} export interface MedKit { HpResource: number; } @@ -98,7 +109,8 @@ export interface Location { y: number; r: string | number; isSearched?: boolean; - rotation?: string; + /** SPT property? */ + rotation?: string | boolean; } export interface SideEffect { Value: number; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IProfileTemplate.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IProfileTemplate.d.ts index fbcd81a..66ebbe8 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -19,6 +19,8 @@ export interface TemplateSide { } export interface ProfileTraderTemplate { initialLoyaltyLevel: number; + setQuestsAvailableForStart?: boolean; + setQuestsAvailableForFinish?: boolean; initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IQuest.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IQuest.d.ts index c5b1cb2..5c939e1 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IQuest.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IQuest.d.ts @@ -2,7 +2,7 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { - QuestName: string; + QuestName?: string; _id: string; canShowNotificationsInGame: boolean; conditions: Conditions; @@ -15,6 +15,7 @@ export interface IQuest { image: string; type: string; isKey: boolean; + questStatus: any; restartable: boolean; instantComplete: boolean; secretQuest: boolean; @@ -22,7 +23,7 @@ export interface IQuest { successMessageText: string; templateId: string; rewards: Rewards; - status: string; + status: string | number; KeyQuest: boolean; changeQuestMessageText: string; side: string; @@ -37,18 +38,21 @@ export interface Conditions { export interface AvailableForConditions { _parent: string; _props: AvailableForProps; - dynamicLocale: boolean; + dynamicLocale?: boolean; } export interface AvailableForProps { id: string; index: number; parentId: string; + isEncoded: boolean; dynamicLocale: boolean; value?: number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; status?: QuestStatus[]; + availableAfter?: number; + dispersion?: number; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IRepeatableQuests.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IRepeatableQuests.d.ts index e23ec73..3a33f2e 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IRepeatableQuests.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/IRepeatableQuests.d.ts @@ -25,7 +25,7 @@ export interface IPmcDataRepeatableQuest { endTime: number; changeRequirement: TChangeRequirementRecord; } -export declare type TChangeRequirementRecord = Record; +export type TChangeRequirementRecord = Record; export interface IChangeRequirement { changeCost: IChangeCost[]; changeStandingCost: number; @@ -47,6 +47,7 @@ export interface IRepeatableQuest { canShowNotificationsInGame: boolean; rewards: IRewards; conditions: IConditions; + side: string; name: string; note: string; description: string; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/ITemplateItem.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/ITemplateItem.d.ts index 0fa7e18..cbad0a6 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/ITemplateItem.d.ts @@ -29,8 +29,11 @@ export interface Props { IsUnsaleable?: boolean; IsUnbuyable?: boolean; IsUngivable?: boolean; + IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsSpecialSlotOnly?: boolean; QuestItem?: boolean; + QuestStashMaxCount?: number; LootExperience?: number; ExamineExperience?: number; HideEntrails?: boolean; @@ -156,11 +159,12 @@ export interface Props { RigLayoutName?: string; MaxDurability?: number; armorZone?: string[]; - armorClass?: any; + armorClass?: string | number; mousePenalty?: number; weaponErgonomicPenalty?: number; BluntThroughput?: number; ArmorMaterial?: string; + ArmorType?: string; weapClass?: string; weapUseType?: string; ammoCaliber?: string; @@ -365,6 +369,8 @@ export interface Props { CanBeHiddenDuringThrow?: boolean; MinTimeToContactExplode?: number; ExplosionEffectType?: string; + LinkedWeapon?: string; + UseAmmoWithoutShell?: boolean; } export interface IHealthEffect { type: string; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/ITrader.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/ITrader.d.ts index 37b2d61..1fcfbaa 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/common/tables/ITrader.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/common/tables/ITrader.d.ts @@ -9,6 +9,7 @@ export interface ITrader { export interface ITraderBase { refreshTraderRagfairOffers: boolean; _id: string; + availableInRaid: boolean; avatar: string; balance_dol: number; balance_eur: number; @@ -20,6 +21,8 @@ export interface ITraderBase { discount_end: number; gridHeight: number; insurance: Insurance; + items_buy: IItemBuyData; + items_buy_prohibited: IItemBuyData; location: string; loyaltyLevels: LoyaltyLevel[]; medic: boolean; @@ -31,6 +34,10 @@ export interface ITraderBase { surname: string; unlockedByDefault: boolean; } +export interface IItemBuyData { + category: string[]; + id_list: string[]; +} export interface Insurance { availability: boolean; excluded_category: string[]; @@ -54,8 +61,9 @@ export interface Repair { currency: string; currency_coefficient: number; excluded_category: string[]; + /** Doesn't exist in client object */ excluded_id_list: any[]; - quality: string; + quality: number; } export interface ITraderAssort { nextResupply: number; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/dialog/IChatServer.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/dialog/IChatServer.d.ts new file mode 100644 index 0000000..48cacc4 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/models/eft/dialog/IChatServer.d.ts @@ -0,0 +1,16 @@ +export interface IChatServer { + _id: string; + RegistrationId: number; + VersionId: string; + Ip: string; + Port: number; + DateTime: number; + Chats: IChat[]; + Regions: string[]; + /** Possibly removed */ + IsDeveloper?: boolean; +} +export interface IChat { + _id: string; + Members: number; +} diff --git a/Faupi-HideoutArchitect/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 8a29319..f8d700c 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -1,7 +1,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; - Ignore: any[]; + Ignore: string[]; InIgnoreList: string[]; } export interface Friend { diff --git a/Faupi-HideoutArchitect/server/types/models/eft/game/IGameConfigResponse.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/game/IGameConfigResponse.d.ts index eb37a39..e1b7587 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/game/IGameConfigResponse.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/game/IGameConfigResponse.d.ts @@ -7,11 +7,13 @@ export interface IGameConfigResponse { activeProfileId: string; backend: Backend; utc_time: number; + /** Total in game time */ totalInGame: number; reportAvailable: boolean; twitchEventMember: boolean; } export interface Backend { + Lobby: string; Trading: string; Messaging: string; Main: string; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/game/IGetItemPricesResponse.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/game/IGetItemPricesResponse.d.ts new file mode 100644 index 0000000..ab6e818 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/models/eft/game/IGetItemPricesResponse.d.ts @@ -0,0 +1,5 @@ +export interface IGetItemPricesResponse { + supplyNextTime: number; + prices: Record; + currencyCourses: Record; +} diff --git a/Faupi-HideoutArchitect/server/types/models/eft/health/Effect.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/health/Effect.d.ts index 7eb3ffc..62d95a8 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/health/Effect.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/health/Effect.d.ts @@ -1,5 +1,7 @@ export declare enum Effect { FRACTURE = "Fracture", LIGHT_BLEEDING = "LightBleeding", - HEAVY_BLEEDING = "HeavyBleeding" + HEAVY_BLEEDING = "HeavyBleeding", + MILD_MUSCLE_PAIN = "MildMusclePain", + SEVERE_MUSCLE_PAIN = "SevereMusclePain" } diff --git a/Faupi-HideoutArchitect/server/types/models/eft/health/IWorkoutData.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/health/IWorkoutData.d.ts new file mode 100644 index 0000000..ba629d2 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/models/eft/health/IWorkoutData.d.ts @@ -0,0 +1,4 @@ +export interface IWorkoutData extends Record { + skills: any; + effects: any; +} diff --git a/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHandleQTEEventRequestData.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHandleQTEEventRequestData.d.ts new file mode 100644 index 0000000..5dda485 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHandleQTEEventRequestData.d.ts @@ -0,0 +1,8 @@ +export interface IHandleQTEEventRequestData { + Action: string; + /** true if QTE was successful, otherwise false */ + results: boolean[]; + /** Id of the QTE object used from db/hideout/qte.json */ + id: string; + timestamp: number; +} diff --git a/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutArea.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutArea.d.ts index d9fd2bf..fa5ca20 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutArea.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutArea.d.ts @@ -3,23 +3,55 @@ export interface IHideoutArea { type: number; enabled: boolean; needsFuel: boolean; + requirements: IAreaRequirement[]; takeFromSlotLocked: boolean; craftGivesExp: boolean; + displayLevel: boolean; + enableAreaRequirements: boolean; stages: Record; } +export interface IAreaRequirement { + areaType: number; + requiredlevel: number; + type: string; +} export interface Stage { - requirements: Requirement[]; + autoUpgrade: boolean; bonuses: StageBonus[]; - slots: number; constructionTime: number; description: string; + displayInterface: boolean; + improvements: IStageImprovement[]; + requirements: IStageRequirement[]; + slots: number; } -export interface Requirement { +export interface IStageImprovement { + id: string; + bonuses: IStageImprovementBonus[]; + improvementTime: number; + requirements: IStageImprovementRequirement[]; +} +export interface IStageImprovementBonus { + passive: boolean; + production: boolean; + type: string; + value: number; + visible: boolean; +} +export interface IStageImprovementRequirement { + count: number; + isEncoded: boolean; + isFunctional: boolean; + templateId: string; + type: string; +} +export interface IStageRequirement { areaType?: number; requiredLevel?: number; type: string; templateId?: string; count?: number; + isEncoded: false; isFunctional?: boolean; traderId?: string; loyaltyLevel?: number; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutContinousProductionStartRequestData.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutContinuousProductionStartRequestData.d.ts similarity index 59% rename from KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutContinousProductionStartRequestData.d.ts rename to Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutContinuousProductionStartRequestData.d.ts index dba83eb..3ef00c6 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutContinousProductionStartRequestData.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutContinuousProductionStartRequestData.d.ts @@ -1,4 +1,4 @@ -export interface IHideoutContinousProductionStartRequestData { +export interface IHideoutContinuousProductionStartRequestData { Action: "HideoutContinuousProductionStart"; recipeId: string; timestamp: number; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts new file mode 100644 index 0000000..7e927bf --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts @@ -0,0 +1,13 @@ +export interface IHideoutImproveAreaRequestData { + Action: "HideoutImproveArea"; + /** Hideout area id from areas.json */ + id: string; + areaType: number; + items: HideoutItem[]; + timestamp: number; +} +export interface HideoutItem { + /** Hideout inventory id that was used by improvement action */ + id: string; + count: number; +} diff --git a/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutProduction.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutProduction.d.ts index ce878be..2367e08 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutProduction.d.ts @@ -3,8 +3,10 @@ export interface IHideoutProduction { areaType: number; requirements: Requirement[]; productionTime: number; - boosters: any; endProduct: string; + isEncoded: boolean; + locked: boolean; + needFuelForAllProductionTime: boolean; continuous: boolean; count: number; productionLimitCount: number; @@ -12,6 +14,7 @@ export interface IHideoutProduction { export interface Requirement { templateId?: string; count?: number; + isEncoded?: boolean; isFunctional?: boolean; type: string; areaType?: number; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/hideout/IQteData.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/hideout/IQteData.d.ts new file mode 100644 index 0000000..f842b84 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/models/eft/hideout/IQteData.d.ts @@ -0,0 +1,38 @@ +export interface IQteData { + Id: string; + Type: string; + Area: string; + AreaLevel: number; + QuickTimeEvents: IQuickTimeEvent[]; + Requirements: IQteRequirement[]; + Results: Record; +} +export interface IQuickTimeEvent { + Type: string; + Position: number; + StartDelay: number; + EndDelay: number; + Speed: number; + SuccessRange: string; + Key: string; +} +export interface IQteRequirement { + type: string; +} +export interface IQteResult { + Energy: number; + Hydration: number; + RewardsRange: IQteEffect[]; +} +export interface IQteEffect { + Type: string; + SkillId: string; + levelMultipliers: ISkillLevelMultiplier[]; + Time: number; + Weight: number; + Result: string; +} +export interface ISkillLevelMultiplier { + level: number; + multiplier: number; +} diff --git a/Faupi-HideoutArchitect/server/types/models/eft/hideout/IRecordShootingRangePoints.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/hideout/IRecordShootingRangePoints.d.ts new file mode 100644 index 0000000..5bfd2fd --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/models/eft/hideout/IRecordShootingRangePoints.d.ts @@ -0,0 +1,4 @@ +export interface IRecordShootingRangePoints { + Action: "RecordShootingRangePoints"; + points: number; +} diff --git a/Faupi-HideoutArchitect/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts index bf209c6..4579fdb 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts @@ -1 +1 @@ -export declare type IGetInsuranceCostResponseData = Record>; +export type IGetInsuranceCostResponseData = Record>; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/inventory/IAddItemRequestData.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/inventory/IAddItemRequestData.d.ts index 53db97a..61516d6 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/inventory/IAddItemRequestData.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/inventory/IAddItemRequestData.d.ts @@ -1,4 +1,9 @@ export interface IAddItemRequestData { tid: string; - items: any[]; + items: AddItem[]; +} +export interface AddItem { + count: number; + isPreset?: boolean; + item_id: string; } diff --git a/Faupi-HideoutArchitect/server/types/models/eft/inventory/IAddItemTempObject.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/inventory/IAddItemTempObject.d.ts new file mode 100644 index 0000000..62d4b64 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/models/eft/inventory/IAddItemTempObject.d.ts @@ -0,0 +1,7 @@ +import { Item, Location } from "../common/tables/IItem"; +export interface IAddItemTempObject { + itemRef: Item; + count: number; + isPreset: boolean; + location?: Location; +} diff --git a/Faupi-HideoutArchitect/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index b45e459..6d7c190 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -16,7 +16,7 @@ export interface ToLocation { export interface Container { id: string; container: string; - location: Location | number; + location?: Location | number; } export interface Location { x: number; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index 60ab284..dbf6330 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,4 +1,5 @@ -import { Skills } from "../common/tables/IBotBase"; +import { QuestStatus } from "../../../models/enums/QuestStatus"; +import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -7,7 +8,7 @@ export interface IItemEventRouterBase { warnings: Warning[]; profileChanges: TProfileChanges | ""; } -export declare type TProfileChanges = Record; +export type TProfileChanges = Record; export interface Warning { index: number; errmsg: string; @@ -21,10 +22,23 @@ export interface ProfileChange { ragFairOffers: IRagfairOffer[]; builds: BuildChange[]; items: ItemChanges; - production: Record; + production: Record; + /** Hideout area improvement id */ + improvements: Record; skills: Skills; - traderRelations: Record; + health: Health; + traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; + recipeUnlocked: Record; + questsStatus: QuestStatusChange[]; +} +export interface QuestStatusChange { + qid: string; + startTime: number; + status: QuestStatus; + statusTimers: Record; + completedConditions: string[]; + availableAfter: number; } export interface BuildChange { id: string; @@ -37,13 +51,9 @@ export interface ItemChanges { change: Product[]; del: Product[]; } -export interface Production { - Progress: number; - StartTimestamp: number; - ProductionTime: number; - inProgress: boolean; - RecipeId: string; - Products: Product[]; +export interface Improvement { + completed: boolean; + improveCompleteTimestamp: number; } export interface Product { _id: string; @@ -59,10 +69,3 @@ export interface ItemChangeLocation { r: number; isSearched?: boolean; } -export interface TraderRelations { - salesSum?: number; - standing?: number; - loyalty?: number; - unlocked?: boolean; - disabled?: boolean; -} diff --git a/Faupi-HideoutArchitect/server/types/models/eft/launcher/IRemoveProfileData.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/launcher/IRemoveProfileData.d.ts index d31c9ac..4cc5618 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/launcher/IRemoveProfileData.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/launcher/IRemoveProfileData.d.ts @@ -1,2 +1,2 @@ import { ILoginRequestData } from "./ILoginRequestData"; -export declare type IRemoveProfileData = ILoginRequestData; +export type IRemoveProfileData = ILoginRequestData; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts new file mode 100644 index 0000000..cbcc2f6 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts @@ -0,0 +1,30 @@ +export interface IGetRaidConfigurationRequestData { + timeVariant: string; + raidMode: string; + metabolismDisabled: boolean; + playersSpawnPlace: string; + timeAndWeatherSettings: TimeAndWeatherSettings; + botSettings: BotSettings; + wavesSettings: WavesSettings; + location: string; +} +export interface TimeAndWeatherSettings { + isRandomTime: boolean; + isRandomWeather: boolean; + cloudinessType: string; + rainType: string; + windType: string; + fogType: string; + timeFlowType: string; + hourOfDay: number; +} +export interface BotSettings { + isScavWars: boolean; + botAmount: string; +} +export interface WavesSettings { + botAmount: string; + botDifficulty: string; + isBosses: boolean; + isTaggedAndCursed: boolean; +} diff --git a/Faupi-HideoutArchitect/server/types/models/eft/match/IJoinMatchResult.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/match/IJoinMatchResult.d.ts index df695f4..81c9055 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/match/IJoinMatchResult.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/match/IJoinMatchResult.d.ts @@ -6,6 +6,8 @@ export interface IJoinMatchResult { port: number; version: string; location: string; - gamemode: string; + raidMode: string; + mode: string; shortid: string; + additional_info: any[]; } diff --git a/Faupi-HideoutArchitect/server/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/match/IStartOffineRaidRequestData.d.ts deleted file mode 100644 index 1983728..0000000 --- a/Faupi-HideoutArchitect/server/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { BotAmount } from "../../enums/BotAmount"; -import { BotDifficulty } from "../../enums/BotDifficulty"; -export interface IStartOfflineRaidRequestData { - locationName: string; - /** Current time, not in-game time */ - startTime: number; - /** CURR = am, past = pm */ - dateTime: "CURR" | "PAST"; - gameSettings: GameSettings; -} -export interface GameSettings { - timeAndWeatherSettings: TimeAndWeatherSettings; - botsSettings: BotsSettings; - wavesSettings: WavesSettings; -} -export interface TimeAndWeatherSettings { - isRandomTime: boolean; - isRandomWeather: boolean; -} -export interface BotsSettings { - isEnabled: boolean; - isScavWars: boolean; - botAmount: BotAmount; -} -export interface WavesSettings { - botDifficulty: BotDifficulty; - isBosses: boolean; - isTaggedAndCursed: boolean; - wavesBotAmount: BotAmount; -} diff --git a/Faupi-HideoutArchitect/server/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/profile/GetProfileStatusResponseData.d.ts index cb7368c..1228c2e 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -6,7 +6,13 @@ export interface ProfileData { profileid: string; profileToken: string; status: string; - sid: string; ip: string; port: number; + sid: string; + version?: string; + location?: string; + raidMode?: string; + mode?: string; + shortId?: string; + additional_info?: any[]; } diff --git a/Faupi-HideoutArchitect/server/types/models/eft/profile/IAkiProfile.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/profile/IAkiProfile.d.ts index cf28c12..2cea0c8 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/profile/IAkiProfile.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/profile/IAkiProfile.d.ts @@ -11,6 +11,12 @@ export interface IAkiProfile { vitality: Vitality; inraid: Inraid; insurance: Insurance[]; + /** Assort purchases made by player since last trader refresh */ + traderPurchases?: Record>; +} +export declare class TraderPurchaseData { + count: number; + purchaseTimestamp: number; } export interface Info { id: string; @@ -93,6 +99,13 @@ export interface DateTime { } export interface Aki { version: string; + mods?: ModDetails[]; +} +export interface ModDetails { + name: string; + version: string; + author: string; + dateAdded: number; } export interface Vitality { health: Health; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/quests/IFailQuestRequestData.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/quests/IFailQuestRequestData.d.ts new file mode 100644 index 0000000..5881d91 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/models/eft/quests/IFailQuestRequestData.d.ts @@ -0,0 +1,5 @@ +export interface IFailQuestRequestData { + Action: "QuestComplete"; + qid: string; + removeExcessItems: boolean; +} diff --git a/Faupi-HideoutArchitect/server/types/models/eft/ragfair/IRagfairOffer.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/ragfair/IRagfairOffer.d.ts index 792ec7d..6b28718 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/ragfair/IRagfairOffer.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/ragfair/IRagfairOffer.d.ts @@ -23,6 +23,7 @@ export interface IRagfairOffer { summaryCost: number; user: IRagfairOfferUser; notAvailable: boolean; + /** TODO - implement this value - not currently used */ CurrentItemCount: number; priority: boolean; } diff --git a/Faupi-HideoutArchitect/server/types/models/eft/trade/IProcessSellTradeRequestData.d.ts b/Faupi-HideoutArchitect/server/types/models/eft/trade/IProcessSellTradeRequestData.d.ts index f1d555f..dee0cd5 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/trade/IProcessSellTradeRequestData.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/eft/trade/IProcessSellTradeRequestData.d.ts @@ -3,6 +3,7 @@ export interface IProcessSellTradeRequestData extends IProcessBaseTradeRequestDa Action: "sell_to_trader"; type: string; tid: string; + price: number; items: Item[]; } export interface Item { diff --git a/Faupi-HideoutArchitect/server/types/models/enums/BaseClasses.d.ts b/Faupi-HideoutArchitect/server/types/models/enums/BaseClasses.d.ts index 4eb6f7e..c6e880a 100644 --- a/Faupi-HideoutArchitect/server/types/models/enums/BaseClasses.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/enums/BaseClasses.d.ts @@ -1,13 +1,17 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", + UBGL = "55818b014bdc2ddc698b456b", ARMOR = "5448e54d4bdc2dcc718b4568", ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", HEADWEAR = "5a341c4086f77401f2541505", FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", + COMPOUND = "566162e44bdc2d3f298b4573", VISORS = "5448e5724bdc2ddf718b4568", FOOD = "5448e8d04bdc2ddf718b4569", + GAS_BLOCK = "56ea9461d2720b67698b456f", + RAIL_COVER = "55818b1d4bdc2d5b648b4572", DRINK = "5448e8d64bdc2dce718b4568", BARTER_ITEM = "5448eb774bdc2d0a728b4567", INFO = "5448ecbe4bdc2d60728b4568", @@ -27,6 +31,7 @@ export declare enum BaseClasses { MUZZLE = "5448fe394bdc2d0d028b456c", SIGHTS = "5448fe7a4bdc2d6f028b456b", MEDS = "543be5664bdc2dd4348b4569", + MAP = "567849dd4bdc2d150f8b456e", MONEY = "543be5dd4bdc2deb348b4569", NIGHTVISION = "5a2c3a9486f774688b05e574", KEY = "543be5e94bdc2df1348b4568", @@ -36,6 +41,7 @@ export declare enum BaseClasses { THROW_WEAPON = "543be6564bdc2df4348b4568", FOOD_DRINK = "543be6674bdc2df1348b4569", PISTOL = "5447b5cf4bdc2d65278b4567", + REVOLVER = "617f1ef5e8b54b0998387733", SMG = "5447b5e04bdc2d62278b4567", ASSAULT_RIFLE = "5447b5f14bdc2d61278b4567", ASSAULT_CARBINE = "5447b5fc4bdc2d87278b4567", @@ -73,9 +79,10 @@ export declare enum BaseClasses { TACTICAL_COMBO = "55818b164bdc2ddc698b456c", FLASHLIGHT = "55818b084bdc2d5b648b4571", MAGAZINE = "5448bc234bdc2d3c308b4569", - LIGHT_LASER = "55818b0e4bdc2dde698b456e", + LIGHT_LASER_DESIGNATOR = "55818b0e4bdc2dde698b456e", FLASH_HIDER = "550aa4bf4bdc2dd6348b456b", COLLIMATOR = "55818ad54bdc2ddc698b4569", + IRON_SIGHT = "55818ac54bdc2d5b648b456e", COMPACT_COLLIMATOR = "55818acf4bdc2dde698b456b", COMPENSATOR = "550aa4af4bdc2dd4348b456e", OPTIC_SCOPE = "55818ae44bdc2dde698b456c", diff --git a/Faupi-HideoutArchitect/server/types/models/enums/ELocationName.d.ts b/Faupi-HideoutArchitect/server/types/models/enums/ELocationName.d.ts index 7ae7caa..c52ae87 100644 --- a/Faupi-HideoutArchitect/server/types/models/enums/ELocationName.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/enums/ELocationName.d.ts @@ -8,5 +8,6 @@ export declare enum ELocationName { LIGHTHOUSE = "Lighthouse", LABORATORY = "laboratory", RESERVE = "RezervBase", + STREETS = "TarkovStreets", ANY = "any" } diff --git a/Faupi-HideoutArchitect/server/types/models/enums/ExitStatis.d.ts b/Faupi-HideoutArchitect/server/types/models/enums/ExitStatis.d.ts new file mode 100644 index 0000000..78d9733 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/models/enums/ExitStatis.d.ts @@ -0,0 +1,7 @@ +export declare enum ExitStatus { + SURVIVED = 0, + KILLED = 1, + LEFT = 2, + RUNNER = 3, + MISSINGINACTION = 4 +} diff --git a/Faupi-HideoutArchitect/server/types/models/enums/HideoutAreas.d.ts b/Faupi-HideoutArchitect/server/types/models/enums/HideoutAreas.d.ts index b44a20a..c8313d9 100644 --- a/Faupi-HideoutArchitect/server/types/models/enums/HideoutAreas.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/enums/HideoutAreas.d.ts @@ -21,5 +21,7 @@ export declare enum HideoutAreas { SOLAR_POWER = 18, BOOZE_GENERATOR = 19, BITCOIN_FARM = 20, - CHRISTMAS_TREE = 21 + CHRISTMAS_TREE = 21, + EMERGENCY_WALL = 22, + GYM = 23 } diff --git a/Faupi-HideoutArchitect/server/types/models/enums/HideoutEventActions.d.ts b/Faupi-HideoutArchitect/server/types/models/enums/HideoutEventActions.d.ts index e441477..aa04131 100644 --- a/Faupi-HideoutArchitect/server/types/models/enums/HideoutEventActions.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/enums/HideoutEventActions.d.ts @@ -7,5 +7,7 @@ export declare enum HideoutEventActions { HIDEOUT_SINGLE_PRODUCTION_START = "HideoutSingleProductionStart", HIDEOUT_SCAV_CASE_PRODUCTION_START = "HideoutScavCaseProductionStart", HIDEOUT_CONTINUOUS_PRODUCTION_START = "HideoutContinuousProductionStart", - HIDEOUT_TAKE_PRODUCTION = "HideoutTakeProduction" + HIDEOUT_TAKE_PRODUCTION = "HideoutTakeProduction", + HIDEOUT_RECORD_SHOOTING_RANGE_POINTS = "RecordShootingRangePoints", + HIDEOUT_IMPROVE_AREA = "HideoutImproveArea" } diff --git a/Faupi-HideoutArchitect/server/types/models/enums/ItemEventActions.d.ts b/Faupi-HideoutArchitect/server/types/models/enums/ItemEventActions.d.ts index 0e65453..94061f8 100644 --- a/Faupi-HideoutArchitect/server/types/models/enums/ItemEventActions.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/enums/ItemEventActions.d.ts @@ -15,5 +15,6 @@ export declare enum ItemEventActions { CREATE_MAP_MARKER = "CreateMapMarker", DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", - OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer" + OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" } diff --git a/Faupi-HideoutArchitect/server/types/models/enums/QuestRewardType.d.ts b/Faupi-HideoutArchitect/server/types/models/enums/QuestRewardType.d.ts index 16f7e39..ff8c5f4 100644 --- a/Faupi-HideoutArchitect/server/types/models/enums/QuestRewardType.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/enums/QuestRewardType.d.ts @@ -4,5 +4,6 @@ export declare enum QuestRewardType { TRADER_STANDING = "TraderStanding", TRADER_UNLOCK = "TraderUnlock", ITEM = "Item", - ASSORTMENT_UNLOCK = "AssortmentUnlock" + ASSORTMENT_UNLOCK = "AssortmentUnlock", + PRODUCTIONS_SCHEME = "ProductionScheme" } diff --git a/Faupi-HideoutArchitect/server/types/models/enums/QuestStatus.d.ts b/Faupi-HideoutArchitect/server/types/models/enums/QuestStatus.d.ts index ba65933..e706c05 100644 --- a/Faupi-HideoutArchitect/server/types/models/enums/QuestStatus.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/enums/QuestStatus.d.ts @@ -7,5 +7,6 @@ export declare enum QuestStatus { Fail = 5, FailRestartable = 6, MarkedAsFailed = 7, - Expired = 8 + Expired = 8, + AvailableAfter = 9 } diff --git a/Faupi-HideoutArchitect/server/types/models/enums/Traders.d.ts b/Faupi-HideoutArchitect/server/types/models/enums/Traders.d.ts index 163cd71..ffea725 100644 --- a/Faupi-HideoutArchitect/server/types/models/enums/Traders.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/enums/Traders.d.ts @@ -6,5 +6,6 @@ export declare enum Traders { PEACEKEEPER = "5935c25fb3acc3127c3d8cd9", MECHANIC = "5a7c2eca46aef81a7ca2145d", RAGMAN = "5ac3b934156ae10c4430e83c", - JAEGER = "5c0647fdd443bc2504c2d371" + JAEGER = "5c0647fdd443bc2504c2d371", + LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57" } diff --git a/Faupi-HideoutArchitect/server/types/models/external/HttpFramework.d.ts b/Faupi-HideoutArchitect/server/types/models/external/HttpFramework.d.ts index 3b4a56a..64a37d6 100644 --- a/Faupi-HideoutArchitect/server/types/models/external/HttpFramework.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/external/HttpFramework.d.ts @@ -1,6 +1,6 @@ /// import { IncomingMessage, ServerResponse } from "http"; -export declare type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void; +export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void; /** * Associates handlers, HTTP methods and a base url to a listener using a proxy * @param basePath The base path diff --git a/Faupi-HideoutArchitect/server/types/models/external/IPostAkiLoadModAsync.d.ts b/Faupi-HideoutArchitect/server/types/models/external/IPostAkiLoadModAsync.d.ts new file mode 100644 index 0000000..073ce6e --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/models/external/IPostAkiLoadModAsync.d.ts @@ -0,0 +1,4 @@ +import { DependencyContainer } from "./tsyringe"; +export interface IPostAkiLoadModAsync { + postAkiLoadAsync(container: DependencyContainer): Promise; +} diff --git a/Faupi-HideoutArchitect/server/types/models/external/IPostDBLoadModAsync.d.ts b/Faupi-HideoutArchitect/server/types/models/external/IPostDBLoadModAsync.d.ts new file mode 100644 index 0000000..b23825a --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/models/external/IPostDBLoadModAsync.d.ts @@ -0,0 +1,4 @@ +import { DependencyContainer } from "./tsyringe"; +export interface IPostDBLoadModAsync { + postDBLoadAsync(container: DependencyContainer): Promise; +} diff --git a/Faupi-HideoutArchitect/server/types/models/external/IPreAkiLoadModAsync.d.ts b/Faupi-HideoutArchitect/server/types/models/external/IPreAkiLoadModAsync.d.ts new file mode 100644 index 0000000..1249ff1 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/models/external/IPreAkiLoadModAsync.d.ts @@ -0,0 +1,4 @@ +import { DependencyContainer } from "./tsyringe"; +export interface IPreAkiLoadModAsync { + preAkiLoadAsync(container: DependencyContainer): Promise; +} diff --git a/Faupi-HideoutArchitect/server/types/models/spt/bots/BotGenerationDetails.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/bots/BotGenerationDetails.d.ts index 256de03..26571a2 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/bots/BotGenerationDetails.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/bots/BotGenerationDetails.d.ts @@ -3,6 +3,8 @@ export interface BotGenerationDetails { isPmc: boolean; /** assault/pmcBot etc */ role: string; + /** Side of bot */ + side: string; /** Active players current level */ playerLevel: number; /** Delta of highest level of bot */ diff --git a/Faupi-HideoutArchitect/server/types/models/spt/bots/GenerateWeaponResult.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/bots/GenerateWeaponResult.d.ts index f099752..56fa481 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/bots/GenerateWeaponResult.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/bots/GenerateWeaponResult.d.ts @@ -3,7 +3,8 @@ import { Item } from "../../eft/common/tables/IItem"; import { ITemplateItem } from "../../eft/common/tables/ITemplateItem"; export declare class GenerateWeaponResult { weapon: Item[]; - chosenAmmo: string; + chosenAmmoTpl: string; + chosenUbglAmmoTpl: string; weaponMods: Mods; weaponTemplate: ITemplateItem; } diff --git a/Faupi-HideoutArchitect/server/types/models/spt/callbacks/IDataCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/callbacks/IDataCallbacks.d.ts index a098560..b4f4f8c 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/callbacks/IDataCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/callbacks/IDataCallbacks.d.ts @@ -6,7 +6,6 @@ import { IHideoutProduction } from "../../eft/hideout/IHideoutProduction"; import { IHideoutScavCase } from "../../eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "../../eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { ILanguageBase } from "../server/ILocaleBase"; import { ISettingsBase } from "../server/ISettingsBase"; export interface IDataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; @@ -20,7 +19,7 @@ export interface IDataCallbacks { getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string; } diff --git a/Faupi-HideoutArchitect/server/types/models/spt/callbacks/IHideoutCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/callbacks/IHideoutCallbacks.d.ts index e9badb6..ad2af48 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/callbacks/IHideoutCallbacks.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/callbacks/IHideoutCallbacks.d.ts @@ -6,7 +6,7 @@ import { IHideoutPutItemInRequestData } from "../../eft/hideout/IHideoutPutItemI import { IHideoutTakeItemOutRequestData } from "../../eft/hideout/IHideoutTakeItemOutRequestData"; import { IHideoutToggleAreaRequestData } from "../../eft/hideout/IHideoutToggleAreaRequestData"; import { IHideoutSingleProductionStartRequestData } from "../../eft/hideout/IHideoutSingleProductionStartRequestData"; -import { IHideoutContinousProductionStartRequestData } from "../../eft/hideout/IHideoutContinousProductionStartRequestData"; +import { IHideoutContinuousProductionStartRequestData } from "../../eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutTakeProductionRequestData } from "../../eft/hideout/IHideoutTakeProductionRequestData"; import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; export interface IHideoutCallbacks { @@ -17,7 +17,7 @@ export interface IHideoutCallbacks { toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse; scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse; - continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; update(timeSinceLastRun: number): boolean; } diff --git a/Faupi-HideoutArchitect/server/types/models/spt/callbacks/IMatchCallbacks.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/callbacks/IMatchCallbacks.d.ts deleted file mode 100644 index fcbf173..0000000 --- a/Faupi-HideoutArchitect/server/types/models/spt/callbacks/IMatchCallbacks.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { IStartOfflineRaidRequestData } from "../../eft/match/IStartOffineRaidRequestData"; -import { IEndOfflineRaidRequestData } from "../../eft/match/IEndOfflineRaidRequestData"; -import { INullResponseData } from "../../eft/httpResponse/INullResponseData"; -import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { IPmcData } from "../../eft/common/IPmcData"; -export interface IMatchCallbacks { - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; - exitToMenu(url: string, info: any, sessionID: string): INullResponseData; - startGroupSearch(url: string, info: any, sessionID: string): INullResponseData; - stopGroupSearch(url: string, info: any, sessionID: string): INullResponseData; - sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; - getProfile(url: string, info: any, sessionID: string): IGetBodyResponseData; - serverAvailable(url: string, info: any, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; - joinMatch(url: string, info: any, sessionID: string): IGetBodyResponseData; - getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; - getGroupStatus(url: string, info: any, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; - deleteGroup(url: string, info: any, sessionID: string): INullResponseData; - startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; - endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; -} diff --git a/Faupi-HideoutArchitect/server/types/models/spt/config/IAirdropConfig.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/config/IAirdropConfig.d.ts index 53df991..627b603 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/config/IAirdropConfig.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/config/IAirdropConfig.d.ts @@ -6,6 +6,8 @@ export interface IAirdropConfig extends IBaseConfig { planeMinFlyHeight: number; planeMaxFlyHeight: number; planeVolume: number; + planeSpeed: number; + crateFallSpeed: number; airdropMinStartTimeSeconds: number; airdropMaxStartTimeSeconds: number; loot: AirdropLoot; @@ -17,6 +19,7 @@ export interface AirdropChancePercent { shoreline: number; interchange: number; reserve: number; + tarkovStreets: number; } export interface AirdropLoot { presetCount: MinMax; diff --git a/Faupi-HideoutArchitect/server/types/models/spt/config/IBotConfig.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/config/IBotConfig.d.ts index 83897db..fcbc179 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/config/IBotConfig.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/config/IBotConfig.d.ts @@ -25,6 +25,7 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; /** Batch generation size when type not available in cache */ @@ -66,8 +67,10 @@ export interface LootNvalue { } export interface EquipmentFilters { weaponModLimits: ModLimits; + weaponSightWhitelist: Record; faceShieldIsActiveChancePercent?: number; lightLaserIsActiveChancePercent?: number; + nvgIsActiveChancePercent?: number; randomisation: RandomisationDetails[]; blacklist: EquipmentFilterDetails[]; whitelist: EquipmentFilterDetails[]; @@ -82,6 +85,7 @@ export interface ModLimits { } export interface RandomisationDetails { levelRange: MinMax; + generation?: Record; randomisedWeaponModSlots?: string[]; randomisedArmorSlots?: string[]; /** Equipment chances */ diff --git a/Faupi-HideoutArchitect/server/types/models/spt/config/IBotDurability.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/config/IBotDurability.d.ts index 38a47cc..a4ff53c 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/config/IBotDurability.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/config/IBotDurability.d.ts @@ -14,19 +14,9 @@ export interface IBotDurability { } /** Durability values to be used when a more specific bot type cant be found */ export interface DefaultDurability { - armor: DefaultArmor; + armor: ArmorDurability; weapon: WeaponDurability; } -export interface DefaultArmor { - maxDelta: number; - minDelta: number; -} -export interface WeaponDurability { - lowestMax: number; - highestMax: number; - maxDelta: number; - minDelta: number; -} export interface PmcDurability { armor: PmcDurabilityArmor; weapon: WeaponDurability; @@ -44,4 +34,12 @@ export interface BotDurability { export interface ArmorDurability { maxDelta: number; minDelta: number; + minLimitPercent: number; +} +export interface WeaponDurability { + lowestMax: number; + highestMax: number; + maxDelta: number; + minDelta: number; + minLimitPercent: number; } diff --git a/Faupi-HideoutArchitect/server/types/models/spt/config/ICoreConfig.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/config/ICoreConfig.d.ts index cfcaf61..b2819a4 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/config/ICoreConfig.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/config/ICoreConfig.d.ts @@ -4,4 +4,5 @@ export interface ICoreConfig extends IBaseConfig { akiVersion: string; projectName: string; compatibleTarkovVersion: string; + commit: string; } diff --git a/Faupi-HideoutArchitect/server/types/models/spt/config/IHideoutConfig.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/config/IHideoutConfig.d.ts index f232052..0785f1e 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/config/IHideoutConfig.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/config/IHideoutConfig.d.ts @@ -3,9 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - generatorSpeedWithoutFuel: number; - generatorFuelFlowRate: number; - airFilterUnitFlowRate: number; - /** SEE HIDEOUTHELPER BEFORE CHANGING CONFIG */ - gpuBoostRate: number; + hideoutWallAppearTimeSeconds: number; } diff --git a/Faupi-HideoutArchitect/server/types/models/spt/config/IInsuranceConfig.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/config/IInsuranceConfig.d.ts index b27e753..fd498bc 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/config/IInsuranceConfig.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/config/IInsuranceConfig.d.ts @@ -5,5 +5,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnChancePercent: Record; blacklistedEquipment: string[]; slotIdsWithChanceOfNotReturning: string[]; + returnTimeOverrideSeconds: number; runIntervalSeconds: number; } diff --git a/Faupi-HideoutArchitect/server/types/models/spt/config/ILocationConfig.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/config/ILocationConfig.d.ts index 0551d57..f808ad8 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/config/ILocationConfig.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/config/ILocationConfig.d.ts @@ -1,8 +1,21 @@ +import { BossLocationSpawn, Wave } from "../../../models/eft/common/ILocationBase"; import { IBaseConfig } from "./IBaseConfig"; export interface ILocationConfig extends IBaseConfig { kind: "aki-location"; + fixEmptyBotWaves: boolean; + fixRoguesTakingAllSpawnsOnLighthouse: boolean; + lighthouseRogueSpawnTimeSeconds: number; looseLootMultiplier: LootMultiplier; staticLootMultiplier: LootMultiplier; + customWaves: CustomWaves; + /** Open zones to add to map */ + openZones: Record; + /** Key = map id, value = item tpls that should only have one forced loot spawn position */ + forcedLootSingleSpawnById: Record; +} +export interface CustomWaves { + boss: Record; + normal: Record; } export interface LootMultiplier { bigmap: number; diff --git a/Faupi-HideoutArchitect/server/types/models/spt/config/IPlayerScavConfig.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/config/IPlayerScavConfig.d.ts index 5ac3966..3a65e83 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/config/IPlayerScavConfig.d.ts @@ -9,6 +9,7 @@ export interface KarmaLevel { modifiers: Modifiers; itemLimits: ItemLimits; equipmentBlacklist: Record; + labsAccessCardChancePercent: number; } export interface Modifiers { equipment: Record; diff --git a/Faupi-HideoutArchitect/server/types/models/spt/config/IQuestConfig.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/config/IQuestConfig.d.ts index 45c9aae..9adfaba 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/config/IQuestConfig.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/config/IQuestConfig.d.ts @@ -3,12 +3,24 @@ import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { kind: "aki-quest"; redeemTime: number; + questTemplateIds: IPlayerTypeQuestIds; repeatableQuests: IRepeatableQuestConfig[]; + locationIdMap: Record; bearOnlyQuests: string[]; usecOnlyQuests: string[]; } +export interface IPlayerTypeQuestIds { + pmc: IQuestTypeIds; + scav: IQuestTypeIds; +} +export interface IQuestTypeIds { + Elimination: string; + Completion: string; + Exploration: string; +} export interface IRepeatableQuestConfig { name: string; + side: string; types: string[]; resetTime: number; numQuests: number; @@ -16,11 +28,12 @@ export interface IRepeatableQuestConfig { rewardScaling: IRewardScaling; locations: Record; traderWhitelist: ITraderWhitelist[]; - questConfig: IQuestConfig; + questConfig: IRepeatableQuestTypesConfig; /** Item base types to block when generating rewards */ rewardBaseTypeBlacklist: string[]; /** Item tplIds to ignore when generating rewards */ rewardBlacklist: string[]; + rewardAmmoStackMinSize: number; } export interface IRewardScaling { levels: number[]; @@ -34,7 +47,7 @@ export interface ITraderWhitelist { traderId: string; questTypes: string[]; } -export interface IQuestConfig { +export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; Elimination: IElimination; diff --git a/Faupi-HideoutArchitect/server/types/models/spt/config/IRagfairConfig.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/config/IRagfairConfig.d.ts index 6786417..3fa04de 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/config/IRagfairConfig.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/config/IRagfairConfig.d.ts @@ -16,7 +16,7 @@ export interface Sell { } export interface Chance { base: number; - overprices: number; + overpriced: number; underpriced: number; } export interface Time { @@ -29,6 +29,7 @@ export interface Reputation { loss: number; } export interface Dynamic { + purchasesAreFoundInRaid: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; @@ -43,9 +44,10 @@ export interface Dynamic { rating: MinMax; currencies: Record; showAsSingleStack: string[]; + removeSeasonalItemsWhenNotInEvent: boolean; blacklist: Blacklist; } -export declare class Barter { +export interface Barter { enable: boolean; chancePercent: number; itemCountMin: number; @@ -54,7 +56,7 @@ export declare class Barter { minRoubleCostToBecomeBarter: number; itemTypeBlacklist: string[]; } -export declare class OfferAdjustment { +export interface OfferAdjustment { maxPriceDifferenceBelowHandbookPercent: number; handbookPriceMultipier: number; priceThreshholdRub: number; diff --git a/Faupi-HideoutArchitect/server/types/models/spt/config/IRepairConfig.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/config/IRepairConfig.d.ts index 23e6838..b6db332 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/config/IRepairConfig.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/config/IRepairConfig.d.ts @@ -1,7 +1,25 @@ +import { MinMax } from "../../../models/common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; export interface IRepairConfig extends IBaseConfig { kind: "aki-repair"; priceMultiplier: number; applyRandomizeDurabilityLoss: boolean; weaponSkillRepairGain: number; + armorKitSkillPointGainPerRepairPointMultiplier: number; + repairKit: RepairKit; +} +export interface RepairKit { + armor: BonusSettings; + weapon: BonusSettings; +} +export interface BonusSettings { + rarityWeight: Record; + bonusTypeWeight: Record; + common: Record; + rare: Record; +} +export interface BonusValues { + valuesMinMax: MinMax; + /** What dura is buff active between (min max of current max) */ + activeDurabilityPercentMinMax: MinMax; } diff --git a/Faupi-HideoutArchitect/server/types/models/spt/config/ISeasonalEventConfig.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/config/ISeasonalEventConfig.d.ts index e410925..cedf9a9 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/config/ISeasonalEventConfig.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/config/ISeasonalEventConfig.d.ts @@ -5,6 +5,7 @@ export interface ISeasonalEventConfig extends IBaseConfig { /** event / botType / equipSlot / itemid */ eventGear: Record>>>; events: ISeasonalEvent[]; + gifterSettings: GifterSetting[]; } export interface ISeasonalEvent { name: string; @@ -13,3 +14,8 @@ export interface ISeasonalEvent { endDay: number; endMonth: number; } +export interface GifterSetting { + map: string; + zones: string; + spawnChance: number; +} diff --git a/Faupi-HideoutArchitect/server/types/models/spt/config/ITraderConfig.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/config/ITraderConfig.d.ts index 8342c99..56c7d35 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/config/ITraderConfig.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/config/ITraderConfig.d.ts @@ -1,10 +1,13 @@ +import { MinMax } from "../../../models/common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; + /** What % of max durability an item needs to sell to a trader*/ + durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; - minDurabilityForSale: number; + persistPurchaseDataInProfile: boolean; fence: FenceConfig; } export interface UpdateTime { @@ -12,13 +15,21 @@ export interface UpdateTime { seconds: number; } export interface FenceConfig { + discountOptions: DiscountOptions; partialRefreshTimeSeconds: number; partialRefreshChangePercent: number; assortSize: number; maxPresetsPercent: number; - presetPriceMult: number; itemPriceMult: number; - regenerateAssortsOnRefresh: boolean; + presetPriceMult: number; + armorMaxDurabilityPercentMinMax: MinMax; + presetMaxDurabilityPercentMinMax: MinMax; itemTypeLimits: Record; + regenerateAssortsOnRefresh: boolean; blacklist: string[]; } +export interface DiscountOptions { + assortSize: number; + itemPriceMult: number; + presetPriceMult: number; +} diff --git a/Faupi-HideoutArchitect/server/types/models/spt/mod/IMod.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/mod/IMod.d.ts deleted file mode 100644 index e6eec79..0000000 --- a/Faupi-HideoutArchitect/server/types/models/spt/mod/IMod.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export declare namespace ModLoader { - interface IMod { - name: string; - version: string; - main?: string; - author?: string; - license: string; - dependencies?: Record; - } -} diff --git a/Faupi-HideoutArchitect/server/types/models/spt/mod/IModLoader.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/mod/IModLoader.d.ts index 40a5e19..9a71f61 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/mod/IModLoader.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/mod/IModLoader.d.ts @@ -1,7 +1,5 @@ import { DependencyContainer } from "tsyringe"; export interface IModLoader { load(container: DependencyContainer): void; - getBundles(local: boolean): string; - getBundle(key: string, local: boolean): void; getModPath(mod: string): string; } diff --git a/Faupi-HideoutArchitect/server/types/models/spt/mod/IPackageJsonData.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/mod/IPackageJsonData.d.ts index 99e4ef9..06f7454 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/mod/IPackageJsonData.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/mod/IPackageJsonData.d.ts @@ -1,6 +1,6 @@ export interface IPackageJsonData { incompatibilities?: string[]; - dependencies?: string[]; + dependencies?: Record; modDependencies?: Record; name: string; author: string; @@ -8,5 +8,6 @@ export interface IPackageJsonData { akiVersion: string; licence: string; main: string; + isBundleMod: boolean; contributors: string[]; } diff --git a/Faupi-HideoutArchitect/server/types/models/spt/server/IDatabaseTables.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/server/IDatabaseTables.d.ts index 9978459..582d9e2 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/server/IDatabaseTables.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/server/IDatabaseTables.d.ts @@ -1,3 +1,4 @@ +import { IQteData } from "../../../models/eft/hideout/IQteData"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -30,6 +31,7 @@ export interface IDatabaseTables { production: IHideoutProduction[]; scavcase: IHideoutScavCase[]; settings: IHideoutSettingsBase; + qte: IQteData[]; }; locales?: ILocaleBase; locations?: ILocations; @@ -38,10 +40,8 @@ export interface IDatabaseTables { templates?: { character: string[]; items: Record; - quests: IQuest[]; + quests: Record; repeatableQuests: IRepeatableQuestDatabase; - /** DEPRECATED - Items file found in the client, massivly out of date compared to templates.items, try not to use this, remove ASAP*/ - clientItems: Record; handbook: IHandbookBase; customization: Record; /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ diff --git a/Faupi-HideoutArchitect/server/types/models/spt/server/ILocaleBase.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/server/ILocaleBase.d.ts index 6e20b89..3cdaf6f 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/server/ILocaleBase.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/server/ILocaleBase.d.ts @@ -1,49 +1,5 @@ export interface ILocaleBase { - global: Record; + global: Record>; menu: Record; - languages: ILanguageBase[]; -} -export interface ILocaleGlobalBase { - interface: Record; - enum: any[]; - mail: Record; - quest: Record; - preset: Record; - handbook: Record; - season: Record; - customization: Record; - repeatableQuest: Record; - templates: Record; - locations: Record; - banners: Record; - trading: Record; -} -export interface ILocaleQuest { - name: string; - description: string; - note: string; - failMessageText: string; - startedMessageText: string; - successMessageText: string; - conditions: Record; - location: string; -} -export interface ILocalePreset { - Name: string; -} -export interface ILocaleProps { - Name: string; - ShortName: string; - Description: string; -} -export interface ILocaleTradingProps { - FullName: string; - FirstName: string; - Nickname: string; - Location: string; - Description: string; -} -export interface ILanguageBase { - ShortName: string; - Name: string; + languages: Record; } diff --git a/Faupi-HideoutArchitect/server/types/models/spt/server/ISettingsBase.d.ts b/Faupi-HideoutArchitect/server/types/models/spt/server/ISettingsBase.d.ts index c067cda..2870cfb 100644 --- a/Faupi-HideoutArchitect/server/types/models/spt/server/ISettingsBase.d.ts +++ b/Faupi-HideoutArchitect/server/types/models/spt/server/ISettingsBase.d.ts @@ -10,7 +10,9 @@ export interface Config { FirstCycleDelaySeconds: number; FramerateLimit: FramerateLimit; GroupStatusInterval: number; + GroupStatusButtonInterval: number; KeepAliveInterval: number; + LobbyKeepAliveInterval: number; Mark502and504AsNonImportant: boolean; MemoryManagementSettings: MemoryManagementSettings; NVidiaHighlights: boolean; @@ -18,7 +20,10 @@ export interface Config { PingServerResultSendInterval: number; PingServersInterval: number; ReleaseProfiler: ReleaseProfiler; + RequestConfirmationTimeouts: number[]; + RequestsMadeThroughLobby: string[]; SecondCycleDelaySeconds: number; + ShouldEstablishLobbyConnection: boolean; TurnOffLogging: boolean; WeaponOverlapDistanceCulling: number; WebDiagnosticsEnabled: boolean; diff --git a/Faupi-HideoutArchitect/server/types/routers/EventOutputHolder.d.ts b/Faupi-HideoutArchitect/server/types/routers/EventOutputHolder.d.ts index 7a2387b..9a34219 100644 --- a/Faupi-HideoutArchitect/server/types/routers/EventOutputHolder.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/EventOutputHolder.d.ts @@ -1,11 +1,41 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IPmcData } from "../models/eft/common/IPmcData"; +import { IHideoutImprovement, Productive } from "../models/eft/common/tables/IBotBase"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { JsonUtil } from "../utils/JsonUtil"; +import { TimeUtil } from "../utils/TimeUtil"; export declare class EventOutputHolder { protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; - constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected timeUtil: TimeUtil; + /** What has client been informed of this game session */ + protected clientActiveSessionStorage: Record; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper, timeUtil: TimeUtil); protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; + /** + * Reset the response object to a default state + * Occurs prior to event being handled by server + * @param sessionID Players id + */ resetOutput(sessionID: string): void; + /** + * Update output object with most recent values from player profile + * @param sessionId Session id + */ + updateOutputProperties(sessionId: string): void; + /** + * Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true + * @param pmcData Player profile + * @returns dictionary of hideout improvements + */ + protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; + /** + * Return productions from player profile except those completed crafts the client has already seen + * @param pmcData Player profile + * @returns dictionary of hideout productions + */ + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; } diff --git a/Faupi-HideoutArchitect/server/types/routers/ItemEventRouter.d.ts b/Faupi-HideoutArchitect/server/types/routers/ItemEventRouter.d.ts index e80d16c..9c7f70e 100644 --- a/Faupi-HideoutArchitect/server/types/routers/ItemEventRouter.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/ItemEventRouter.d.ts @@ -1,14 +1,22 @@ -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 { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; +import { LocalisationService } from "../services/LocalisationService"; import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; - constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], localisationService: LocalisationService, eventOutputHolder: EventOutputHolder); + /** + * + * @param info Event request + * @param sessionID Session id + * @returns Item response + */ handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; } diff --git a/Faupi-HideoutArchitect/server/types/routers/item_events/CustomizationItemEventRouter.d.ts b/Faupi-HideoutArchitect/server/types/routers/item_events/CustomizationItemEventRouter.d.ts index e78445e..32519b1 100644 --- a/Faupi-HideoutArchitect/server/types/routers/item_events/CustomizationItemEventRouter.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/item_events/CustomizationItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { CustomizationCallbacks } from "../../callbacks/CustomizationCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class CustomizationItemEventRouter extends ItemEventRouterDefinition { protected customizationCallbacks: CustomizationCallbacks; constructor(customizationCallbacks: CustomizationCallbacks); diff --git a/Faupi-HideoutArchitect/server/types/routers/item_events/HealthItemEventRouter.d.ts b/Faupi-HideoutArchitect/server/types/routers/item_events/HealthItemEventRouter.d.ts index 99847c6..2b2b91d 100644 --- a/Faupi-HideoutArchitect/server/types/routers/item_events/HealthItemEventRouter.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/item_events/HealthItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { HealthCallbacks } from "../../callbacks/HealthCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class HealthItemEventRouter extends ItemEventRouterDefinition { protected healthCallbacks: HealthCallbacks; constructor(healthCallbacks: HealthCallbacks); diff --git a/Faupi-HideoutArchitect/server/types/routers/item_events/InsuranceItemEventRouter.d.ts b/Faupi-HideoutArchitect/server/types/routers/item_events/InsuranceItemEventRouter.d.ts index a922cc0..3b6ae8c 100644 --- a/Faupi-HideoutArchitect/server/types/routers/item_events/InsuranceItemEventRouter.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/item_events/InsuranceItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { InsuranceCallbacks } from "../../callbacks/InsuranceCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class InsuranceItemEventRouter extends ItemEventRouterDefinition { protected insuranceCallbacks: InsuranceCallbacks; constructor(insuranceCallbacks: InsuranceCallbacks); diff --git a/Faupi-HideoutArchitect/server/types/routers/item_events/InventoryItemEventRouter.d.ts b/Faupi-HideoutArchitect/server/types/routers/item_events/InventoryItemEventRouter.d.ts index 953d322..d6a6ae5 100644 --- a/Faupi-HideoutArchitect/server/types/routers/item_events/InventoryItemEventRouter.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/item_events/InventoryItemEventRouter.d.ts @@ -1,10 +1,12 @@ +import { HideoutCallbacks } from "../../callbacks/HideoutCallbacks"; import { InventoryCallbacks } from "../../callbacks/InventoryCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; import { IPmcData } from "../../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryItemEventRouter extends ItemEventRouterDefinition { protected inventoryCallbacks: InventoryCallbacks; - constructor(inventoryCallbacks: InventoryCallbacks); + protected hideoutCallbacks: HideoutCallbacks; + constructor(inventoryCallbacks: InventoryCallbacks, hideoutCallbacks: HideoutCallbacks); getHandledRoutes(): HandledRoute[]; handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse; } diff --git a/Faupi-HideoutArchitect/server/types/routers/item_events/NoteItemEventRouter.d.ts b/Faupi-HideoutArchitect/server/types/routers/item_events/NoteItemEventRouter.d.ts index 59bf598..71ed5d4 100644 --- a/Faupi-HideoutArchitect/server/types/routers/item_events/NoteItemEventRouter.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/item_events/NoteItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { NoteCallbacks } from "../../callbacks/NoteCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class NoteItemEventRouter extends ItemEventRouterDefinition { protected noteCallbacks: NoteCallbacks; constructor(noteCallbacks: NoteCallbacks); diff --git a/Faupi-HideoutArchitect/server/types/routers/item_events/PresetBuildItemEventRouter.d.ts b/Faupi-HideoutArchitect/server/types/routers/item_events/PresetBuildItemEventRouter.d.ts index 277db44..f2a7bf3 100644 --- a/Faupi-HideoutArchitect/server/types/routers/item_events/PresetBuildItemEventRouter.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/item_events/PresetBuildItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { PresetBuildCallbacks } from "../../callbacks/PresetBuildCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class PresetBuildItemEventRouter extends ItemEventRouterDefinition { protected presetBuildCallbacks: PresetBuildCallbacks; constructor(presetBuildCallbacks: PresetBuildCallbacks); diff --git a/Faupi-HideoutArchitect/server/types/routers/item_events/RagfairItemEventRouter.d.ts b/Faupi-HideoutArchitect/server/types/routers/item_events/RagfairItemEventRouter.d.ts index 9216cc5..986d9e7 100644 --- a/Faupi-HideoutArchitect/server/types/routers/item_events/RagfairItemEventRouter.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/item_events/RagfairItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { RagfairCallbacks } from "../../callbacks/RagfairCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class RagfairItemEventRouter extends ItemEventRouterDefinition { protected ragfairCallbacks: RagfairCallbacks; constructor(ragfairCallbacks: RagfairCallbacks); diff --git a/Faupi-HideoutArchitect/server/types/routers/item_events/RepairItemEventRouter.d.ts b/Faupi-HideoutArchitect/server/types/routers/item_events/RepairItemEventRouter.d.ts index 5196ba9..1c2768c 100644 --- a/Faupi-HideoutArchitect/server/types/routers/item_events/RepairItemEventRouter.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/item_events/RepairItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { RepairCallbacks } from "../../callbacks/RepairCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class RepairItemEventRouter extends ItemEventRouterDefinition { protected repairCallbacks: RepairCallbacks; constructor(repairCallbacks: RepairCallbacks); diff --git a/Faupi-HideoutArchitect/server/types/routers/item_events/TradeItemEventRouter.d.ts b/Faupi-HideoutArchitect/server/types/routers/item_events/TradeItemEventRouter.d.ts index a43bb0a..5d84559 100644 --- a/Faupi-HideoutArchitect/server/types/routers/item_events/TradeItemEventRouter.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/item_events/TradeItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { TradeCallbacks } from "../../callbacks/TradeCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class TradeItemEventRouter extends ItemEventRouterDefinition { protected tradeCallbacks: TradeCallbacks; constructor(tradeCallbacks: TradeCallbacks); diff --git a/Faupi-HideoutArchitect/server/types/routers/item_events/WishlistItemEventRouter.d.ts b/Faupi-HideoutArchitect/server/types/routers/item_events/WishlistItemEventRouter.d.ts index 38497fb..9e3c2a0 100644 --- a/Faupi-HideoutArchitect/server/types/routers/item_events/WishlistItemEventRouter.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/item_events/WishlistItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { WishlistCallbacks } from "../../callbacks/WishlistCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistItemEventRouter extends ItemEventRouterDefinition { protected wishlistCallbacks: WishlistCallbacks; constructor(wishlistCallbacks: WishlistCallbacks); diff --git a/Faupi-HideoutArchitect/server/types/routers/save_load/HealthSaveLoadRouter.d.ts b/Faupi-HideoutArchitect/server/types/routers/save_load/HealthSaveLoadRouter.d.ts index 114f5b2..26cb07a 100644 --- a/Faupi-HideoutArchitect/server/types/routers/save_load/HealthSaveLoadRouter.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/save_load/HealthSaveLoadRouter.d.ts @@ -1,5 +1,5 @@ -import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; import { HandledRoute, SaveLoadRouter } from "../../di/Router"; +import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; export declare class HealthSaveLoadRouter extends SaveLoadRouter { constructor(); getHandledRoutes(): HandledRoute[]; diff --git a/Faupi-HideoutArchitect/server/types/routers/save_load/InraidSaveLoadRouter.d.ts b/Faupi-HideoutArchitect/server/types/routers/save_load/InraidSaveLoadRouter.d.ts index 4c00b40..40f388e 100644 --- a/Faupi-HideoutArchitect/server/types/routers/save_load/InraidSaveLoadRouter.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/save_load/InraidSaveLoadRouter.d.ts @@ -1,5 +1,5 @@ -import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; import { HandledRoute, SaveLoadRouter } from "../../di/Router"; +import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; export declare class InraidSaveLoadRouter extends SaveLoadRouter { constructor(); getHandledRoutes(): HandledRoute[]; diff --git a/Faupi-HideoutArchitect/server/types/routers/save_load/InsuranceSaveLoadRouter.d.ts b/Faupi-HideoutArchitect/server/types/routers/save_load/InsuranceSaveLoadRouter.d.ts index 30ce98e..22d645e 100644 --- a/Faupi-HideoutArchitect/server/types/routers/save_load/InsuranceSaveLoadRouter.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/save_load/InsuranceSaveLoadRouter.d.ts @@ -1,5 +1,5 @@ -import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; import { HandledRoute, SaveLoadRouter } from "../../di/Router"; +import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; export declare class InsuranceSaveLoadRouter extends SaveLoadRouter { constructor(); getHandledRoutes(): HandledRoute[]; diff --git a/Faupi-HideoutArchitect/server/types/routers/save_load/ProfileSaveLoadRouter.d.ts b/Faupi-HideoutArchitect/server/types/routers/save_load/ProfileSaveLoadRouter.d.ts index 16c7619..f60af15 100644 --- a/Faupi-HideoutArchitect/server/types/routers/save_load/ProfileSaveLoadRouter.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/save_load/ProfileSaveLoadRouter.d.ts @@ -1,5 +1,5 @@ -import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; import { HandledRoute, SaveLoadRouter } from "../../di/Router"; +import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; export declare class ProfileSaveLoadRouter extends SaveLoadRouter { constructor(); getHandledRoutes(): HandledRoute[]; diff --git a/Faupi-HideoutArchitect/server/types/routers/serializers/ImageSerializer.d.ts b/Faupi-HideoutArchitect/server/types/routers/serializers/ImageSerializer.d.ts index 7f15bcf..5de48ff 100644 --- a/Faupi-HideoutArchitect/server/types/routers/serializers/ImageSerializer.d.ts +++ b/Faupi-HideoutArchitect/server/types/routers/serializers/ImageSerializer.d.ts @@ -1,7 +1,7 @@ /// +import { IncomingMessage, ServerResponse } from "http"; import { Serializer } from "../../di/Serializer"; import { ImageRouter } from "../ImageRouter"; -import { IncomingMessage, ServerResponse } from "http"; export declare class ImageSerializer extends Serializer { protected imageRouter: ImageRouter; constructor(imageRouter: ImageRouter); diff --git a/Faupi-HideoutArchitect/server/types/servers/RagfairServer.d.ts b/Faupi-HideoutArchitect/server/types/servers/RagfairServer.d.ts index c93864b..f49654a 100644 --- a/Faupi-HideoutArchitect/server/types/servers/RagfairServer.d.ts +++ b/Faupi-HideoutArchitect/server/types/servers/RagfairServer.d.ts @@ -4,6 +4,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { LocalisationService } from "../services/LocalisationService"; import { RagfairCategoriesService } from "../services/RagfairCategoriesService"; import { RagfairOfferService } from "../services/RagfairOfferService"; import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService"; @@ -14,13 +15,14 @@ export declare class RagfairServer { protected ragfairOfferService: RagfairOfferService; protected ragfairCategoriesService: RagfairCategoriesService; protected ragfairRequiredItemsService: RagfairRequiredItemsService; + protected localisationService: LocalisationService; protected traderHelper: TraderHelper; protected traderAssortHelper: TraderAssortHelper; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, traderHelper: TraderHelper, traderAssortHelper: TraderAssortHelper, configServer: ConfigServer); - load(): void; - update(): void; + constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, localisationService: LocalisationService, traderHelper: TraderHelper, traderAssortHelper: TraderAssortHelper, configServer: ConfigServer); + load(): Promise; + update(): Promise; /** * Get traders who need to be periodically refreshed * @returns string array of traders diff --git a/Faupi-HideoutArchitect/server/types/servers/SaveServer.d.ts b/Faupi-HideoutArchitect/server/types/servers/SaveServer.d.ts index 4dca514..402befc 100644 --- a/Faupi-HideoutArchitect/server/types/servers/SaveServer.d.ts +++ b/Faupi-HideoutArchitect/server/types/servers/SaveServer.d.ts @@ -14,17 +14,71 @@ export declare class SaveServer { protected logger: ILogger; protected profileFilepath: string; protected profiles: {}; - protected onSave: {}; + protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + /** + * Add callback to occur prior to saving profile changes + * @param id Id for save callback + * @param callback Callback to execute prior to running SaveServer.saveProfile() + */ + addBeforeSaveCallback(id: string, callback: (profile: Partial) => Partial): void; + /** + * Remove a callback from being executed prior to saving profile in SaveServer.saveProfile() + * @param id Id of callback to remove + */ + removeBeforeSaveCallback(id: string): void; + /** + * Load all profiles in /user/profiles folder into memory (this.profiles) + */ load(): void; + /** + * Save changes for each profile from memory into user/profiles json + */ save(): void; + /** + * Get a player profile from memory + * @param sessionId Session id + * @returns IAkiProfile + */ getProfile(sessionId: string): IAkiProfile; + /** + * Get all profiles from memory + * @returns Dictionary of IAkiProfile + */ getProfiles(): Record; + /** + * Delete a profile by id + * @param sessionID Id of profile to remove + * @returns true when deleted, false when profile not found + */ deleteProfileById(sessionID: string): boolean; + /** + * Create a new profile in memory with empty pmc/scav objects + * @param profileInfo Basic profile data + */ createProfile(profileInfo: Info): void; + /** + * Add full profile in memory by key (info.id) + * @param profileDetails Profile to save + */ addProfile(profileDetails: IAkiProfile): void; + /** + * Look up profile json in user/profiles by id and store in memory + * Execute saveLoadRouters callbacks after being loaded into memory + * @param sessionID Id of profile to store in memory + */ loadProfile(sessionID: string): void; + /** + * Save changes from in-memory profile to user/profiles json + * Execute onBeforeSaveCallbacks callbacks prior to being saved to json + * @param sessionID profile id (user/profiles/id.json) + */ saveProfile(sessionID: string): void; + /** + * Remove a physical profile json from user/profiles + * @param sessionID Profile id to remove + * @returns true if file no longer exists + */ removeProfile(sessionID: string): boolean; } diff --git a/Faupi-HideoutArchitect/server/types/servers/http/AkiHttpListener.d.ts b/Faupi-HideoutArchitect/server/types/servers/http/AkiHttpListener.d.ts index acf92aa..d02861e 100644 --- a/Faupi-HideoutArchitect/server/types/servers/http/AkiHttpListener.d.ts +++ b/Faupi-HideoutArchitect/server/types/servers/http/AkiHttpListener.d.ts @@ -13,16 +13,18 @@ export declare class AkiHttpListener implements IHttpListener { protected httpRouter: HttpRouter; protected serializers: Serializer[]; protected logger: ILogger; + protected requestsLogger: ILogger; protected jsonUtil: JsonUtil; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; protected httpBufferHandler: HttpBufferHandler; constructor(httpRouter: HttpRouter, // TODO: delay required - serializers: Serializer[], logger: ILogger, jsonUtil: JsonUtil, httpResponse: HttpResponseUtil, localisationService: LocalisationService, httpBufferHandler: HttpBufferHandler); + serializers: Serializer[], logger: ILogger, requestsLogger: ILogger, jsonUtil: JsonUtil, httpResponse: HttpResponseUtil, localisationService: LocalisationService, httpBufferHandler: HttpBufferHandler); canHandle(_: string, req: IncomingMessage): boolean; handle(sessionId: string, req: IncomingMessage, resp: ServerResponse): void; sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void; getResponse(sessionID: string, req: IncomingMessage, body: Buffer): string; - protected getBodyInfo(body: Buffer): string; - sendZlibJson(resp: ServerResponse, output: any, sessionID: string): void; + protected getBodyInfo(body: Buffer): any; + sendJson(resp: ServerResponse, output: string, sessionID: string): void; + sendZlibJson(resp: ServerResponse, output: string, sessionID: string): void; } diff --git a/Faupi-HideoutArchitect/server/types/services/BotEquipmentFilterService.d.ts b/Faupi-HideoutArchitect/server/types/services/BotEquipmentFilterService.d.ts index 43e64b0..089cfb5 100644 --- a/Faupi-HideoutArchitect/server/types/services/BotEquipmentFilterService.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,6 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; +import { MinMax } from "../models/common/MinMax"; +import { EquipmentChances, Generation, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -24,6 +25,24 @@ export declare class BotEquipmentFilterService { * @param baseValues Values to update */ protected adjustChances(equipmentChanges: Record, baseValues: EquipmentChances | ModsChances): void; + /** + * Iterate over the Generation changes and alter data in baseValues.Generation + * @param generationChanges Changes to apply + * @param baseBotGeneration dictionary to update + */ + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + /** + * Get equipment settings for bot + * @param botEquipmentRole equipment role to return + * @returns EquipmentFilters object + */ + getBotEquipmentSettings(botEquipmentRole: string): EquipmentFilters; + /** + * Get weapon sight whitelist for a specific bot type + * @param botEquipmentRole equipment role of bot to look up + * @returns Dictionary of weapon type and their whitelisted scope types + */ + getBotWeaponSightWhitelist(botEquipmentRole: string): Record; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for @@ -39,14 +58,14 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retreive clothing weighting adjustments from bot.json config + * Retrieve clothing weighting adjustments from bot.json config * @param botRole Bot type to get adjustments for * @param playerLevel level of player * @returns Weighting adjustments for bots clothing */ protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; /** - * Retreive item weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config * @param botRole Bot type to get adjustments for * @param playerLevel level of player * @returns Weighting adjustments for bot items @@ -54,7 +73,7 @@ export declare class BotEquipmentFilterService { protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json - * Prioritises whitelist first, if one is found blacklist is ignored + * Prioritizes whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update * @param blacklist equipment blacklist * @returns Filtered bot file @@ -62,10 +81,10 @@ export declare class BotEquipmentFilterService { protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** * Filter bot cartridges based on blacklist and whitelist from config/bot.json - * Prioritises whitelist first, if one is found blacklist is ignored + * Prioritizes whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update * @param blacklist equipment on this list should be excluded from the bot - * @param whitelist equipment on this list should be used exclusivly + * @param whitelist equipment on this list should be used exclusively * @returns Filtered bot file */ protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; diff --git a/Faupi-HideoutArchitect/server/types/services/BotEquipmentModPoolService.d.ts b/Faupi-HideoutArchitect/server/types/services/BotEquipmentModPoolService.d.ts new file mode 100644 index 0000000..adf59ff --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/services/BotEquipmentModPoolService.d.ts @@ -0,0 +1,65 @@ +import { ItemHelper } from "../helpers/ItemHelper"; +import { Mods } from "../models/eft/common/tables/IBotType"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { VFS } from "../utils/VFS"; +/** Store a mapping between weapons, their slots and the items that fit those slots */ +export declare class BotEquipmentModPoolService { + protected logger: ILogger; + protected vfs: VFS; + protected itemHelper: ItemHelper; + protected databaseServer: DatabaseServer; + protected configServer: ConfigServer; + protected botConfig: IBotConfig; + protected weaponModPool: Mods; + protected gearModPool: Mods; + protected weaponPoolGenerated: boolean; + protected armorPoolGenerated: boolean; + constructor(logger: ILogger, vfs: VFS, itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer); + /** + * Store dictionary of mods for each item passed in + * @param items items to find related mods and store in modPool + */ + protected generatePool(items: ITemplateItem[], poolType: string): void; + /** + * Empty the mod pool + */ + resetPool(): void; + /** + * Get array of compatible mods for an items mod slot (generate pool if it doesnt exist already) + * @param itemTpl item to look up + * @param slotName slot to get compatible mods for + * @returns tpls that fit the slot + */ + getCompatibleModsForWeaponSlot(itemTpl: string, slotName: string): string[]; + /** + * Get array of compatible mods for an items mod slot (generate pool if it doesnt exist already) + * @param itemTpl item to look up + * @param slotName slot to get compatible mods for + * @returns tpls that fit the slot + */ + getCompatibleModsFoGearSlot(itemTpl: string, slotName: string): string[]; + /** + * Get mods for a piece of gear by its tpl + * @param itemTpl items tpl to look up mods for + * @returns Dictionary of mods (keys are mod slot names) with array of compatible mod tpls as value + */ + getModsForGearSlot(itemTpl: string): Record; + /** + * Get mods for a weapon by its tpl + * @param itemTpl Weapons tpl to look up mods for + * @returns Dictionary of mods (keys are mod slot names) with array of compatible mod tpls as value + */ + getModsForWeaponSlot(itemTpl: string): Record; + /** + * Create weapon mod pool and set generated flag to true + */ + protected generateWeaponPool(): void; + /** + * Create gear mod pool and set generated flag to true + */ + protected generateGearPool(): void; +} diff --git a/Faupi-HideoutArchitect/server/types/services/BotGenerationCacheService.d.ts b/Faupi-HideoutArchitect/server/types/services/BotGenerationCacheService.d.ts index 0be0576..a491b03 100644 --- a/Faupi-HideoutArchitect/server/types/services/BotGenerationCacheService.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/BotGenerationCacheService.d.ts @@ -3,32 +3,34 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { ILogger } from "../models/spt/utils/ILogger"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { LocalisationService } from "./LocalisationService"; export declare class BotGenerationCacheService { protected logger: ILogger; protected randomUtil: RandomUtil; protected jsonUtil: JsonUtil; + protected localisationService: LocalisationService; protected botHelper: BotHelper; protected storedBots: Map; - constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, botHelper: BotHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, localisationService: LocalisationService, botHelper: BotHelper); /** * Store array of bots in cache, shuffle results before storage * @param botsToStore Bots we want to store in the cache */ - storeBots(botsToStore: IBotBase[]): void; + storeBots(key: string, botsToStore: IBotBase[]): void; /** * Find and return a bot based on its role * Remove bot from internal array so it can't be retreived again - * @param role role to retreive (assault/bossTagilla etc) + * @param key role to retreive (assault/bossTagilla etc) * @returns IBotBase object */ - getBot(role: string): IBotBase; + getBot(key: string): IBotBase; /** * Remove all cached bot profiles */ clearStoredBots(): void; /** - * Does cache have bots - * @returns true if empty + * Does cache have a bot with requested key + * @returns false if empty */ - cacheHasBotOfRole(role: string): boolean; + cacheHasBotOfRole(key: string): boolean; } diff --git a/Faupi-HideoutArchitect/server/types/services/BotLootCacheService.d.ts b/Faupi-HideoutArchitect/server/types/services/BotLootCacheService.d.ts index 00ffb9c..dab7c6d 100644 --- a/Faupi-HideoutArchitect/server/types/services/BotLootCacheService.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/BotLootCacheService.d.ts @@ -5,15 +5,17 @@ import { BotLootCache, LootCacheType } from "../models/spt/bots/BotLootCache"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { JsonUtil } from "../utils/JsonUtil"; +import { LocalisationService } from "./LocalisationService"; import { RagfairPriceService } from "./RagfairPriceService"; export declare class BotLootCacheService { protected logger: ILogger; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected pmcLootGenerator: PMCLootGenerator; + protected localisationService: LocalisationService; protected ragfairPriceService: RagfairPriceService; protected lootCache: Record; - constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, ragfairPriceService: RagfairPriceService); + constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService); /** * Remove all cached bot loot data */ diff --git a/Faupi-HideoutArchitect/server/types/services/BotWeaponModLimitService.d.ts b/Faupi-HideoutArchitect/server/types/services/BotWeaponModLimitService.d.ts new file mode 100644 index 0000000..f8ebc2f --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/services/BotWeaponModLimitService.d.ts @@ -0,0 +1,54 @@ +import { ItemHelper } from "../helpers/ItemHelper"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +export declare class BotModLimits { + scope: ItemCount; + scopeMax: number; + scopeBaseTypes: string[]; + flashlightLaser: ItemCount; + flashlightLaserMax: number; + flashlgihtLaserBaseTypes: string[]; +} +export declare class ItemCount { + count: number; +} +export declare class BotWeaponModLimitService { + protected logger: ILogger; + protected configServer: ConfigServer; + protected itemHelper: ItemHelper; + protected botConfig: IBotConfig; + constructor(logger: ILogger, configServer: ConfigServer, itemHelper: ItemHelper); + /** + * Initalise mod limits to be used when generating a weapon + * @param botRole "assault", "bossTagilla" or "pmc" + * @returns BotModLimits object + */ + getWeaponModLimits(botRole: string): BotModLimits; + /** + * Check if weapon mod item is on limited list + has surpassed the limit set for it + * Exception: Always allow ncstar backup mount + * Exception: Always allow scopes with a scope for a parent + * Exception: Always disallow mounts that hold only scopes once scope limit reached + * Exception: Always disallow mounts that hold only flashlights once flashlight limit reached + * @param botRole role the bot has e.g. assault + * @param modTemplate mods template data + * @param modLimits limits set for weapon being generated for this bot + * @param modsParent The parent of the mod to be checked + * @returns true if over item limit + */ + weaponModHasReachedLimit(botRole: string, modTemplate: ITemplateItem, modLimits: BotModLimits, modsParent: ITemplateItem, weapon: Item[]): boolean; + /** + * Check if the specific item type on the weapon has reached the set limit + * @param modTpl log mod tpl if over type limit + * @param currentCount current number of this item on gun + * @param maxLimit mod limit allowed + * @param botRole role of bot we're checking weapon of + * @returns true if limit reached + */ + protected weaponModLimitReached(modTpl: string, currentCount: { + count: number; + }, maxLimit: number, botRole: string): boolean; +} diff --git a/Faupi-HideoutArchitect/server/types/services/CustomLocationWaveService.d.ts b/Faupi-HideoutArchitect/server/types/services/CustomLocationWaveService.d.ts new file mode 100644 index 0000000..7d14f07 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/services/CustomLocationWaveService.d.ts @@ -0,0 +1,42 @@ +import { BossLocationSpawn, Wave } from "../models/eft/common/ILocationBase"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; +export declare class CustomLocationWaveService { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; + protected configServer: ConfigServer; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + /** + * Add a boss wave to a map + * @param locationId e.g. factory4_day, bigmap + * @param waveToAdd Boss wave to add to map + */ + addBossWaveToMap(locationId: string, waveToAdd: BossLocationSpawn): void; + /** + * Add a normal bot wave to a map + * @param locationId e.g. factory4_day, bigmap + * @param waveToAdd Wave to add to map + */ + addNormalWaveToMap(locationId: string, waveToAdd: Wave): void; + /** + * Clear all custom boss waves from a map + * @param locationId e.g. factory4_day, bigmap + */ + clearBossWavesForMap(locationId: string): void; + /** + * Clear all custom normal waves from a map + * @param locationId e.g. factory4_day, bigmap + */ + clearNormalWavesForMap(locationId: string): void; + /** + * Add custom boss and normal waves to maps found in config/location.json to db + */ + applyWaveChangesToAllMaps(): void; +} diff --git a/Faupi-HideoutArchitect/server/types/services/FenceService.d.ts b/Faupi-HideoutArchitect/server/types/services/FenceService.d.ts index bdcdeb2..d143380 100644 --- a/Faupi-HideoutArchitect/server/types/services/FenceService.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/FenceService.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; -import { FenceLevel } from "../models/eft/common/IGlobals"; +import { FenceLevel, Preset } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; @@ -15,6 +15,7 @@ import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { ItemFilterService } from "./ItemFilterService"; +import { LocalisationService } from "./LocalisationService"; /** * Handle actions surrounding Fence * e.g. generating or refreshing assorts / get next refresh time @@ -30,12 +31,25 @@ export declare class FenceService { protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected itemFilterService: ItemFilterService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; + /** Main assorts you see at all rep levels */ protected fenceAssort: ITraderAssort; + /** Assorts shown on a separte tab when you max out fence rep */ + protected fenceDiscountAssort: ITraderAssort; protected traderConfig: ITraderConfig; protected nextMiniRefreshTimestamp: number; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); - protected setFenceAssort(fenceAssort: ITraderAssort): void; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Replace main fence assort with new assort + * @param assort New assorts to replace old with + */ + protected setFenceAssort(assort: ITraderAssort): void; + /** + * Replace high rep level fence assort with new assort + * @param assort New assorts to replace old with + */ + protected setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -44,12 +58,27 @@ export declare class FenceService { */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; /** - * Adjust assorts price by a modifier - * @param item - * @param assort - * @param modifier + * Adjust all items contained inside an assort by a multiplier + * @param assort Assort that contains items with prices to adjust + * @param itemMultipler multipler to use on items + * @param presetMultiplier preset multipler to use on presets */ - protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; + protected adjustAssortItemPrices(assort: ITraderAssort, itemMultipler: number, presetMultiplier: number): void; + /** + * Merge two trader assort files together + * @param firstAssort assort 1# + * @param secondAssort assort #2 + * @returns merged assort + */ + protected mergeAssorts(firstAssort: ITraderAssort, secondAssort: ITraderAssort): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item assort item details + * @param assort assort to be modified + * @param modifier value to multiply item price by + * @param presetModifier value to multiply preset price by + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number, presetModifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -78,7 +107,7 @@ export declare class FenceService { /** * Choose an item (not mod) at random and remove from assorts */ - protected removeRandomItemFromAssorts(): void; + protected removeRandomItemFromAssorts(assort: ITraderAssort): void; /** * Get an integer rounded count of items to replace based on percentrage from traderConfig value * @param totalItemCount total item count @@ -91,20 +120,32 @@ export declare class FenceService { */ getOfferCount(): number; /** - * Create a trader assort for fence + * Create trader assorts for fence and store in fenceService cache */ - generateFenceAssortCache(): void; + generateFenceAssorts(): void; /** * Create skeleton to hold assort items * @returns ITraderAssort object */ protected createBaseTraderAssortItem(): ITraderAssort; /** - * Hydrate result parameter object with generated assorts + * Hydrate assorts parameter object with generated assorts * @param assortCount Number of assorts to generate - * @param assorts object to add assorts to + * @param assorts object to add created assorts to */ - protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + protected createAssorts(assortCount: number, assorts: ITraderAssort, loyaltyLevel: number): void; + protected addItemAssorts(assortCount: number, fenceAssortIds: string[], assorts: ITraderAssort, fenceAssort: ITraderAssort, itemTypeCounts: Record, loyaltyLevel: number): void; + /** + * Add preset weapons to fence presets + * @param assortCount how many assorts to add to assorts + * @param defaultWeaponPresets a dictionary of default weapon presets + * @param assorts object to add presets to + * @param loyaltyLevel loyalty level to requre item at + */ + protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/Faupi-HideoutArchitect/server/types/services/InsuranceService.d.ts b/Faupi-HideoutArchitect/server/types/services/InsuranceService.d.ts index 6be8a2f..886a298 100644 --- a/Faupi-HideoutArchitect/server/types/services/InsuranceService.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/InsuranceService.d.ts @@ -1,4 +1,6 @@ +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; +import { HandbookHelper } from "../helpers/HandbookHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -12,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; +import { LocalisationService } from "./LocalisationService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -21,14 +24,16 @@ export declare class InsuranceService { protected saveServer: SaveServer; protected traderHelper: TraderHelper; protected dialogueHelper: DialogueHelper; + protected handbookHelper: HandbookHelper; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; insuranceTraderArrayExists(sessionId: string, traderId: string): boolean; getInsurance(sessionId: string): Record; - getInsuranceItems(sessionId: string, traderId: string): any[]; + getInsuranceItems(sessionId: string, traderId: string): Item[]; resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; @@ -45,6 +50,13 @@ export declare class InsuranceService { * @param mapId Id of the map player died/exited that caused the insurance to be issued on */ sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; + /** + * Get a timestamp of what insurance items should be sent to player based on the type of trader used to insure + * @param pmcData Player profile + * @param trader Trader used to insure items + * @returns Timestamp to return items to player in seconds + */ + protected getInsuranceReturnTimestamp(pmcData: IPmcData, trader: ITraderBase): number; /** * Store lost gear post-raid inside profile * @param pmcData player profile to store gear in diff --git a/Faupi-HideoutArchitect/server/types/services/ItemBaseClassService.d.ts b/Faupi-HideoutArchitect/server/types/services/ItemBaseClassService.d.ts new file mode 100644 index 0000000..d7bc4bc --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/services/ItemBaseClassService.d.ts @@ -0,0 +1,39 @@ +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +/** + * Cache the baseids for each item in the tiems db inside a dictionary + */ +export declare class ItemBaseClassService { + protected logger: ILogger; + protected localisationService: LocalisationService; + protected databaseServer: DatabaseServer; + protected itemBaseClassesCache: Record; + protected cacheGenerated: boolean; + constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + /** + * Create cache and store inside ItemBaseClassService + */ + hydrateItemBaseClassCache(): void; + /** + * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary + * @param itemIdToUpdate item tpl to store base ids against in dictionary + * @param item item being checked + * @param allDbItems all items in db + */ + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + /** + * Does item tpl inherit from the requested base class + * @param itemTpl item to check base classes of + * @param baseClass base class to check for + * @returns true if item inherits from base class passed in + */ + itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Get base classes item inherits from + * @param itemTpl item to get base classes for + * @returns array of base classes + */ + getItemBaseClasses(itemTpl: string): string[]; +} diff --git a/Faupi-HideoutArchitect/server/types/services/LocaleService.d.ts b/Faupi-HideoutArchitect/server/types/services/LocaleService.d.ts index 8275b75..09c658b 100644 --- a/Faupi-HideoutArchitect/server/types/services/LocaleService.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/LocaleService.d.ts @@ -1,5 +1,4 @@ import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; -import { ILocaleGlobalBase } from "../models/spt/server/ILocaleBase"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -14,9 +13,9 @@ export declare class LocaleService { constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the eft globals db file based on the configured locale in config/locale.json, if not found, fall back to 'en' - * @returns ILocaleGlobalBase + * @returns dictionary */ - getLocaleDb(): ILocaleGlobalBase; + getLocaleDb(): Record; /** * Gets the game locale key from the locale.json file, * if value is 'system' get system locale diff --git a/Faupi-HideoutArchitect/server/types/services/OpenZoneService.d.ts b/Faupi-HideoutArchitect/server/types/services/OpenZoneService.d.ts new file mode 100644 index 0000000..8e70b94 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/services/OpenZoneService.d.ts @@ -0,0 +1,28 @@ +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; +import { LocalisationService } from "./LocalisationService"; +/** Service for adding new zones to a maps OpenZones property */ +export declare class OpenZoneService { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected configServer: ConfigServer; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Add open zone to specified map + * @param locationId map location (e.g. factory4_day) + * @param zoneToAdd zone to add + */ + addZoneToMap(locationId: string, zoneToAdd: string): void; + /** + * Add open zones to all maps found in config/location.json to db + */ + applyZoneChangesToAllMaps(): void; +} diff --git a/Faupi-HideoutArchitect/server/types/services/PaymentService.d.ts b/Faupi-HideoutArchitect/server/types/services/PaymentService.d.ts index c9ce95a..ac131ea 100644 --- a/Faupi-HideoutArchitect/server/types/services/PaymentService.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/PaymentService.d.ts @@ -25,12 +25,12 @@ export declare class PaymentService { constructor(logger: ILogger, httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, localisationService: LocalisationService, paymentHelper: PaymentHelper); /** * Take money and insert items into return to server request - * @param {Object} pmcData - * @param {Object} body + * @param {IPmcData} pmcData Player profile + * @param {IProcessBuyTradeRequestData} request * @param {string} sessionID * @returns Object */ - payMoney(pmcData: IPmcData, body: IProcessBuyTradeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse; + payMoney(pmcData: IPmcData, request: IProcessBuyTradeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Receive money back after selling * @param {IPmcData} pmcData @@ -60,9 +60,17 @@ export declare class PaymentService { /** * Prioritise player stash first over player inventory * Post-raid healing would often take money out of the players pockets/secure container - * @param a Firsat money stack item + * @param a First money stack item * @param b Second money stack item - * @returns sorted item + * @param inventoryItems players inventory items + * @returns sort order */ - protected moneySort(a: Item, b: Item): number; + protected prioritiseStashSort(a: Item, b: Item, inventoryItems: Item[]): number; + /** + * Recursivly check items parents to see if it is inside the players inventory, not stash + * @param itemId item id to check + * @param inventoryItems player inventory + * @returns true if its in inventory + */ + protected isInInventory(itemId: string, inventoryItems: Item[]): boolean; } diff --git a/Faupi-HideoutArchitect/server/types/services/PlayerService.d.ts b/Faupi-HideoutArchitect/server/types/services/PlayerService.d.ts index 2f364d5..1195b93 100644 --- a/Faupi-HideoutArchitect/server/types/services/PlayerService.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/PlayerService.d.ts @@ -1,5 +1,4 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { IPlayerIncrementSkillLevelRequestData } from "../models/eft/player/IPlayerIncrementSkillLevelRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "./LocalisationService"; @@ -11,11 +10,10 @@ export declare class PlayerService { /** * increases the profile skill and updates any output * @param {Object} pmcData - * @param {Object} output * @param {String} skillName * @param {Number} amount */ - incrementSkillLevel(pmcData: IPmcData, output: IPlayerIncrementSkillLevelRequestData, skillName: string, amount: number): void; + incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number): void; /** * @param {Object} pmcData * @returns number diff --git a/Faupi-HideoutArchitect/server/types/services/ProfileFixerService.d.ts b/Faupi-HideoutArchitect/server/types/services/ProfileFixerService.d.ts index 86a6af8..8d23ebc 100644 --- a/Faupi-HideoutArchitect/server/types/services/ProfileFixerService.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/ProfileFixerService.d.ts @@ -7,6 +7,7 @@ import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { HideoutAreas } from "../models/enums/HideoutAreas"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { TimeUtil } from "../utils/TimeUtil"; import { Watermark } from "../utils/Watermark"; import { LocalisationService } from "./LocalisationService"; export declare class ProfileFixerService { @@ -14,8 +15,9 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected localisationService: LocalisationService; + protected timeUtil: TimeUtil; protected databaseServer: DatabaseServer; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -32,6 +34,8 @@ export declare class ProfileFixerService { * @param pmcProfile profile to remove old counters from */ removeDanglingConditionCounters(pmcProfile: IPmcData): void; + addLighthouseKeeperIfMissing(pmcProfile: IPmcData): void; + protected addUnlockedInfoObjectIfMissing(pmcProfile: IPmcData): void; protected removeDanglingBackendCounters(pmcProfile: IPmcData): void; protected getActiveRepeatableQuests(repeatableQuests: IPmcDataRepeatableQuest[]): IRepeatableQuest[]; protected fixNullTraderSalesSums(pmcProfile: IPmcData): void; @@ -45,6 +49,11 @@ export declare class ProfileFixerService { protected updateProfileQuestDataValues(pmcProfile: IPmcData): void; protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void; protected addMissingWorkbenchWeaponSkills(pmcProfile: IPmcData): void; + /** + * Some profiles have hideout maxed and therefore no improvements + * @param pmcProfile Profile to add improvement data to + */ + protected addMissingWallImprovements(pmcProfile: IPmcData): void; /** * A new property was added to slot items "locationIndex", if this is missing, the hideout slot item must be removed * @param pmcProfile Profile to find and remove slots from @@ -85,4 +94,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(pmcProfile: IPmcData): void; + /** + * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 + * @param pmcProfile profile to update + */ + addMissingUpgradesPropertyToHideout(pmcProfile: IPmcData): void; + /** + * Iterate over associated profile template and check all hideout areas exist, add if not + * @param fullProfile Profile to update + */ + addMissingHideoutAreasToProfile(fullProfile: IAkiProfile): void; + /** + * These used to be used for storing scav case rewards, rewards are now generated on pickup + * @param pmcProfile Profile to update + */ + removeLegacyScavCaseProductionCrafts(pmcProfile: IPmcData): void; } diff --git a/Faupi-HideoutArchitect/server/types/services/RagfairLinkedItemService.d.ts b/Faupi-HideoutArchitect/server/types/services/RagfairLinkedItemService.d.ts index 6c34ee0..51511f9 100644 --- a/Faupi-HideoutArchitect/server/types/services/RagfairLinkedItemService.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/RagfairLinkedItemService.d.ts @@ -1,10 +1,21 @@ -import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { DatabaseServer } from "../servers/DatabaseServer"; export declare class RagfairLinkedItemService { protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected linkedItemsCache: Record>; - constructor(databaseServer: DatabaseServer); + constructor(databaseServer: DatabaseServer, itemHelper: ItemHelper); getLinkedItems(linkedSearchId: string): Iterable; + /** + * Create Dictionary of every item and the items associated with it + */ protected buildLinkedItemTable(): void; + /** + * Add ammo to revolvers linked item dictionary + * @param cylinder Revolvers cylinder + * @param applyLinkedItems + */ + protected addRevolverCylinderAmmoToLinkedItems(cylinder: ITemplateItem, applyLinkedItems: (items: string[]) => void): void; protected getFilters(item: ITemplateItem, slot: string): string[]; } diff --git a/Faupi-HideoutArchitect/server/types/services/RagfairOfferService.d.ts b/Faupi-HideoutArchitect/server/types/services/RagfairOfferService.d.ts index 86c1e52..fc08d39 100644 --- a/Faupi-HideoutArchitect/server/types/services/RagfairOfferService.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/RagfairOfferService.d.ts @@ -10,6 +10,7 @@ import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { RagfairOfferHolder } from "../utils/RagfairOfferHolder"; import { TimeUtil } from "../utils/TimeUtil"; import { LocalisationService } from "./LocalisationService"; import { RagfairCategoriesService } from "./RagfairCategoriesService"; @@ -26,10 +27,9 @@ export declare class RagfairOfferService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; - protected expiredOffers: Item[]; - /** offerId, offer */ - protected offers: Record; + protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; + protected ragfairOfferHandler: RagfairOfferHolder; constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers @@ -45,7 +45,7 @@ export declare class RagfairOfferService { * Get an array of expired items not yet processed into new offers * @returns items that need to be turned into offers */ - getExpiredOffers(): Item[]; + getExpiredOfferItems(): Item[]; resetExpiredOffers(): void; /** * Does the offer exist on the ragfair @@ -53,8 +53,17 @@ export declare class RagfairOfferService { * @returns offer exists - true */ doesOfferExist(offerId: string): boolean; + /** + * Remove an offer from ragfair by offer id + * @param offerId Offer id to remove + */ removeOfferById(offerId: string): void; - removeOfferStack(offerID: string, amount: number): void; + /** + * Reduce size of an offer stack by specified amount + * @param offerId Offer to adjust stack size of + * @param amount How much to deduct from offers stack size + */ + removeOfferStack(offerId: string, amount: number): void; removeAllOffersByTrader(traderId: string): void; /** * Do the trader offers on flea need to be refreshed @@ -65,11 +74,9 @@ export declare class RagfairOfferService { addPlayerOffers(): void; expireStaleOffers(): void; /** - * Get an array of stale offers that are still shown to player - * @returns IRagfairOffer array + * Remove stale offer from flea + * @param staleOffer Stale offer to process */ - protected getStaleOffers(): IRagfairOffer[]; - protected isStale(offer: IRagfairOffer, time: number): boolean; protected processStaleOffer(staleOffer: IRagfairOffer): void; protected returnPlayerOffer(offer: IRagfairOffer): IItemEventRouterResponse; } diff --git a/Faupi-HideoutArchitect/server/types/services/RagfairPriceService.d.ts b/Faupi-HideoutArchitect/server/types/services/RagfairPriceService.d.ts index 4ac7794..8b68bc4 100644 --- a/Faupi-HideoutArchitect/server/types/services/RagfairPriceService.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/RagfairPriceService.d.ts @@ -1,6 +1,8 @@ +import { OnLoad } from "../di/OnLoad"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; @@ -10,29 +12,38 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -import { OnLoad } from "../di/OnLoad"; +/** + * Stores flea prices for items as well as methods to interact with them + */ export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; + protected traderHelper: TraderHelper; 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; + constructor(handbookHelper: HandbookHelper, databaseServer: DatabaseServer, logger: ILogger, itemHelper: ItemHelper, presetHelper: PresetHelper, traderHelper: TraderHelper, randomUtil: RandomUtil, configServer: ConfigServer); + /** + * Generate static (handbook) and dynamic (prices.json) flea prices, store inside class as dictionaries + */ + onLoad(): Promise; getRoute(): string; /** * Iterate over all items of type "Item" in db and get template price, store in cache */ generateStaticPrices(): void; + /** + * Create a dictionary and store prices from prices.json in it + */ protected generateDynamicPrices(): void; /** - * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 * @param tplId Item tpl id to get price for * @returns price in roubles @@ -51,7 +62,12 @@ export declare class RagfairPriceService implements OnLoad { * @returns price in roubles */ getStaticPriceForItem(itemTpl: string): number; + /** + * Get prices for all items on flea, priorities dynamic prices from prices.json, use handbook prices if missing + * @returns Dictionary of item tpls and rouble cost + */ getAllFleaPrices(): Record; + getAllStaticPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -59,7 +75,18 @@ export declare class RagfairPriceService implements OnLoad { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; + /** + * Get the rouble price for an assorts barter scheme + * @param barterScheme + * @returns Rouble price + */ getBarterPrice(barterScheme: IBarterScheme[]): number; + /** + * Generate a currency cost for an item and its mods + * @param items Item with mods to get price for + * @param desiredCurrency Currency price desired in + * @returns cost of item in desired currency + */ 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 @@ -83,11 +110,20 @@ export declare class RagfairPriceService implements OnLoad { * @returns */ protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Get the highest price for an item that is stored in handbook or trader assorts + * @param itemTpl Item to get highest price of + * @returns rouble cost + */ + protected getHighestHandbookOrTraderPriceAsRouble(itemTpl: string): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) * @param presets weapon presets to choose from * @returns Default preset object */ - protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; + protected getWeaponPreset(presets: Preset[], weapon: Item): { + isDefault: boolean; + preset: Preset; + }; } diff --git a/Faupi-HideoutArchitect/server/types/services/RagfairRequiredItemsService.d.ts b/Faupi-HideoutArchitect/server/types/services/RagfairRequiredItemsService.d.ts index b05fc65..95c3ddb 100644 --- a/Faupi-HideoutArchitect/server/types/services/RagfairRequiredItemsService.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/RagfairRequiredItemsService.d.ts @@ -7,6 +7,6 @@ export declare class RagfairRequiredItemsService { protected ragfairOfferService: RagfairOfferService; protected requiredItemsCache: {}; constructor(logger: ILogger, paymentHelper: PaymentHelper, ragfairOfferService: RagfairOfferService); - getRequiredItems(searchId: string): any; + getRequiredItemsById(searchId: string): any; buildRequiredItemTable(): void; } diff --git a/Faupi-HideoutArchitect/server/types/services/RepairService.d.ts b/Faupi-HideoutArchitect/server/types/services/RepairService.d.ts index d3f1b35..a3c6c7a 100644 --- a/Faupi-HideoutArchitect/server/types/services/RepairService.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/RepairService.d.ts @@ -1,27 +1,33 @@ +import { ItemHelper } from "../helpers/ItemHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { RepairHelper } from "../helpers/RepairHelper"; import { TraderHelper } from "../helpers/TraderHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; -import { IRepairConfig } from "../models/spt/config/IRepairConfig"; +import { BonusSettings, IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; + protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected paymentService: PaymentService; protected repairHelper: RepairHelper; protected configServer: ConfigServer; - repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + protected repairConfig: IRepairConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -46,9 +52,8 @@ export declare class RepairService { * @param sessionId Session id * @param repairDetails details of item repaired, cost/item * @param pmcData Profile to add points to - * @param output IItemEventRouterResponse */ - addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData, output: IItemEventRouterResponse): void; + addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; /** * * @param sessionId Session id @@ -59,15 +64,65 @@ export declare class RepairService { * @returns Details of repair, item/price */ repairItemByKit(sessionId: string, pmcData: IPmcData, repairKits: RepairKitsInfo[], itemToRepairId: string, output: IItemEventRouterResponse): RepairDetails; + /** + * Calculate value repairkit points need to be divided by to get the durability points to be added to an item + * @param itemToRepairDetails Item to repair details + * @param isArmor Is the item being repaired armor + * @param pmcData Player profile + * @returns Number to divide kit points by + */ + protected getKitDivisor(itemToRepairDetails: ITemplateItem, isArmor: boolean, pmcData: IPmcData): number; + /** + * Get the bonus multiplier for a skill from a player profile + * @param skillBonusName Name of bonus to get multipler of + * @param pmcData Player profile to look in for skill + * @returns Multiplier value + */ + protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db * @param repairKitInInventory Repair kit to update */ protected addMaxResourceToKitIfMissing(repairKitDetails: ITemplateItem, repairKitInInventory: Item): void; + /** + * Chance to apply buff to an item (Armor/weapon) if repaired by armor kit + * @param repairDetails Repair details of item + * @param pmcData Player profile + */ + addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Add buff to item + * @param itemConfig weapon/armor config + * @param repairDetails Details for item to repair + */ + protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + /** + * Check if item should be buffed by checking the item type and relevant player skill level + * @param repairDetails Item that was repaired + * @param itemTpl tpl of item to be buffed + * @param pmcData Player profile + * @returns True if item should have buff applied + */ + protected shouldBuffItem(repairDetails: RepairDetails, pmcData: IPmcData): boolean; + /** + * Based on item, what underlying skill does this item use for buff settings + * @param itemTemplate Item to check for skill + * @returns Skill name + */ + protected getItemSkillType(itemTemplate: ITemplateItem): string; + /** + * Ensure multiplier is between 1 and 0.01 + * @param receiveDurabilityMaxPercent Max durabiltiy percent + * @param receiveDurabilityPercent current durability percent + * @returns durability multipler value + */ + protected getDurabilityMultiplier(receiveDurabilityMaxPercent: number, receiveDurabilityPercent: number): number; } export declare class RepairDetails { repairCost?: number; repairedItem: Item; repairedItemIsArmor: boolean; + repairAmount: number; + repairedByKit: boolean; } diff --git a/Faupi-HideoutArchitect/server/types/services/SeasonalEventService.d.ts b/Faupi-HideoutArchitect/server/types/services/SeasonalEventService.d.ts new file mode 100644 index 0000000..7474018 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/services/SeasonalEventService.d.ts @@ -0,0 +1,114 @@ +import { BotHelper } from "../helpers/BotHelper"; +import { Config } from "../models/eft/common/IGlobals"; +import { Inventory } from "../models/eft/common/tables/IBotType"; +import { ISeasonalEvent, ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class SeasonalEventService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected botHelper: BotHelper; + protected configServer: ConfigServer; + protected seasonalEventConfig: ISeasonalEventConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); + protected get events(): Record; + protected get christmasEventItems(): string[]; + protected get halloweenEventItems(): string[]; + /** + * Get an array of christmas items found in bots inventories as loot + * @returns array + */ + getChristmasEventItems(): string[]; + /** + * Get an array of halloween items found in bots inventories as loot + * @returns array + */ + getHalloweenEventItems(): string[]; + itemIsChristmasRelated(itemTpl: string): boolean; + itemIsHalloweenRelated(itemTpl: string): boolean; + /** + * Check if item id exists in christmas or halloween event arrays + * @param itemTpl item tpl to check for + * @returns + */ + itemIsSeasonalRelated(itemTpl: string): boolean; + /** + * Get an array of items that appear during a seasonal event + * returns multiple seasonal event items if they are both active + * @returns array of tpl strings + */ + getAllSeasonalEventItems(): string[]; + /** + * Get an array of seasonal items that should be blocked as seasonal is not active + * @returns Array of tpl strings + */ + getSeasonalEventItemsToBlock(): string[]; + /** + * Is a seasonal event currently active + * @returns true if event is active + */ + seasonalEventEnabled(): boolean; + /** + * is christmas event active + * @returns true if active + */ + christmasEventEnabled(): boolean; + /** + * is christmas event active + * @returns true if active + */ + halloweenEventEnabled(): boolean; + /** + * Is detection of seasonal events enabled (halloween / christmas) + * @returns true if seasonal events should be checked for + */ + isAutomaticEventDetectionEnabled(): boolean; + /** + * Get a dictionary of gear changes to apply to bots for a specific event e.g. Christmas/Halloween + * @param eventName Name of event to get gear changes for + * @returns bots with equipment changes + */ + protected getEventBotGear(eventName: string): Record>>; + /** + * Get the dates each seasonal event starts and ends at + * @returns Record with event name + start/end date + */ + getEventDetails(): ISeasonalEvent[]; + /** + * Check if current date falls inside any of the seasons events pased in, if so, handle them + */ + checkForAndEnableSeasonalEvents(): void; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in SeasonalEventService) + * @param nodeInventory Bots inventory to iterate over + * @param botRole the role of the bot being processed + */ + removeChristmasItemsFromBotInventory(nodeInventory: Inventory, botRole: string): void; + /** + * Make adjusted to server code based on the name of the event passed in + * @param globalConfig globals.json + * @param eventName Name of the event to enable. e.g. Christmas + */ + protected updateGlobalEvents(globalConfig: Config, eventName: string): void; + /** + * Add lootble items from backpack into patrol.ITEMS_TO_DROP difficulty property + */ + protected addLootItemsToGifterDropItemsList(): void; + /** + * Read in data from seasonalEvents.json and add found equipment items to bots + * @param eventName Name of the event to read equipment in from config + */ + protected addEventGearToBots(eventName: string): void; + protected addPumpkinsToScavBackpacks(): void; + /** + * Set Khorovod(dancing tree) chance to 100% on all maps that support it + */ + protected enableDancingTree(): void; + /** + * Add santa to maps + */ + protected addGifterBotToMaps(): void; +} diff --git a/Faupi-HideoutArchitect/server/types/services/TraderPurchasePersisterService.d.ts b/Faupi-HideoutArchitect/server/types/services/TraderPurchasePersisterService.d.ts new file mode 100644 index 0000000..7e7c88f --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/services/TraderPurchasePersisterService.d.ts @@ -0,0 +1,34 @@ +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { TraderPurchaseData } from "../models/eft/profile/IAkiProfile"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { TimeUtil } from "../utils/TimeUtil"; +/** + * Help with storing limited item purchases from traders in profile to persist them over server restarts + */ +export declare class TraderPurchasePersisterService { + protected logger: ILogger; + protected timeUtil: TimeUtil; + protected profileHelper: ProfileHelper; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, profileHelper: ProfileHelper, configServer: ConfigServer); + /** + * Get the purchases made from a trader for this profile before the last trader reset + * @param sessionId Session id + * @param traderId Trader to loop up purchases for + * @returns Dict of assort id and count purchased + */ + getProfileTraderPurchases(sessionId: string, traderId: string): Record; + /** + * Remove all trader purchase records from all profiles that exist + * @param traderId Traders id + */ + resetTraderPurchasesStoredInProfile(traderId: string): void; + /** + * Iterate over all server profiles and remove specific trader purchase data that has passed the trader refesh time + * @param traderId Trader id + */ + removeStalePurchasesFromProfiles(traderId: string): void; +} diff --git a/Faupi-HideoutArchitect/server/types/services/mod/onLoad/OnLoadMod.d.ts b/Faupi-HideoutArchitect/server/types/services/mod/onLoad/OnLoadMod.d.ts index 53fb062..a4b58b5 100644 --- a/Faupi-HideoutArchitect/server/types/services/mod/onLoad/OnLoadMod.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/mod/onLoad/OnLoadMod.d.ts @@ -1,8 +1,8 @@ import { OnLoad } from "../../../di/OnLoad"; -export declare class OnLoadMod extends OnLoad { +export declare class OnLoadMod implements OnLoad { private onLoadOverride; private getRouteOverride; constructor(onLoadOverride: () => void, getRouteOverride: () => string); - onLoad(): void; + onLoad(): Promise; getRoute(): string; } diff --git a/Faupi-HideoutArchitect/server/types/services/mod/onUpdate/OnUpdateMod.d.ts b/Faupi-HideoutArchitect/server/types/services/mod/onUpdate/OnUpdateMod.d.ts index ee89043..8dfe6dd 100644 --- a/Faupi-HideoutArchitect/server/types/services/mod/onUpdate/OnUpdateMod.d.ts +++ b/Faupi-HideoutArchitect/server/types/services/mod/onUpdate/OnUpdateMod.d.ts @@ -1,8 +1,8 @@ import { OnUpdate } from "../../../di/OnUpdate"; -export declare class OnUpdateMod extends OnUpdate { +export declare class OnUpdateMod implements OnUpdate { private onUpdateOverride; private getRouteOverride; constructor(onUpdateOverride: (timeSinceLastRun: number) => boolean, getRouteOverride: () => string); - onUpdate(timeSinceLastRun: number): boolean; + onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/Faupi-HideoutArchitect/server/types/utils/App.d.ts b/Faupi-HideoutArchitect/server/types/utils/App.d.ts index cc8a5af..b947c83 100644 --- a/Faupi-HideoutArchitect/server/types/utils/App.d.ts +++ b/Faupi-HideoutArchitect/server/types/utils/App.d.ts @@ -11,7 +11,7 @@ export declare class App { protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); - load(): void; - protected update(onUpdateComponents: OnUpdate[]): void; + load(): Promise; + protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; } diff --git a/Faupi-HideoutArchitect/server/types/utils/DatabaseImporter.d.ts b/Faupi-HideoutArchitect/server/types/utils/DatabaseImporter.d.ts index 31670ae..c09d63a 100644 --- a/Faupi-HideoutArchitect/server/types/utils/DatabaseImporter.d.ts +++ b/Faupi-HideoutArchitect/server/types/utils/DatabaseImporter.d.ts @@ -1,26 +1,35 @@ import { OnLoad } from "../di/OnLoad"; -import { IDatabaseTables } from "../models/spt/server/IDatabaseTables"; import { ILogger } from "../models/spt/utils/ILogger"; import { ImageRouter } from "../routers/ImageRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; +import { EncodingUtil } from "./EncodingUtil"; +import { HashUtil } from "./HashUtil"; +import { ImporterUtil } from "./ImporterUtil"; import { JsonUtil } from "./JsonUtil"; import { VFS } from "./VFS"; -export declare class DatabaseImporter extends OnLoad { +export declare class DatabaseImporter implements OnLoad { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected imageRouter: ImageRouter; - constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, localisationService: LocalisationService, databaseServer: DatabaseServer, imageRouter: ImageRouter); - onLoad(): void; + protected encodingUtil: EncodingUtil; + protected hashUtil: HashUtil; + protected importerUtil: ImporterUtil; + private hashedFile; + private valid; + private filepath; + constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, localisationService: LocalisationService, databaseServer: DatabaseServer, imageRouter: ImageRouter, encodingUtil: EncodingUtil, hashUtil: HashUtil, importerUtil: ImporterUtil); + onLoad(): Promise; /** * Read all json files in database folder and map into a json object * @param filepath path to database folder */ - protected hydrateDatabase(filepath: string): void; + protected hydrateDatabase(filepath: string): Promise; + private onReadValidate; getRoute(): string; - loadRecursive(filepath: string): IDatabaseTables; + private validateFile; loadImages(filepath: string): void; } diff --git a/Faupi-HideoutArchitect/server/types/utils/EncodingUtil.d.ts b/Faupi-HideoutArchitect/server/types/utils/EncodingUtil.d.ts new file mode 100644 index 0000000..dabb97a --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/utils/EncodingUtil.d.ts @@ -0,0 +1,15 @@ +export declare class EncodingUtil { + encode(value: string, encode: EncodeType): string; + decode(value: string, encode: EncodeType): string; + fromBase64(value: string): string; + toBase64(value: string): string; + fromHex(value: string): string; + toHex(value: string): string; +} +export declare enum EncodeType { + BASE64 = "base64", + HEX = "hex", + ASCII = "ascii", + BINARY = "binary", + UTF8 = "utf8" +} diff --git a/Faupi-HideoutArchitect/server/types/utils/ImporterUtil.d.ts b/Faupi-HideoutArchitect/server/types/utils/ImporterUtil.d.ts new file mode 100644 index 0000000..75aaf54 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/utils/ImporterUtil.d.ts @@ -0,0 +1,21 @@ +import { JsonUtil } from "./JsonUtil"; +import { VFS } from "./VFS"; +export declare class ImporterUtil { + protected vfs: VFS; + protected jsonUtil: JsonUtil; + constructor(vfs: VFS, jsonUtil: JsonUtil); + /** + * Load files into js objects recursively (asynchronous) + * @param filepath Path to folder with files + * @returns Promise return T type associated with this class + */ + loadRecursiveAsync(filepath: string, onReadCallback?: (fileWithPath: string, data: string) => void, onObjectDeserialized?: (fileWithPath: string, object: any) => void): Promise; + /** + * Load files into js objects recursively (synchronous) + * @param filepath Path to folder with files + * @returns + */ + loadRecursive(filepath: string, onReadCallback?: (fileWithPath: string, data: string) => void, onObjectDeserialized?: (fileWithPath: string, object: any) => void): T; + loadAsync(filepath: string, strippablePath?: string, onReadCallback?: (fileWithPath: string, data: string) => void, onObjectDeserialized?: (fileWithPath: string, object: any) => void): Promise; + protected placeObject(fileDeserialized: any, strippedFilePath: string, result: T, strippablePath: string): void; +} diff --git a/Faupi-HideoutArchitect/server/types/utils/JsonUtil.d.ts b/Faupi-HideoutArchitect/server/types/utils/JsonUtil.d.ts index 71e95f6..229dc26 100644 --- a/Faupi-HideoutArchitect/server/types/utils/JsonUtil.d.ts +++ b/Faupi-HideoutArchitect/server/types/utils/JsonUtil.d.ts @@ -6,6 +6,7 @@ export declare class JsonUtil { protected hashUtil: HashUtil; protected logger: ILogger; protected fileHashes: any; + protected jsonCacheExists: boolean; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string @@ -13,13 +14,14 @@ export declare class JsonUtil { * @param prettify Should output be prettified? * @returns string */ - serialize(data: any, prettify?: boolean): string; + serialize(data: T, prettify?: boolean): string; /** * From string to object * @param jsonString json string to turn into object * @returns object */ - deserialize(jsonString: string): any; - deserializeWithCacheCheck(jsonString: string, filePath: string): string; + deserialize(jsonString: string, filename?: string): T; + deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeWithCacheCheck(jsonString: string, filePath: string): T; clone(data: T): T; } diff --git a/Faupi-HideoutArchitect/server/types/utils/RagfairOfferHolder.d.ts b/Faupi-HideoutArchitect/server/types/utils/RagfairOfferHolder.d.ts new file mode 100644 index 0000000..46d9e23 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/utils/RagfairOfferHolder.d.ts @@ -0,0 +1,24 @@ +import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; +export declare class RagfairOfferHolder { + private offersById; + private offersByTemplate; + private offersByTrader; + constructor(); + getOfferById(id: string): IRagfairOffer; + getOffersByTemplate(templateId: string): Array; + getOffersByTrader(traderId: string): Array; + getOffers(): Array; + addOffers(offers: Array): void; + addOffer(offer: IRagfairOffer): void; + removeOffer(offer: IRagfairOffer): void; + removeOffers(offers: Array): void; + removeOfferByTrader(traderId: string): void; + /** + * Get an array of stale offers that are still shown to player + * @returns IRagfairOffer array + */ + getStaleOffers(time: number): Array; + private addOfferByTemplates; + private addOfferByTrader; + protected isStale(offer: IRagfairOffer, time: number): boolean; +} diff --git a/Faupi-HideoutArchitect/server/types/utils/RandomUtil.d.ts b/Faupi-HideoutArchitect/server/types/utils/RandomUtil.d.ts index aa556e3..fc0b05d 100644 --- a/Faupi-HideoutArchitect/server/types/utils/RandomUtil.d.ts +++ b/Faupi-HideoutArchitect/server/types/utils/RandomUtil.d.ts @@ -110,6 +110,7 @@ export declare class RandomUtil { getIntEx(max: number): number; getFloat(min: number, max: number): number; getBool(): boolean; + getPercentOfValue(percent: number, number: number, toFixed?: number): number; /** * Check if number passes a check out of 100 * @param chancePercent value check needs to be above diff --git a/Faupi-HideoutArchitect/server/types/utils/UUidGenerator.d.ts b/Faupi-HideoutArchitect/server/types/utils/UUidGenerator.d.ts index 000b719..ed1ffa6 100644 --- a/Faupi-HideoutArchitect/server/types/utils/UUidGenerator.d.ts +++ b/Faupi-HideoutArchitect/server/types/utils/UUidGenerator.d.ts @@ -1,4 +1,4 @@ import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator"; export declare class UUidGenerator implements IUUidGenerator { - generate: () => string; + generate(): string; } diff --git a/Faupi-HideoutArchitect/server/types/utils/VFS.d.ts b/Faupi-HideoutArchitect/server/types/utils/VFS.d.ts index e5eaf02..267b10f 100644 --- a/Faupi-HideoutArchitect/server/types/utils/VFS.d.ts +++ b/Faupi-HideoutArchitect/server/types/utils/VFS.d.ts @@ -1,7 +1,7 @@ /// /// -import "reflect-metadata"; import fs from "fs"; +import "reflect-metadata"; import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue"; import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator"; export declare class VFS { @@ -32,8 +32,9 @@ export declare class VFS { createDirAsync(filepath: string): Promise; copyDir(filepath: string, target: string, fileExtensions?: string | string[]): void; copyDirAsync(filepath: string, target: string, fileExtensions: string | string[]): Promise; - readFile(filepath: string): any; - readFileAsync(filepath: string): Promise; + readFile(...args: Parameters): string; + readFileAsync(path: fs.PathLike): Promise; + private isBuffer; writeFile(filepath: any, data?: string, append?: boolean, atomic?: boolean): void; writeFileAsync(filepath: any, data?: string, append?: boolean, atomic?: boolean): Promise; getFiles(filepath: string): string[]; diff --git a/Faupi-HideoutArchitect/server/types/utils/Watermark.d.ts b/Faupi-HideoutArchitect/server/types/utils/Watermark.d.ts index e02eba2..f870cf1 100644 --- a/Faupi-HideoutArchitect/server/types/utils/Watermark.d.ts +++ b/Faupi-HideoutArchitect/server/types/utils/Watermark.d.ts @@ -30,7 +30,11 @@ export declare class Watermark { * @returns string */ getVersionTag(withEftVersion?: boolean): string; - getVersionLabel(): string; + /** + * Get text shown in game on screen, can't be translated as it breaks bsgs client when certian characters are used + * @returns string + */ + getInGameVersionLabel(): string; /** Set window title */ setTitle(): void; /** Reset console cursor to top */ diff --git a/Faupi-HideoutArchitect/server/types/utils/collections/queue/Queue.d.ts b/Faupi-HideoutArchitect/server/types/utils/collections/queue/Queue.d.ts new file mode 100644 index 0000000..645d462 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/utils/collections/queue/Queue.d.ts @@ -0,0 +1,12 @@ +export declare class Queue { + private elements; + private head; + private tail; + constructor(); + enqueue(element: T): void; + enqueueAll(elements: T[]): void; + dequeue(): T; + peek(): T; + getLength(): number; + isEmpty(): boolean; +} diff --git a/Faupi-HideoutArchitect/server/types/utils/decorators/Singleton.d.ts b/Faupi-HideoutArchitect/server/types/utils/decorators/Singleton.d.ts deleted file mode 100644 index 7e89026..0000000 --- a/Faupi-HideoutArchitect/server/types/utils/decorators/Singleton.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type constructor from "./constructor"; -import { InjectionToken } from "tsyringe"; -declare function singleton(token?: InjectionToken): (target: constructor) => void; -export default singleton; diff --git a/Faupi-HideoutArchitect/server/types/utils/decorators/constructor.d.ts b/Faupi-HideoutArchitect/server/types/utils/decorators/constructor.d.ts deleted file mode 100644 index 416f354..0000000 --- a/Faupi-HideoutArchitect/server/types/utils/decorators/constructor.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare type constructor = { - new (...args: any[]): T; -}; -export default constructor; diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/Logger.d.ts b/Faupi-HideoutArchitect/server/types/utils/logging/AbstractWinstonLogger.d.ts similarity index 70% rename from KcY-SeeItemValue/itemValue/server/types/utils/Logger.d.ts rename to Faupi-HideoutArchitect/server/types/utils/logging/AbstractWinstonLogger.d.ts index 1088701..1ae1100 100644 --- a/KcY-SeeItemValue/itemValue/server/types/utils/Logger.d.ts +++ b/Faupi-HideoutArchitect/server/types/utils/logging/AbstractWinstonLogger.d.ts @@ -1,19 +1,17 @@ /// import fs from "fs"; import winston from "winston"; -import { Daum } from "../models/eft/itemEvent/IItemEventRouterRequest"; -import { LogBackgroundColor } from "../models/spt/logging/LogBackgroundColor"; -import { LogTextColor } from "../models/spt/logging/LogTextColor"; -import { SptLogger } from "../models/spt/logging/SptLogger"; -import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue"; -import { ILogger } from "../models/spt/utils/ILogger"; -import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator"; -export declare class WinstonLogger implements ILogger { +import { Daum } from "../../models/eft/itemEvent/IItemEventRouterRequest"; +import { LogBackgroundColor } from "../../models/spt/logging/LogBackgroundColor"; +import { LogTextColor } from "../../models/spt/logging/LogTextColor"; +import { SptLogger } from "../../models/spt/logging/SptLogger"; +import { IAsyncQueue } from "../../models/spt/utils/IAsyncQueue"; +import { ILogger } from "../../models/spt/utils/ILogger"; +import { IUUidGenerator } from "../../models/spt/utils/IUuidGenerator"; +export declare abstract class AbstractWinstonLogger implements ILogger { protected asyncQueue: IAsyncQueue; protected uuidGenerator: IUUidGenerator; protected showDebugInConsole: boolean; - protected folderPath: string; - protected file: string; protected filePath: string; protected logLevels: { levels: { @@ -47,6 +45,13 @@ export declare class WinstonLogger implements ILogger { protected logger: winston.Logger & SptLogger; protected writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator); + protected abstract isLogToFile(): boolean; + protected abstract isLogToConsole(): boolean; + protected abstract isLogExceptions(): boolean; + protected abstract getFilePath(): string; + protected abstract getFileName(): string; + protected getLogMaxSize(): string; + protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; log(data: string | Error | Record, color: string, backgroundColor?: string): Promise; error(data: string | Record): Promise; diff --git a/Faupi-HideoutArchitect/server/types/utils/logging/WinstonMainLogger.d.ts b/Faupi-HideoutArchitect/server/types/utils/logging/WinstonMainLogger.d.ts new file mode 100644 index 0000000..3c67902 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/utils/logging/WinstonMainLogger.d.ts @@ -0,0 +1,13 @@ +import { IAsyncQueue } from "../../models/spt/utils/IAsyncQueue"; +import { IUUidGenerator } from "../../models/spt/utils/IUuidGenerator"; +import { AbstractWinstonLogger } from "./AbstractWinstonLogger"; +export declare class WinstonMainLogger extends AbstractWinstonLogger { + protected asyncQueue: IAsyncQueue; + protected uuidGenerator: IUUidGenerator; + constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator); + protected isLogExceptions(): boolean; + protected isLogToFile(): boolean; + protected isLogToConsole(): boolean; + protected getFilePath(): string; + protected getFileName(): string; +} diff --git a/Faupi-HideoutArchitect/server/types/utils/logging/WinstonRequestLogger.d.ts b/Faupi-HideoutArchitect/server/types/utils/logging/WinstonRequestLogger.d.ts new file mode 100644 index 0000000..1475e43 --- /dev/null +++ b/Faupi-HideoutArchitect/server/types/utils/logging/WinstonRequestLogger.d.ts @@ -0,0 +1,14 @@ +import { IAsyncQueue } from "../../models/spt/utils/IAsyncQueue"; +import { IUUidGenerator } from "../../models/spt/utils/IUuidGenerator"; +import { AbstractWinstonLogger } from "./AbstractWinstonLogger"; +export declare class WinstonRequestLogger extends AbstractWinstonLogger { + protected asyncQueue: IAsyncQueue; + protected uuidGenerator: IUUidGenerator; + constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator); + protected isLogExceptions(): boolean; + protected isLogToFile(): boolean; + protected isLogToConsole(): boolean; + protected getFilePath(): string; + protected getFileName(): string; + protected getLogMaxSize(): string; +} diff --git a/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/bepInEx/plugins/Faupi-MunitionsExpert.dll b/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/bepInEx/plugins/Faupi-MunitionsExpert.dll similarity index 100% rename from Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/bepInEx/plugins/Faupi-MunitionsExpert.dll rename to Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/bepInEx/plugins/Faupi-MunitionsExpert.dll diff --git a/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/LICENSE.txt b/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/LICENSE.txt similarity index 100% rename from Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/LICENSE.txt rename to Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/LICENSE.txt diff --git a/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/package.json b/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/package.json similarity index 91% rename from Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/package.json rename to Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/package.json index eca8a33..e16d760 100644 --- a/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/package.json +++ b/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/package.json @@ -1,10 +1,10 @@ { "name": "MunitionsExpert", "author": "Faupi", - "version": "1.6.8", + "version": "1.6.9", "license": "NCSA Open Source", "main": "./src/MunitionsExpert.js", - "akiVersion": "3.4.0", + "akiVersion": "3.5.0", "updatedBy": "CWX", "scripts": { "setup": "npm i", diff --git a/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/res/armorDamage.png b/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/res/armorDamage.png similarity index 100% rename from Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/res/armorDamage.png rename to Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/res/armorDamage.png diff --git a/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/res/ricochet.png b/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/res/ricochet.png similarity index 100% rename from Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/res/ricochet.png rename to Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/res/ricochet.png diff --git a/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/res/translations.json b/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/res/translations.json similarity index 100% rename from Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/res/translations.json rename to Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/res/translations.json diff --git a/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/src/MunitionsExpert.ts b/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/src/MunitionsExpert.ts similarity index 98% rename from Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/src/MunitionsExpert.ts rename to Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/src/MunitionsExpert.ts index 2adb346..4cc6d44 100644 --- a/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/src/MunitionsExpert.ts +++ b/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/src/MunitionsExpert.ts @@ -69,7 +69,7 @@ class MunitionsExpert implements IPreAkiLoadMod, IPostAkiLoadMod url: "/MunitionsExpert/GetInfo", action: (url, info, sessionId, output) => { - return this.json.serialize(this.path.resolve(this.modLoader.getModPath("Faupi-MunitionsExpert 1.6.7"))); + return this.json.serialize(this.path.resolve(this.modLoader.getModPath("Faupi-MunitionsExpert 1.6.9"))); } } ], diff --git a/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/src/config.json b/Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/src/config.json similarity index 100% rename from Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.8/user/mods/Faupi-MunitionsExpert 1.6.8/src/config.json rename to Faupi-MunitionsExpert/Built/Faupi-MunitionsExpert 1.6.9/user/mods/Faupi-MunitionsExpert 1.6.9/src/config.json diff --git a/Faupi-MunitionsExpert/MunitionsExpert/MunitionsExpert/Program.cs b/Faupi-MunitionsExpert/MunitionsExpert/MunitionsExpert/Program.cs index c91be2d..133e318 100644 --- a/Faupi-MunitionsExpert/MunitionsExpert/MunitionsExpert/Program.cs +++ b/Faupi-MunitionsExpert/MunitionsExpert/MunitionsExpert/Program.cs @@ -1,20 +1,19 @@ -using System; -using System.IO; -using System.Collections.Generic; -using UnityEngine; -using EFT.InventoryLogic; -using UnityEngine.Networking; -using System.Threading.Tasks; +using Aki.Common.Http; +using Aki.Common.Utils; using BepInEx; using Comfort.Common; -using Newtonsoft.Json; -using Aki.Common.Utils; +using EFT.InventoryLogic; +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using UnityEngine; +using UnityEngine.Networking; using static MunitionsExpert.Attributes; -using Aki.Common.Http; namespace MunitionsExpert { - [BepInPlugin("com.Faupi.MunitionsExpert", "Faupi-MunitionsExpert", "1.6.8")] + [BepInPlugin("com.Faupi.MunitionsExpert", "Faupi-MunitionsExpert", "1.6.9")] public class Plugin : BaseUnityPlugin { public static Dictionary iconCache = new Dictionary(); @@ -108,7 +107,7 @@ namespace MunitionsExpert int ratedClass = 0; if (!Singleton.Instantiated) { return $"CLASS_DATA_MISSING {template.PenetrationPower.ToString()}"; } - BackendConfigSettingsClass.GClass1226.GClass1227[] classes = Singleton.Instance.Armor.ArmorClass; + var classes = Singleton.Instance.Armor.ArmorClass; for (int i = 0; i < classes.Length; i++) { if (classes[i].Resistance > template.PenetrationPower) continue; diff --git a/Faupi-MunitionsExpert/server/dist/package.json b/Faupi-MunitionsExpert/server/dist/package.json index eca8a33..e16d760 100644 --- a/Faupi-MunitionsExpert/server/dist/package.json +++ b/Faupi-MunitionsExpert/server/dist/package.json @@ -1,10 +1,10 @@ { "name": "MunitionsExpert", "author": "Faupi", - "version": "1.6.8", + "version": "1.6.9", "license": "NCSA Open Source", "main": "./src/MunitionsExpert.js", - "akiVersion": "3.4.0", + "akiVersion": "3.5.0", "updatedBy": "CWX", "scripts": { "setup": "npm i", diff --git a/Faupi-MunitionsExpert/server/dist/src/MunitionsExpert.ts b/Faupi-MunitionsExpert/server/dist/src/MunitionsExpert.ts index 2adb346..4cc6d44 100644 --- a/Faupi-MunitionsExpert/server/dist/src/MunitionsExpert.ts +++ b/Faupi-MunitionsExpert/server/dist/src/MunitionsExpert.ts @@ -69,7 +69,7 @@ class MunitionsExpert implements IPreAkiLoadMod, IPostAkiLoadMod url: "/MunitionsExpert/GetInfo", action: (url, info, sessionId, output) => { - return this.json.serialize(this.path.resolve(this.modLoader.getModPath("Faupi-MunitionsExpert 1.6.7"))); + return this.json.serialize(this.path.resolve(this.modLoader.getModPath("Faupi-MunitionsExpert 1.6.9"))); } } ], diff --git a/Faupi-MunitionsExpert/server/package.json b/Faupi-MunitionsExpert/server/package.json index eca8a33..e16d760 100644 --- a/Faupi-MunitionsExpert/server/package.json +++ b/Faupi-MunitionsExpert/server/package.json @@ -1,10 +1,10 @@ { "name": "MunitionsExpert", "author": "Faupi", - "version": "1.6.8", + "version": "1.6.9", "license": "NCSA Open Source", "main": "./src/MunitionsExpert.js", - "akiVersion": "3.4.0", + "akiVersion": "3.5.0", "updatedBy": "CWX", "scripts": { "setup": "npm i", diff --git a/Faupi-MunitionsExpert/server/src/MunitionsExpert.ts b/Faupi-MunitionsExpert/server/src/MunitionsExpert.ts index 2adb346..4cc6d44 100644 --- a/Faupi-MunitionsExpert/server/src/MunitionsExpert.ts +++ b/Faupi-MunitionsExpert/server/src/MunitionsExpert.ts @@ -69,7 +69,7 @@ class MunitionsExpert implements IPreAkiLoadMod, IPostAkiLoadMod url: "/MunitionsExpert/GetInfo", action: (url, info, sessionId, output) => { - return this.json.serialize(this.path.resolve(this.modLoader.getModPath("Faupi-MunitionsExpert 1.6.7"))); + return this.json.serialize(this.path.resolve(this.modLoader.getModPath("Faupi-MunitionsExpert 1.6.9"))); } } ], diff --git a/Faupi-MunitionsExpert/server/types/callbacks/DataCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/callbacks/DataCallbacks.d.ts index 2efcf81..26f5899 100644 --- a/Faupi-MunitionsExpert/server/types/callbacks/DataCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/callbacks/DataCallbacks.d.ts @@ -1,14 +1,16 @@ +import { HideoutController } from "../controllers/HideoutController"; +import { RagfairController } from "../controllers/RagfairController"; 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 { IGetItemPricesResponse } from "../models/eft/game/IGetItemPricesResponse"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "../models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; -import { ILanguageBase } from "../models/spt/server/ILocaleBase"; import { ISettingsBase } from "../models/spt/server/ISettingsBase"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; @@ -18,7 +20,9 @@ import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer); + protected ragfairController: RagfairController; + protected hideoutController: HideoutController; + constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handles client/settings * @returns ISettingsBase @@ -54,7 +58,17 @@ export declare class DataCallbacks { getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle client/hideout/qte/list + */ + getQteList(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle client/items/prices/ + * Called when viewing a traders assorts + * TODO - fully implement this + */ + getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/Faupi-MunitionsExpert/server/types/callbacks/DialogueCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/callbacks/DialogueCallbacks.d.ts index 7b2eeae..63d7163 100644 --- a/Faupi-MunitionsExpert/server/types/callbacks/DialogueCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "../controllers/DialogueController"; import { OnUpdate } from "../di/OnUpdate"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { IChatServer } from "../models/eft/dialog/IChatServer"; import { IFriendRequestData } from "../models/eft/dialog/IFriendRequestData"; import { IGetAllAttachmentsRequestData } from "../models/eft/dialog/IGetAllAttachmentsRequestData"; import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse"; @@ -20,7 +21,7 @@ import { DialogueInfo } from "../models/eft/profile/IAkiProfile"; import { HashUtil } from "../utils/HashUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { TimeUtil } from "../utils/TimeUtil"; -export declare class DialogueCallbacks extends OnUpdate { +export declare class DialogueCallbacks implements OnUpdate { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; @@ -35,7 +36,7 @@ export declare class DialogueCallbacks extends OnUpdate { * Handles client/chatServer/list * @returns */ - getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData; + getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData; getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData; getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData; getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData; @@ -52,6 +53,6 @@ export declare class DialogueCallbacks extends OnUpdate { listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; friendRequest(url: string, request: IFriendRequestData, sessionID: string): INullResponseData; sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; - onUpdate(timeSinceLastRun: number): boolean; + onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/Faupi-MunitionsExpert/server/types/callbacks/HandbookCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/callbacks/HandbookCallbacks.d.ts index 891e375..6bd3909 100644 --- a/Faupi-MunitionsExpert/server/types/callbacks/HandbookCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/callbacks/HandbookCallbacks.d.ts @@ -1,8 +1,8 @@ import { HandbookController } from "../controllers/HandbookController"; import { OnLoad } from "../di/OnLoad"; -export declare class HandbookCallbacks extends OnLoad { +export declare class HandbookCallbacks implements OnLoad { protected handbookController: HandbookController; constructor(handbookController: HandbookController); - onLoad(): void; + onLoad(): Promise; getRoute(): string; } diff --git a/Faupi-MunitionsExpert/server/types/callbacks/HealthCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/callbacks/HealthCallbacks.d.ts index 7edf03e..bd3e507 100644 --- a/Faupi-MunitionsExpert/server/types/callbacks/HealthCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/callbacks/HealthCallbacks.d.ts @@ -7,6 +7,7 @@ import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealReques import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { IWorkoutData } from "../models/eft/health/IWorkoutData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class HealthCallbacks { protected httpResponse: HttpResponseUtil; @@ -21,6 +22,14 @@ export declare class HealthCallbacks { * @returns empty response, no data sent back to client */ syncHealth(url: string, info: ISyncHealthRequestData, sessionID: string): IGetBodyResponseData; + /** + * Custom aki server request found in modules/QTEPatch.cs + * @param url + * @param info HealthListener.Instance.CurrentHealth class + * @param sessionID session id + * @returns empty response, no data sent back to client + */ + handleWorkoutEffects(url: string, info: IWorkoutData, sessionID: string): IGetBodyResponseData; /** * Handle Eat * @returns IItemEventRouterResponse diff --git a/Faupi-MunitionsExpert/server/types/callbacks/HideoutCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/callbacks/HideoutCallbacks.d.ts index e39e806..d0247f9 100644 --- a/Faupi-MunitionsExpert/server/types/callbacks/HideoutCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/callbacks/HideoutCallbacks.d.ts @@ -1,7 +1,9 @@ import { HideoutController } from "../controllers/HideoutController"; import { OnUpdate } from "../di/OnUpdate"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; +import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; +import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData"; import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData"; import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData"; @@ -10,10 +12,11 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData"; import { IHideoutUpgradeCompleteRequestData } from "../models/eft/hideout/IHideoutUpgradeCompleteRequestData"; import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData"; +import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ConfigServer } from "../servers/ConfigServer"; -export declare class HideoutCallbacks extends OnUpdate { +export declare class HideoutCallbacks implements OnUpdate { protected hideoutController: HideoutController; protected configServer: ConfigServer; protected hideoutConfig: IHideoutConfig; @@ -21,76 +24,52 @@ export declare class HideoutCallbacks extends OnUpdate { configServer: ConfigServer); /** * Handle HideoutUpgrade - * @param pmcData - * @param body - * @param sessionID - * @returns */ upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutUpgradeComplete - * @param pmcData - * @param body - * @param sessionID - * @returns */ upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutPutItemsInAreaSlots - * @param pmcData - * @param body - * @param sessionID - * @returns */ putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutTakeItemsFromAreaSlots - * @param pmcData - * @param body - * @param sessionID - * @returns */ takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutToggleArea - * @param pmcData - * @param body - * @param sessionID - * @returns */ toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutSingleProductionStart - * @param pmcData - * @param body - * @param sessionID - * @returns */ singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutScavCaseProductionStart - * @param pmcData - * @param body - * @param sessionID - * @returns */ scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutContinuousProductionStart - * @param pmcData - * @param body - * @param sessionID - * @returns */ - continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutTakeProduction - * @param pmcData - * @param body - * @param sessionID - * @returns */ takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; - onUpdate(timeSinceLastRun: number): boolean; + /** + * Handle HideoutQuickTimeEvent + */ + handleQTEEvent(pmcData: IPmcData, request: IHandleQTEEventRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - RecordShootingRangePoints + */ + recordShootingRangePoints(pmcData: IPmcData, request: IRecordShootingRangePoints, sessionId: string): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - RecordShootingRangePoints + */ + improveArea(pmcData: IPmcData, request: IHideoutImproveAreaRequestData, sessionId: string): IItemEventRouterResponse; + onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/Faupi-MunitionsExpert/server/types/callbacks/HttpCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/callbacks/HttpCallbacks.d.ts index 43928a1..10794fa 100644 --- a/Faupi-MunitionsExpert/server/types/callbacks/HttpCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/callbacks/HttpCallbacks.d.ts @@ -1,9 +1,9 @@ import { OnLoad } from "../di/OnLoad"; import { HttpServer } from "../servers/HttpServer"; -export declare class HttpCallbacks extends OnLoad { +export declare class HttpCallbacks implements OnLoad { protected httpServer: HttpServer; constructor(httpServer: HttpServer); - onLoad(): void; + onLoad(): Promise; getRoute(): string; getImage(): string; } diff --git a/Faupi-MunitionsExpert/server/types/callbacks/InsuranceCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/callbacks/InsuranceCallbacks.d.ts index a171e1c..aea0756 100644 --- a/Faupi-MunitionsExpert/server/types/callbacks/InsuranceCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/callbacks/InsuranceCallbacks.d.ts @@ -10,7 +10,7 @@ import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { InsuranceService } from "../services/InsuranceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; -export declare class InsuranceCallbacks extends OnUpdate { +export declare class InsuranceCallbacks implements OnUpdate { protected insuranceController: InsuranceController; protected insuranceService: InsuranceService; protected httpResponse: HttpResponseUtil; @@ -27,6 +27,6 @@ export declare class InsuranceCallbacks extends OnUpdate { * @returns IItemEventRouterResponse */ insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; - onUpdate(secondsSinceLastRun: number): boolean; + onUpdate(secondsSinceLastRun: number): Promise; getRoute(): string; } diff --git a/Faupi-MunitionsExpert/server/types/callbacks/MatchCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/callbacks/MatchCallbacks.d.ts index 10fbc44..52e3290 100644 --- a/Faupi-MunitionsExpert/server/types/callbacks/MatchCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/callbacks/MatchCallbacks.d.ts @@ -7,10 +7,10 @@ import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequest import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; +import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; -import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; @@ -41,6 +41,6 @@ export declare class MatchCallbacks { getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; - startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; + getRaidConfiguration(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData; } diff --git a/Faupi-MunitionsExpert/server/types/callbacks/ModCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/callbacks/ModCallbacks.d.ts index aec2f59..d1ec7f7 100644 --- a/Faupi-MunitionsExpert/server/types/callbacks/ModCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/callbacks/ModCallbacks.d.ts @@ -3,20 +3,19 @@ import { PostAkiModLoader } from "../loaders/PostAkiModLoader"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { LocalisationService } from "../services/LocalisationService"; import { HttpFileUtil } from "../utils/HttpFileUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; -declare class ModCallbacks extends OnLoad { +declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; protected postAkiModLoader: PostAkiModLoader; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; - constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, configServer: ConfigServer); - onLoad(): void; + constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, localisationService: LocalisationService, configServer: ConfigServer); + onLoad(): Promise; getRoute(): string; - sendBundle(sessionID: string, req: any, resp: any, body: any): void; - getBundles(url: string, info: any, sessionID: string): string; - getBundle(url: string, info: any, sessionID: string): string; } export { ModCallbacks }; diff --git a/Faupi-MunitionsExpert/server/types/callbacks/PresetCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/callbacks/PresetCallbacks.d.ts index 4553f8f..37bf4e8 100644 --- a/Faupi-MunitionsExpert/server/types/callbacks/PresetCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/callbacks/PresetCallbacks.d.ts @@ -1,8 +1,8 @@ import { PresetController } from "../controllers/PresetController"; import { OnLoad } from "../di/OnLoad"; -export declare class PresetCallbacks extends OnLoad { +export declare class PresetCallbacks implements OnLoad { protected presetController: PresetController; constructor(presetController: PresetController); - onLoad(): void; + onLoad(): Promise; getRoute(): string; } diff --git a/Faupi-MunitionsExpert/server/types/callbacks/RagfairCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/callbacks/RagfairCallbacks.d.ts index 37f3807..97713e7 100644 --- a/Faupi-MunitionsExpert/server/types/callbacks/RagfairCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/callbacks/RagfairCallbacks.d.ts @@ -1,5 +1,6 @@ +import { OnLoad } from "../di/OnLoad"; +import { OnUpdate } from "../di/OnUpdate"; import { RagfairController } from "../controllers/RagfairController"; -import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; @@ -14,7 +15,6 @@ import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferReque import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; @@ -22,23 +22,26 @@ import { JsonUtil } from "../utils/JsonUtil"; /** * Handle ragfair related callback events */ -export declare class RagfairCallbacks extends OnLoadOnUpdate { +export declare class RagfairCallbacks implements OnLoad, OnUpdate { protected httpResponse: HttpResponseUtil; - protected logger: ILogger; protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected ragfairController: RagfairController; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(httpResponse: HttpResponseUtil, logger: ILogger, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer); - onLoad(): void; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer); + onLoad(): Promise; getRoute(): string; search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData; getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData; - getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse; removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; - onUpdate(timeSinceLastRun: number): boolean; + /** + * Handle /client/items/prices + * Called when clicking an item to list on flea + */ + getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; + onUpdate(timeSinceLastRun: number): Promise; sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/Faupi-MunitionsExpert/server/types/callbacks/SaveCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/callbacks/SaveCallbacks.d.ts index bbb6e53..93ffd96 100644 --- a/Faupi-MunitionsExpert/server/types/callbacks/SaveCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/callbacks/SaveCallbacks.d.ts @@ -1,9 +1,10 @@ -import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate"; +import { OnLoad } from "../di/OnLoad"; +import { OnUpdate } from "../di/OnUpdate"; import { SaveServer } from "../servers/SaveServer"; -export declare class SaveCallbacks extends OnLoadOnUpdate { +export declare class SaveCallbacks implements OnLoad, OnUpdate { protected saveServer: SaveServer; constructor(saveServer: SaveServer); - onLoad(): void; + onLoad(): Promise; getRoute(): string; - onUpdate(secondsSinceLastRun: number): boolean; + onUpdate(secondsSinceLastRun: number): Promise; } diff --git a/Faupi-MunitionsExpert/server/types/callbacks/TradeCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/callbacks/TradeCallbacks.d.ts index 272ae46..4291da8 100644 --- a/Faupi-MunitionsExpert/server/types/callbacks/TradeCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/callbacks/TradeCallbacks.d.ts @@ -6,6 +6,9 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); + /** + * Handle client/game/profile/items/moving TradingConfirm + */ processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/Faupi-MunitionsExpert/server/types/callbacks/TraderCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/callbacks/TraderCallbacks.d.ts index 40a1455..8df1049 100644 --- a/Faupi-MunitionsExpert/server/types/callbacks/TraderCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/callbacks/TraderCallbacks.d.ts @@ -1,15 +1,16 @@ +import { OnLoad } from "../di/OnLoad"; +import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; -import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; -export declare class TraderCallbacks extends OnLoadOnUpdate { +export declare class TraderCallbacks implements OnLoad, OnUpdate { protected httpResponse: HttpResponseUtil; protected traderController: TraderController; constructor(httpResponse: HttpResponseUtil, traderController: TraderController); - onLoad(): void; - onUpdate(): boolean; + onLoad(): Promise; + onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; /** diff --git a/Faupi-MunitionsExpert/server/types/context/ApplicationContext.d.ts b/Faupi-MunitionsExpert/server/types/context/ApplicationContext.d.ts index a155bcd..28bbdf7 100644 --- a/Faupi-MunitionsExpert/server/types/context/ApplicationContext.d.ts +++ b/Faupi-MunitionsExpert/server/types/context/ApplicationContext.d.ts @@ -3,6 +3,15 @@ import { ContextVariableType } from "./ContextVariableType"; export declare class ApplicationContext { private variables; private static holderMaxSize; + /** + * Called like: + * + * const registerPlayerInfo = this.applicationContext.getLatestValue(ContextVariableType.REGISTER_PLAYER_REQUEST).getValue(); + * + * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.MATCH_INFO).getValue(); + * @param type + * @returns + */ getLatestValue(type: ContextVariableType): ContextVariable; getValues(type: ContextVariableType): ContextVariable[]; addValue(type: ContextVariableType, value: any): void; diff --git a/Faupi-MunitionsExpert/server/types/context/ContextVariableType.d.ts b/Faupi-MunitionsExpert/server/types/context/ContextVariableType.d.ts index a7dd9b5..49f3267 100644 --- a/Faupi-MunitionsExpert/server/types/context/ContextVariableType.d.ts +++ b/Faupi-MunitionsExpert/server/types/context/ContextVariableType.d.ts @@ -2,7 +2,9 @@ export declare enum ContextVariableType { /** Logged in users session id */ SESSION_ID = 0, /** Currently acive raid information */ - MATCH_INFO = 1, + RAID_CONFIGURATION = 1, /** Timestamp when client first connected */ - CLIENT_START_TIMESTAMP = 2 + CLIENT_START_TIMESTAMP = 2, + /** When player is loading into map and loot is requested */ + REGISTER_PLAYER_REQUEST = 3 } diff --git a/Faupi-MunitionsExpert/server/types/controllers/BotController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/BotController.d.ts index 51c0c68..1d7eb9d 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/BotController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/BotController.d.ts @@ -3,7 +3,6 @@ import { BotGenerator } from "../generators/BotGenerator"; import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper"; import { BotHelper } from "../helpers/BotHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; -import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData"; import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; @@ -23,14 +22,13 @@ export declare class BotController { protected botDifficultyHelper: BotDifficultyHelper; protected botGenerationCacheService: BotGenerationCacheService; protected localisationService: LocalisationService; - protected weightedRandomHelper: WeightedRandomHelper; protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; static readonly pmcTypeLabel = "PMC"; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** * Return the number of bot loadout varieties to be generated * @param type bot Type we want the loadout gen count for @@ -57,6 +55,12 @@ export declare class BotController { * @returns IBotBase array */ generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[]; + /** + * Get the difficulty passed in, if its not "asoline", get selected difficulty from config + * @param requestedDifficulty + * @returns + */ + getPMCDifficulty(requestedDifficulty: string): string; /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value diff --git a/Faupi-MunitionsExpert/server/types/controllers/CustomizationController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/CustomizationController.d.ts index 5fe51e3..a4ef8cf 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/CustomizationController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/CustomizationController.d.ts @@ -8,13 +8,15 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; +import { LocalisationService } from "../services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; + protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, 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/Faupi-MunitionsExpert/server/types/controllers/DialogueController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/DialogueController.d.ts index 9c8b728..98d3d52 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/DialogueController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/DialogueController.d.ts @@ -27,6 +27,7 @@ export declare class DialogueController { */ getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo; /** + * Handle player clicking 'messenger' and seeing all the messages they've recieved * Set the content of the dialogue on the details panel, showing all the messages * for the specified dialogue. * @param dialogueID Dialog id diff --git a/Faupi-MunitionsExpert/server/types/controllers/GameController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/GameController.d.ts index f4f5849..44264dc 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/GameController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/GameController.d.ts @@ -1,59 +1,74 @@ import { ApplicationContext } from "../context/ApplicationContext"; -import { GameEventHelper } from "../helpers/GameEventHelper"; +import { HideoutHelper } from "../helpers/HideoutHelper"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { Config } from "../models/eft/common/IGlobals"; +import { IPmcData } from "../models/eft/common/IPmcData"; 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"; -import { ISeasonalEvent } from "../models/spt/config/ISeasonalEventConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -import { LocaleService } from "../services/LocaleService"; +import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { LocalisationService } from "../services/LocalisationService"; +import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; -import { Watermark } from "../utils/Watermark"; +import { SeasonalEventService } from "../services/SeasonalEventService"; +import { TimeUtil } from "../utils/TimeUtil"; export declare class GameController { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected watermark: Watermark; + protected timeUtil: TimeUtil; + protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; - protected localeService: LocaleService; + protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; - protected gameEventHelper: GameEventHelper; + protected customLocationWaveService: CustomLocationWaveService; + protected openZoneService: OpenZoneService; + protected seasonalEventService: SeasonalEventService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, watermark: Watermark, httpServerHelper: HttpServerHelper, localeService: LocaleService, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, gameEventHelper: GameEventHelper, applicationContext: ApplicationContext, configServer: ConfigServer); + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; /** - * Check if current date falls inside any of the seasons events pased in, if so, handle them - * @param seasonalEvents events to check for + * When player logs in, iterate over all active effects and reduce timer + * TODO - add body part HP regen + * @param pmcProfile */ - protected checkForAndEnableSeasonalEvents(seasonalEvents: ISeasonalEvent[]): void; + protected updateProfileHealthValues(pmcProfile: IPmcData): void; /** - * Make adjusted to server code based on the name of the event passed in - * @param globalConfig globals.json - * @param eventName Name of the event to enable. e.g. Christmas + * Waves with an identical min/max values spawn nothing, the number of bots that spawn is the difference between min and max */ - protected updateGlobalEvents(globalConfig: Config, eventName: string): void; + protected fixBrokenOfflineMapWaves(): void; /** - * Read in data from seasonalEvents.json and add found equipment items to bots - * @param eventName Name of the event to read equipment in from config + * Make Rogues spawn later to allow for scavs to spawn first instead of rogues filling up all spawn positions */ - protected addEventGearToScavs(eventName: string): void; + protected fixRoguesSpawningInstantlyOnLighthouse(): void; /** - * Set Khorovod(dancing tree) chance to 100% on all maps that support it + * Get a list of installed mods and save their details to the profile being used + * @param fullProfile Profile to add mod details to */ - protected enableDancingTree(): void; + protected saveActiveModsToProfile(fullProfile: IAkiProfile): void; + /** + * Add the logged in players name to PMC name pool + * @param pmcProfile + */ + protected addPlayerToPMCNames(pmcProfile: IPmcData): void; + /** + * Blank out the "test" mail message from prapor + */ + protected removePraporTestMessage(): void; /** * Make non-trigger-spawned raiders spawn earlier + always */ @@ -61,6 +76,5 @@ export declare class GameController { protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; getServer(): IServerDetails[]; - protected addPumpkinsToScavBackpacks(): void; getValidGameVersion(): ICheckVersionResponse; } diff --git a/Faupi-MunitionsExpert/server/types/controllers/HealthController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/HealthController.d.ts index ce67993..7c149cc 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/HealthController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/HealthController.d.ts @@ -1,23 +1,28 @@ -import { ItemHelper } from "../helpers/ItemHelper"; -import { PaymentService } from "../services/PaymentService"; -import { InventoryHelper } from "../helpers/InventoryHelper"; import { HealthHelper } from "../helpers/HealthHelper"; +import { InventoryHelper } from "../helpers/InventoryHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData"; import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData"; import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; +import { IWorkoutData } from "../models/eft/health/IWorkoutData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { LocalisationService } from "../services/LocalisationService"; +import { PaymentService } from "../services/PaymentService"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class HealthController { protected logger: ILogger; + protected jsonUtil: JsonUtil; protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; + protected localisationService: LocalisationService; protected healthHelper: HealthHelper; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, jsonUtil: JsonUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile @@ -25,7 +30,7 @@ export declare class HealthController { * @param sessionID * @param addEffects Should effects found be added or removed from profile */ - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** * When healing in menu * @param pmcData @@ -34,13 +39,35 @@ export declare class HealthController { * @returns */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Consume food/water outside of a raid + * @param pmcData Player profile + * @param body request Object + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; /** * Occurs on post-raid healing page * @param pmcData player profile - * @param info Request data from client + * @param healthTreatmentRequest Request data from client * @param sessionID Session id * @returns */ - healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; + healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; + /** + * applies skills from hideout workout. + * @param pmcData Player profile + * @param info Request data + * @param sessionID + */ + applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void; + /** + * Iterate over treatment request diff and find effects to remove from player limbs + * @param sessionId + * @param profile Profile to update + * @param treatmentRequest client request + * @param output response to send to client + */ + protected removeEffectsAfterPostRaidHeal(sessionId: string, profile: IPmcData, treatmentRequest: IHealthTreatmentRequestData, output: IItemEventRouterResponse): void; } diff --git a/Faupi-MunitionsExpert/server/types/controllers/HideoutController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/HideoutController.d.ts index 5b6507b..e6e0243 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/HideoutController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/HideoutController.d.ts @@ -7,7 +7,9 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; -import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; +import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; +import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData"; import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData"; @@ -16,6 +18,8 @@ import { IHideoutTakeItemOutRequestData } from "../models/eft/hideout/IHideoutTa import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData"; import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData"; import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData"; +import { IQteData } from "../models/eft/hideout/IQteData"; +import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -23,6 +27,7 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; +import { FenceService } from "../services/FenceService"; import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { HashUtil } from "../utils/HashUtil"; @@ -49,12 +54,28 @@ export declare class HideoutController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; + protected fenceService: FenceService; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil); - upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; - upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** + * Start a hideout area upgrade + * @param pmcData Player profile + * @param request upgrade start request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + startUpgrade(pmcData: IPmcData, request: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Complete a hideout area upgrade + * @param pmcData Player profile + * @param request Completed upgrade request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory * @param pmcData Profile data * @param addItemToHideoutRequest reqeust from client to place item in area slot @@ -62,7 +83,14 @@ export declare class HideoutController { * @returns IItemEventRouterResponse object */ putItemsInAreaSlots(pmcData: IPmcData, addItemToHideoutRequest: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse; - takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Remove item from hideout area and place into player inventory + * @param pmcData Player profile + * @param request Take item out of area request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + takeItemsFromAreaSlots(pmcData: IPmcData, request: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse; /** * Find resource item in hideout area, add copy to player inventory, remove Item from hideout slot * @param sessionID Session id @@ -73,7 +101,21 @@ export declare class HideoutController { * @returns IItemEventRouterResponse response */ protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: HideoutArea): IItemEventRouterResponse; - toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Toggle area on/off + * @param pmcData Player profile + * @param request Toggle area request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + toggleArea(pmcData: IPmcData, request: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Start production for an item from hideout area + * @param pmcData Player profile + * @param body Start prodution of single item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles event after clicking 'start' on the scav case hideout page @@ -83,24 +125,96 @@ export declare class HideoutController { * @returns item event router response */ scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Adjust scav case time based on fence standing + * + * @param pmcData Player profile + * @param productionTime Time to complete scav case in seconds + * @returns Adjusted scav case time in seconds + */ + protected getScavCaseTime(pmcData: IPmcData, productionTime: number): number; /** * Add generated scav case rewards to player profile * @param pmcData player profile to add rewards to * @param rewards reward items to add to profile + * @param recipieId recipie id to save into Production dict */ - protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[]): void; - continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; - takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; - protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; + protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[], recipieId: string): void; + /** + * Start production of continuously created item + * @param pmcData Player profile + * @param request Continious production request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + continuousProductionStart(pmcData: IPmcData, request: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Take completed item out of hideout area and place into player inventory + * @param pmcData Player profile + * @param request Remove production from area request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + takeProduction(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Take recipie-type production out of hideout area and place into player inventory + * @param sessionID Session id + * @param recipe Completed recipie of item + * @param pmcData Player profile + * @param request Remove production from area request + * @param output Output object to update + * @returns IItemEventRouterResponse + */ + protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Handles giving rewards stored in player profile to player after clicking 'get rewards' - * @param sessionID - * @param pmcData - * @param body - * @param output - * @returns + * @param sessionID Session id + * @param pmcData Player profile + * @param request Get rewards from scavcase craft request + * @param output Output object to update + * @returns IItemEventRouterResponse + */ + protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; + /** + * Start area production for item + * @param pmcData Player profile + * @param request Start production request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + registerProduction(pmcData: IPmcData, request: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Get quick time event list for hideout + * // TODO - implement this + * @param sessionId Session id + * @returns IQteData array + */ + getQteList(sessionId: string): IQteData[]; + /** + * Handle HideoutQuickTimeEvent on client/game/profile/items/moving + * Called after completing workout at gym + * @param sessionId Session id + * @param pmcData Profile to adjust + * @param request QTE result object + */ + handleQTEEventOutcome(sessionId: string, pmcData: IPmcData, request: IHandleQTEEventRequestData): IItemEventRouterResponse; + /** + * Record a high score from the shooting range into a player profiles overallcounters + * @param sessionId Session id + * @param pmcData Profile to update + * @param request shooting range score request + * @returns IItemEventRouterResponse + */ + recordShootingRangePoints(sessionId: string, pmcData: IPmcData, request: IRecordShootingRangePoints): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - HideoutImproveArea + * @param sessionId Session id + * @param pmcData profile to improve area in + * @param request improve area request data + */ + improveArea(sessionId: string, pmcData: IPmcData, request: IHideoutImproveAreaRequestData): IItemEventRouterResponse; + /** + * Function called every x seconds as part of onUpdate event */ - protected handleScavCase(sessionID: string, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; - registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; update(): void; } diff --git a/Faupi-MunitionsExpert/server/types/controllers/InraidController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/InraidController.d.ts index 39a6396..f954eff 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/InraidController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/InraidController.d.ts @@ -1,3 +1,4 @@ +import { ApplicationContext } from "../context/ApplicationContext"; import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; import { HealthHelper } from "../helpers/HealthHelper"; import { InRaidHelper } from "../helpers/InRaidHelper"; @@ -35,12 +36,13 @@ export declare class InraidController { protected traderHelper: TraderHelper; protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; + protected applicationContext: ApplicationContext; 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); + 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, applicationContext: ApplicationContext, configServer: ConfigServer); /** - * Save locationid to active profiles inraid object + * Save locationId to active profiles inraid object AND app context * @param sessionID Session id * @param info Register player request */ diff --git a/Faupi-MunitionsExpert/server/types/controllers/InsuranceController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/InsuranceController.d.ts index 54f31b5..af6e68d 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/InsuranceController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/InsuranceController.d.ts @@ -31,13 +31,23 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, insuranceService: InsuranceService, configServer: ConfigServer); + /** + * Process insurance items prior to being given to player in mail + */ processReturn(): void; + /** + * Add insurance to an item + * @param pmcData Player profile + * @param body Insurance request + * @param sessionID Session id + * @returns IItemEventRouterResponse object to send to client + */ insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; /** * Calculate insurance cost * @param info request object * @param sessionID session id - * @returns response object to send to client + * @returns IGetInsuranceCostResponseData object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/Faupi-MunitionsExpert/server/types/controllers/InventoryController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/InventoryController.d.ts index e1c08c0..129ede3 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/InventoryController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/InventoryController.d.ts @@ -129,9 +129,14 @@ export declare class InventoryController { protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** - * Handles sorting of Inventory. + * Handle ApplyInventoryChanges + * Sorts supplied items. + * @param pmcData Player profile + * @param request sort request + * @param sessionID Session id + * @returns IItemEventRouterResponse */ - sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse; + sortInventory(pmcData: IPmcData, request: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse; createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse; deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse; editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/Faupi-MunitionsExpert/server/types/controllers/MatchController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/MatchController.d.ts index 2b0d150..cb0c755 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/MatchController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/MatchController.d.ts @@ -6,10 +6,9 @@ import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequest import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; +import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; -import { BotDifficulty } from "../models/enums/BotDifficulty"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; @@ -42,12 +41,17 @@ export declare class MatchController { joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; getGroupStatus(info: IGetGroupStatusRequestData): any; - startOfflineRaid(info: IStartOfflineRaidRequestData, sessionID: string): void; + /** + * Handle /client/raid/configuration + * @param request + * @param sessionID + */ + startOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void; /** * Convert a difficulty value from pre-raid screen to a bot difficulty - * @param botDifficulty dropdown difficulty + * @param botDifficulty dropdown difficulty value * @returns bot difficulty */ - protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: BotDifficulty): string; + protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: string): string; endOfflineRaid(info: IEndOfflineRaidRequestData, sessionID: string): void; } diff --git a/Faupi-MunitionsExpert/server/types/controllers/ProfileController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/ProfileController.d.ts index 8c89a02..e76785a 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/ProfileController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/ProfileController.d.ts @@ -1,6 +1,7 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; +import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IMiniProfile } from "../models/eft/launcher/IMiniProfile"; @@ -24,8 +25,9 @@ export declare class ProfileController { protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; protected traderHelper: TraderHelper; + protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/Faupi-MunitionsExpert/server/types/controllers/QuestController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/QuestController.d.ts index 842207f..fe1754d 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/QuestController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IQuest, Reward } from "../models/eft/common/tables/IQuest"; +import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData"; @@ -15,11 +16,14 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; +import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; +import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; @@ -29,9 +33,10 @@ export declare class QuestController { protected questConditionHelper: QuestConditionHelper; protected playerService: PlayerService; protected localeService: LocaleService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - 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); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) @@ -55,7 +60,30 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; + /** + * Handle the client accepting a repeatable quest and starting it + * Send starting rewards if any to player and + * Send start notification if any to player + * @param pmcData Profile to update with new quest + * @param acceptedQuest Quest being accepted + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Look for an accepted quest inside player profile, return matching + * @param pmcData Profile to search through + * @param acceptedQuest Quest to search for + * @returns IRepeatableQuest + */ + protected getRepeatableQuestFromProfile(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData): IRepeatableQuest; /** * Update completed quest in profile * Add newly unlocked quests to profile @@ -67,13 +95,20 @@ export declare class QuestController { */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; /** - * Send a popup to player on completion of a quest + * Send a popup to player on successful completion of a quest * @param sessionID session id - * @param pmcData player profile - * @param completedQuestId completed quest id - * @param questRewards rewards given to player + * @param pmcData Player profile + * @param completedQuestId Completed quest id + * @param questRewards Rewards given to player */ - protected sendDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Reward[]): void; + protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Reward[]): void; + /** + * Look for newly available quests after completing a quest with a requirement to wait x minutes (time-locked) before being available and add data to profile + * @param pmcData Player profile to update + * @param quests Quests to look for wait conditions in + * @param completedQuestId Quest just completed + */ + protected addTimeLockedQuestsToProfile(pmcData: IPmcData, quests: IQuest[], completedQuestId: string): void; /** * Returns a list of quests that should be failed when a quest is completed * @param completedQuestId quest completed id diff --git a/Faupi-MunitionsExpert/server/types/controllers/RagfairController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/RagfairController.d.ts index 95702f2..fffcaa3 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/RagfairController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/RagfairController.d.ts @@ -67,16 +67,16 @@ export declare class RagfairController { protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; 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, localisationService: LocalisationService, configServer: ConfigServer); - getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; + getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data * @param itemsToAdd - * @param assorts + * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers */ - protected getOffersForSearchType(searchRequest: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + protected getOffersForSearchType(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; /** * Get categories for the type of search being performed, linked/required/all * @param searchRequest Client search request data @@ -100,8 +100,14 @@ export declare class RagfairController { /** * Update a trader flea offer with buy restrictions stored in the traders assort * @param offer flea offer to update + * @param profile full profile of player */ - protected setTraderOfferPurchaseLimits(offer: IRagfairOffer): void; + protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, profile: IAkiProfile): void; + /** + * Adjust ragfair offer stack count to match same value as traders assort stack count + * @param offer Flea offer to adjust + */ + protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; update(): void; @@ -114,6 +120,7 @@ export declare class RagfairController { addPlayerOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse; createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; + getStaticPrices(): Record; removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/Faupi-MunitionsExpert/server/types/controllers/RepeatableQuestController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/RepeatableQuestController.d.ts index 333583b..dd8dc40 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/RepeatableQuestController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/RepeatableQuestController.d.ts @@ -1,3 +1,4 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; @@ -20,6 +21,7 @@ import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { PaymentService } from "../services/PaymentService"; import { ProfileFixerService } from "../services/ProfileFixerService"; +import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { MathUtil } from "../utils/MathUtil"; import { ObjectId } from "../utils/ObjectId"; @@ -56,6 +58,7 @@ export declare class RepeatableQuestController { protected timeUtil: TimeUtil; protected logger: ILogger; protected randomUtil: RandomUtil; + protected httpResponse: HttpResponseUtil; protected mathUtil: MathUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; @@ -63,6 +66,7 @@ export declare class RepeatableQuestController { protected presetHelper: PresetHelper; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected handbookHelper: HandbookHelper; protected ragfairServerHelper: RagfairServerHelper; protected eventOutputHolder: EventOutputHolder; protected localisationService: LocalisationService; @@ -71,7 +75,7 @@ export declare class RepeatableQuestController { 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, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, handbookHelper: HandbookHelper, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, 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. @@ -98,6 +102,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists + * @param repeatableConfig daily/weekly config + * @param pmcData Profile to search + * @returns IPmcDataRepeatableQuest + */ + protected getRepeatableQuestSubTypeFromProfile(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): IPmcDataRepeatableQuest; /** * This method is called by GetClientRepeatableQuests and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest @@ -106,17 +117,18 @@ export declare class RepeatableQuestController { /** * Just for debug reasons. Draws dailies a random assort of dailies extracted from dumps */ - generateDebugDailies(dailiesPool: any, factory: any, number: any): any; + generateDebugDailies(dailiesPool: any, factory: any, number: number): any; /** * Generates the base object of quest type format given as templates in assets/database/templates/repeatableQuests.json * The templates include Elimination, Completion and Extraction quest types * * @param {string} type quest type: "Elimination", "Completion" or "Extraction" * @param {string} traderId trader from which the quest will be provided + * @param {string} side scav daily or pmc daily/weekly quest * @returns {object} a object which contains the base elements for repeatable quests of the requests type * (needs to be filled with reward and conditions by called to make a valid quest) */ - generateRepeatableTemplate(type: string, traderId: string): IRepeatableQuest; + generateRepeatableTemplate(type: string, traderId: string, side: string): IRepeatableQuest; /** * Generates a valid Exploration quest * @@ -146,6 +158,12 @@ export declare class RepeatableQuestController { * @returns {object} object of quest type format for "Elimination" (see assets/database/templates/repeatableQuests.json) */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; + /** + * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * @param locationKey e.g factory4_day + * @returns guid + */ + protected getQuestLocationByMapId(locationKey: string): string; /** * Exploration repeatable quests can specify a required extraction point. * This method creates the according object which will be appended to the conditions array @@ -221,16 +239,17 @@ export declare class RepeatableQuestController { generateRewardItem(tpl: string, value: number, index: number, preset?: any): IReward; debugLogRepeatableQuestIds(pmcData: IPmcData): void; probabilityObjectArray(configArrayInput: ProbabilityObject[]): ProbabilityObjectArray; - changeRepeatableQuest(pmcDataIn: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; + changeRepeatableQuest(pmcData: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) - * @returns a list of rewardable items [[_tpl, itemTemplate],...] + * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * @param repeatableQuestConfig config file + * @returns a list of rewardable items [[_tpl, itemTemplate],...] */ protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [string, ITemplateItem][]; /** * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. - * @param {*} tpl template id of item to check + * @param {string} tpl template id of item to check * @returns boolean: true if item is valid reward */ isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean; diff --git a/Faupi-MunitionsExpert/server/types/controllers/TradeController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/TradeController.d.ts index 0ed0556..dc7de19 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/TradeController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/TradeController.d.ts @@ -1,20 +1,30 @@ -import { RagfairServer } from "../servers/RagfairServer"; +import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; -import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { ConfigServer } from "../servers/ConfigServer"; +import { RagfairServer } from "../servers/RagfairServer"; +import { LocalisationService } from "../services/LocalisationService"; +import { HttpResponseUtil } from "../utils/HttpResponseUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; + protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + protected httpResponse: HttpResponseUtil; + protected localisationService: LocalisationService; + protected configServer: ConfigServer; + protected ragfairConfig: IRagfairConfig; + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/Faupi-MunitionsExpert/server/types/controllers/TraderController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/TraderController.d.ts index d7afe95..b67aec9 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/TraderController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/TraderController.d.ts @@ -7,6 +7,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; +import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { @@ -17,10 +18,11 @@ export declare class TraderController { protected traderHelper: TraderHelper; protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; + protected traderPurchasePersisterService: TraderPurchasePersisterService; 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, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, 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/Faupi-MunitionsExpert/server/types/controllers/WishlistController.d.ts b/Faupi-MunitionsExpert/server/types/controllers/WishlistController.d.ts index 83be4b3..60c4a15 100644 --- a/Faupi-MunitionsExpert/server/types/controllers/WishlistController.d.ts +++ b/Faupi-MunitionsExpert/server/types/controllers/WishlistController.d.ts @@ -1,7 +1,7 @@ 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"; +import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; export declare class WishlistController { protected eventOutputHolder: EventOutputHolder; constructor(eventOutputHolder: EventOutputHolder); diff --git a/Faupi-MunitionsExpert/server/types/di/OnLoad.d.ts b/Faupi-MunitionsExpert/server/types/di/OnLoad.d.ts index 064d07d..a5cdea3 100644 --- a/Faupi-MunitionsExpert/server/types/di/OnLoad.d.ts +++ b/Faupi-MunitionsExpert/server/types/di/OnLoad.d.ts @@ -1,4 +1,4 @@ -export declare class OnLoad { - onLoad(): void; +export interface OnLoad { + onLoad(): Promise; getRoute(): string; } diff --git a/Faupi-MunitionsExpert/server/types/di/OnLoadOnUpdate.d.ts b/Faupi-MunitionsExpert/server/types/di/OnLoadOnUpdate.d.ts deleted file mode 100644 index 8bd3dc3..0000000 --- a/Faupi-MunitionsExpert/server/types/di/OnLoadOnUpdate.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { OnLoad } from "./OnLoad"; -import { OnUpdate } from "./OnUpdate"; -export declare class OnLoadOnUpdate implements OnLoad, OnUpdate { - onUpdate(timeSinceLastRun: number): boolean; - onLoad(): void; - getRoute(): string; -} diff --git a/Faupi-MunitionsExpert/server/types/di/OnUpdate.d.ts b/Faupi-MunitionsExpert/server/types/di/OnUpdate.d.ts index 7fbbe09..e1ce375 100644 --- a/Faupi-MunitionsExpert/server/types/di/OnUpdate.d.ts +++ b/Faupi-MunitionsExpert/server/types/di/OnUpdate.d.ts @@ -1,4 +1,4 @@ -export declare class OnUpdate { - onUpdate(timeSinceLastRun: number): boolean; +export interface OnUpdate { + onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/Faupi-MunitionsExpert/server/types/generators/BotEquipmentModGenerator.d.ts b/Faupi-MunitionsExpert/server/types/generators/BotEquipmentModGenerator.d.ts new file mode 100644 index 0000000..6703a36 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/generators/BotEquipmentModGenerator.d.ts @@ -0,0 +1,200 @@ +import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; +import { BotHelper } from "../helpers/BotHelper"; +import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ProbabilityHelper } from "../helpers/ProbabilityHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { Mods, ModsChances } from "../models/eft/common/tables/IBotType"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem"; +import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; +import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemFilterService } from "../services/ItemFilterService"; +import { LocalisationService } from "../services/LocalisationService"; +import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; +export declare class BotEquipmentModGenerator { + protected logger: ILogger; + protected jsonUtil: JsonUtil; + protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; + protected probabilityHelper: ProbabilityHelper; + protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; + protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemFilterService: ItemFilterService; + protected profileHelper: ProfileHelper; + protected botWeaponModLimitService: BotWeaponModLimitService; + protected botHelper: BotHelper; + protected botGeneratorHelper: BotGeneratorHelper; + protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected localisationService: LocalisationService; + protected botEquipmentModPoolService: BotEquipmentModPoolService; + protected configServer: ConfigServer; + protected botConfig: IBotConfig; + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + /** + * Check mods are compatible and add to array + * @param equipment Equipment item to add mods to + * @param modPool Mod list to choose frm + * @param parentId parentid of item to add mod to + * @param parentTemplate template objet of item to add mods to + * @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type + * @param botRole the bot role being generated for + * @param forceSpawn should this mod be forced to spawn + * @returns Item + compatible mods as an array + */ + generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, botRole: string, forceSpawn?: boolean): Item[]; + /** + * Add mods to a weapon using the provided mod pool + * @param sessionId session id + * @param weapon Weapon to add mods to + * @param modPool Pool of compatible mods to attach to weapon + * @param weaponParentId parentId of weapon + * @param parentTemplate Weapon which mods will be generated on + * @param modSpawnChances Mod spawn chances + * @param ammoTpl Ammo tpl to use when generating magazines/cartridges + * @param botRole Role of bot weapon is generated for + * @param botLevel lvel of the bot weapon is being generated for + * @param modLimits limits placed on certian mod types per gun + * @param botEquipmentRole role of bot when accessing bot.json equipment config settings + * @returns Weapon + mods array + */ + generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[]; + /** + * Is this modslot a front or rear sight + * @param modSlot Slot to check + * @returns true if it's a front/rear sight + */ + protected modIsFrontOrRearSight(modSlot: string): boolean; + /** + * Does the provided mod details show the mod can hold a scope + * @param modSlot e.g. mod_scope, mod_mount + * @param modsParentId Parent id of mod item + * @returns true if it can hold a scope + */ + protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean; + /** + * Set all scope mod chances to 100% + * @param modSpawnChances Chances objet to update + */ + protected setScopeSpawnChancesToFull(modSpawnChances: ModsChances): void; + protected sortModKeys(unsortedKeys: string[]): string[]; + /** + * Get a Slot property for an item (chamber/cartridge/slot) + * @param modSlot e.g patron_in_weapon + * @param parentTemplate item template + * @returns Slot item + */ + protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot; + /** + * randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot + * never return true for an item that has 0% spawn chance + * @param itemSlot slot the item sits in + * @param modSlot slot the mod sits in + * @param modSpawnChances Chances for various mod spawns + * @returns boolean true if it should spawn + */ + protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean; + /** + * + * @param modSlot Slot mod will fit into + * @param isRandomisableSlot Will generate a randomised mod pool if true + * @param modsParent Parent slot the item will be a part of + * @param botEquipBlacklist Blacklist to prevent mods from being picked + * @param itemModPool Pool of items to pick from + * @param weapon array with only weapon tpl in it, ready for mods to be added + * @param ammoTpl ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) + * @param parentTemplate Parent item the mod will go into + * @returns ITemplateItem + */ + protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem]; + /** + * Create a mod item with parameters as properties + * @param modId _id + * @param modTpl _tpl + * @param parentId parentId + * @param modSlot slotId + * @param modTemplate Used to add additional properites in the upd object + * @returns Item object + */ + protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item; + /** + * Get a list of containers that hold ammo + * e.g. mod_magazine / patron_in_weapon_000 + * @returns string array + */ + protected getAmmoContainers(): string[]; + /** + * Get a random mod from an items compatible mods Filter array + * @param modTpl ???? default value to return if nothing found + * @param parentSlot item mod will go into, used to get combatible items + * @param modSlot Slot to get mod to fill + * @param items items to ensure picked mod is compatible with + * @returns item tpl + */ + protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + /** + * Log errors if mod is not compatible with slot + * @param modToAdd template of mod to check + * @param itemSlot slot the item will be placed in + * @param modSlot slot the mod will fill + * @param parentTemplate template of the mods parent item + * @returns true if valid + */ + protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean; + /** + * Find mod tpls of a provided type and add to modPool + * @param desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope) + * @param modTemplate db object for modItem we get compatible mods from + * @param modPool Pool of mods we are adding to + */ + protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void; + /** + * Get the possible items that fit a slot + * @param parentItemId item tpl to get compatible items for + * @param modSlot Slot item should fit in + * @param botEquipBlacklist equipment that should not be picked + * @returns array of compatible items for that slot + */ + protected getDynamicModPool(parentItemId: string, modSlot: string, botEquipBlacklist: EquipmentFilterDetails): string[]; + /** + * Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist + * @param allowedMods base mods to filter + * @param botEquipBlacklist equipment blacklist + * @param modSlot slot mods belong to + * @returns Filtered array of mod tpls + */ + protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[]; + /** + * With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines. + * Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0. + * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. + * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" + * @param items The items where the CylinderMagazine's camora are appended to + * @param modPool modPool which should include available cartrigdes + * @param parentId The CylinderMagazine's UID + * @param parentTemplate The CylinderMagazine's template + */ + protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void; + /** + * Take a record of camoras and merge the compatable shells into one array + * @param camorasWithShells camoras we want to merge into one array + * @returns string array of shells fro luitple camora sources + */ + protected mergeCamoraPoolsTogether(camorasWithShells: Record): string[]; + /** + * Filter out non-whitelisted weapon scopes + * @param weapon Weapon scopes will be added to + * @param scopes Full scope pool + * @param botWeaponSightWhitelist whitelist of scope types by weapon base type + * @returns array of scope tpls that have been filtered + */ + protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record): string[]; +} diff --git a/Faupi-MunitionsExpert/server/types/generators/BotGenerator.d.ts b/Faupi-MunitionsExpert/server/types/generators/BotGenerator.d.ts index 08ad50a..9581259 100644 --- a/Faupi-MunitionsExpert/server/types/generators/BotGenerator.d.ts +++ b/Faupi-MunitionsExpert/server/types/generators/BotGenerator.d.ts @@ -1,16 +1,16 @@ import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper"; import { BotHelper } from "../helpers/BotHelper"; -import { GameEventHelper } from "../helpers/GameEventHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { Health as PmcHealth, IBotBase, Skills } from "../models/eft/common/tables/IBotBase"; -import { Health, IBotType, Inventory } from "../models/eft/common/tables/IBotType"; +import { Health as PmcHealth, IBotBase, Info, Skills } from "../models/eft/common/tables/IBotBase"; +import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -29,10 +29,10 @@ export declare class BotGenerator { protected weightedRandomHelper: WeightedRandomHelper; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; - protected gameEventHelper: GameEventHelper; + protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -42,23 +42,12 @@ export declare class BotGenerator { */ generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase; /** - * Generate an array of bot objects based on a condition for a raid with - * @param sessionId session id - * @param botGenerationDetails details on how to generate the bots - * @returns Generated bots in array + * Create x number of bots of the type/side/difficulty defined in botGenerationDetails + * @param sessionId Session id + * @param botGenerationDetails details on how to generate bots + * @returns array of bots */ - generateByCondition(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[]; - /** - * Get the PMCs wildSpawnType value - * @param role "usec" / "bear" - * @returns wildSpawnType value as string - */ - protected getPmcRoleByDescription(role: string): string; - /** - * Get a randomised PMC side based on bot config value 'isUsec' - * @returns pmc side as string - */ - protected getRandomisedPmcSide(): string; + prepareAndGenerateBots(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[]; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -94,11 +83,6 @@ export declare class BotGenerator { */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; - /** - * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) - * @param nodeInventory Bots inventory to iterate over - */ - protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; /** * Generate a random Id for a bot and apply to bots _id and aid value * @param bot bot to update @@ -107,11 +91,12 @@ export declare class BotGenerator { protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; /** - * Get the difficulty passed in, if its not "asoline", get selected difficulty from config - * @param requestedDifficulty - * @returns + * Randomise a bots game version and account category + * Chooses from all the game versions (standard, eod etc) + * Chooses account type (default, Sherpa, etc) + * @param botInfo bot info object to update */ - protected getPMCDifficulty(requestedDifficulty: string): string; + protected getRandomisedGameVersionAndCategory(botInfo: Info): void; /** * Add a side-specific (usec/bear) dogtag item to a bots inventory * @param bot bot to add dogtag to diff --git a/Faupi-MunitionsExpert/server/types/generators/BotInventoryGenerator.d.ts b/Faupi-MunitionsExpert/server/types/generators/BotInventoryGenerator.d.ts index a3b5eaa..83a548b 100644 --- a/Faupi-MunitionsExpert/server/types/generators/BotInventoryGenerator.d.ts +++ b/Faupi-MunitionsExpert/server/types/generators/BotInventoryGenerator.d.ts @@ -4,13 +4,15 @@ import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; -import { IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { EquipmentFilterDetails, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator"; import { BotLootGenerator } from "./BotLootGenerator"; import { BotWeaponGenerator } from "./BotWeaponGenerator"; export declare class BotInventoryGenerator { @@ -24,9 +26,11 @@ export declare class BotInventoryGenerator { protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; + protected botEquipmentModPoolService: BotEquipmentModPoolService; + protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -62,6 +66,13 @@ export declare class BotInventoryGenerator { * @param randomisationDetails settings from bot.json to adjust how item is generated */ protected generateEquipment(equipmentSlot: string, equipmentPool: Record, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory, randomisationDetails: RandomisationDetails): void; + /** + * Get all possible mods for item and filter down based on equipment blacklist from bot.json config + * @param itemTpl Item mod pool is being retreived and filtered + * @param equipmentBlacklist blacklist to filter mod pool with + * @returns Filtered pool of mods + */ + protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: EquipmentFilterDetails[]): Record; /** * Work out what weapons bot should have equipped and add them to bot inventory * @param templateInventory bot/x.json data from db diff --git a/Faupi-MunitionsExpert/server/types/generators/BotWeaponGenerator.d.ts b/Faupi-MunitionsExpert/server/types/generators/BotWeaponGenerator.d.ts index b2eaf3b..a68b82f 100644 --- a/Faupi-MunitionsExpert/server/types/generators/BotWeaponGenerator.d.ts +++ b/Faupi-MunitionsExpert/server/types/generators/BotWeaponGenerator.d.ts @@ -12,10 +12,12 @@ import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator"; import { IInventoryMagGen } from "./weapongen/IInventoryMagGen"; export declare class BotWeaponGenerator { protected jsonUtil: JsonUtil; @@ -28,11 +30,13 @@ export declare class BotWeaponGenerator { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected botWeaponModLimitService: BotWeaponModLimitService; + protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -85,9 +89,10 @@ export declare class BotWeaponGenerator { /** * Checks if all required slots are occupied on a weapon and all it's mods * @param weaponItemArray Weapon + mods + * @param botRole role of bot weapon is for * @returns true if valid */ - protected isWeaponValid(weaponItemArray: Item[]): boolean; + protected isWeaponValid(weaponItemArray: Item[], botRole: string): boolean; /** * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer @@ -97,6 +102,13 @@ export declare class BotWeaponGenerator { * @param botRole The bot type we're getting generating extra mags for */ addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + /** + * Add Grendaes for UBGL to bots vest and secure container + * @param weaponMods Weapon array with mods + * @param generatedWeaponResult result of weapon generation + * @param inventory bot inventory to add grenades to + */ + protected addUbglGrenadesToBotInventory(weaponMods: Item[], generatedWeaponResult: GenerateWeaponResult, inventory: PmcInventory): void; /** * Add ammo to the secure container * @param stackCount How many stacks of ammo to add @@ -133,6 +145,13 @@ export declare class BotWeaponGenerator { * @param ammoTpl */ protected fillExistingMagazines(weaponMods: Item[], magazine: Item, ammoTpl: string): void; + /** + * Add desired ammo tpl as item to weaponmods array, placed as child to UBGL + * @param weaponMods + * @param ubglMod + * @param ubglAmmoTpl + */ + protected fillUbgl(weaponMods: Item[], ubglMod: Item, ubglAmmoTpl: string): void; /** * Add cartridge item to weapon Item array, if it already exists, update * @param weaponMods Weapon items array to amend diff --git a/Faupi-MunitionsExpert/server/types/generators/LocationGenerator.d.ts b/Faupi-MunitionsExpert/server/types/generators/LocationGenerator.d.ts index cc61dcf..a617048 100644 --- a/Faupi-MunitionsExpert/server/types/generators/LocationGenerator.d.ts +++ b/Faupi-MunitionsExpert/server/types/generators/LocationGenerator.d.ts @@ -1,5 +1,4 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; -import { GameEventHelper } from "../helpers/GameEventHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; @@ -9,6 +8,8 @@ import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticL import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { LocalisationService } from "../services/LocalisationService"; +import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; import { MathUtil } from "../utils/MathUtil"; import { ObjectId } from "../utils/ObjectId"; @@ -26,12 +27,13 @@ export declare class LocationGenerator { protected ragfairServerHelper: RagfairServerHelper; protected itemHelper: ItemHelper; protected mathUtil: MathUtil; - protected gameEventHelper: GameEventHelper; + protected seasonalEventService: SeasonalEventService; protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, gameEventHelper: GameEventHelper, containerHelper: ContainerHelper, presetHelper: PresetHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; protected getLooseLootMultiplerForLocation(location: string): number; protected getStaticLootMultiplerForLocation(location: string): number; @@ -47,7 +49,8 @@ export declare class LocationGenerator { * Add forced spawn point loot into loot parameter array * @param loot array to add forced loot to * @param forcedSpawnPoints forced loot to add + * @param name of map currently generating forced loot for */ - protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[]): void; + protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[], locationName: string): void; protected createItem(tpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/Faupi-MunitionsExpert/server/types/generators/LootGenerator.d.ts b/Faupi-MunitionsExpert/server/types/generators/LootGenerator.d.ts index bc0d7ec..0d2ef24 100644 --- a/Faupi-MunitionsExpert/server/types/generators/LootGenerator.d.ts +++ b/Faupi-MunitionsExpert/server/types/generators/LootGenerator.d.ts @@ -6,6 +6,7 @@ import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; +import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; export declare class LootGenerator { @@ -14,8 +15,9 @@ export declare class LootGenerator { protected databaseServer: DatabaseServer; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/Faupi-MunitionsExpert/server/types/generators/PMCLootGenerator.d.ts b/Faupi-MunitionsExpert/server/types/generators/PMCLootGenerator.d.ts index b9f2a83..10918e3 100644 --- a/Faupi-MunitionsExpert/server/types/generators/PMCLootGenerator.d.ts +++ b/Faupi-MunitionsExpert/server/types/generators/PMCLootGenerator.d.ts @@ -3,6 +3,7 @@ import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; +import { SeasonalEventService } from "../services/SeasonalEventService"; /** * Handle the generation of dynamic PMC loot in pockets and backpacks * and the removal of blacklisted items @@ -12,10 +13,19 @@ export declare class PMCLootGenerator { protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; + protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService); + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); + /** + * Create an array of loot items a PMC can have in their pockets + * @returns string array of tpls + */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their backpack + * @returns string array of tpls + */ generatePMCBackpackLootPool(): string[]; } diff --git a/Faupi-MunitionsExpert/server/types/generators/PlayerScavGenerator.d.ts b/Faupi-MunitionsExpert/server/types/generators/PlayerScavGenerator.d.ts index bb2c730..3641268 100644 --- a/Faupi-MunitionsExpert/server/types/generators/PlayerScavGenerator.d.ts +++ b/Faupi-MunitionsExpert/server/types/generators/PlayerScavGenerator.d.ts @@ -1,4 +1,7 @@ +import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Skills, Stats } from "../models/eft/common/tables/IBotBase"; @@ -10,21 +13,30 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { BotLootCacheService } from "../services/BotLootCacheService"; import { FenceService } from "../services/FenceService"; +import { LocalisationService } from "../services/LocalisationService"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { BotGenerator } from "./BotGenerator"; export declare class PlayerScavGenerator { protected logger: ILogger; + protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; + protected hashUtil: HashUtil; + protected itemHelper: ItemHelper; + protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected botGeneratorHelper: BotGeneratorHelper; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected botHelper: BotHelper; protected jsonUtil: JsonUtil; protected fenceService: FenceService; protected botLootCacheService: BotLootCacheService; + protected localisationService: LocalisationService; protected botGenerator: BotGenerator; protected configServer: ConfigServer; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, botGenerator: BotGenerator, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/Faupi-MunitionsExpert/server/types/generators/RagfairAssortGenerator.d.ts b/Faupi-MunitionsExpert/server/types/generators/RagfairAssortGenerator.d.ts index db4811d..630e863 100644 --- a/Faupi-MunitionsExpert/server/types/generators/RagfairAssortGenerator.d.ts +++ b/Faupi-MunitionsExpert/server/types/generators/RagfairAssortGenerator.d.ts @@ -4,6 +4,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; export declare class RagfairAssortGenerator { @@ -11,10 +12,11 @@ export declare class RagfairAssortGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; + protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected generatedAssortItems: Item[]; protected ragfairConfig: IRagfairConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Get an array of unique items that can be sold on the flea * @returns array of unique items diff --git a/Faupi-MunitionsExpert/server/types/generators/RagfairOfferGenerator.d.ts b/Faupi-MunitionsExpert/server/types/generators/RagfairOfferGenerator.d.ts index 23882d2..35fceff 100644 --- a/Faupi-MunitionsExpert/server/types/generators/RagfairOfferGenerator.d.ts +++ b/Faupi-MunitionsExpert/server/types/generators/RagfairOfferGenerator.d.ts @@ -7,7 +7,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairOffer, OfferRequirement } from "../models/eft/ragfair/IRagfairOffer"; -import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; +import { Dynamic, IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -88,13 +88,49 @@ export declare class RagfairOfferGenerator { * Create multiple offers for items by using a unique list of items we've generated previously * @param expiredOffers optional, expired offers to regenerate */ - generateDynamicOffers(expiredOffers?: Item[]): void; + generateDynamicOffers(expiredOffers?: Item[]): Promise; + protected createOffersForItems(assortItemIndex: string, assortItemsToProcess: Item[], expiredOffers: Item[], config: Dynamic): Promise; + /** + * Create one flea offer for a specific item + * @param items Item to create offer for + * @param isPreset Is item a weapon preset + * @param itemDetails raw db item details + * @returns + */ + protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise; /** * Generate trader offers on flea using the traders assort data * @param traderID Trader to generate offers for */ generateFleaOffersForTrader(traderID: string): void; - protected getItemCondition(userID: string, items: Item[], itemDetails: ITemplateItem): Item[]; + /** + * Get array of an item with its mods + condition properties (e.g durability) + * Apply randomisation adjustments to condition if item base is found in ragfair.json/dynamic/condition + * @param userID id of owner of item + * @param itemWithMods Item and mods, get condition of first item (only first array item is used) + * @param itemDetails db details of first item + * @returns + */ + protected getItemCondition(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[]; + /** + * Get the relevant condition id if item tpl matches in ragfair.json/condition + * @param tpl Item to look for matching condition object + * @returns condition id + */ + protected getDynamicConditionIdForTpl(tpl: string): string; + /** + * Alter an items condition based on its item base type + * @param conditionSettingsId also the parentId of item being altered + * @param item Item to adjust condition details of + * @param itemDetails db item details of first item in array + */ + protected randomiseItemCondition(conditionSettingsId: string, item: Item, itemDetails: ITemplateItem): void; + /** + * Adjust an items durability/maxDurability value + * @param item item (weapon/armor) to adjust + * @param multiplier Value to multiple durability by + */ + protected randomiseDurabilityValues(item: Item, multiplier: number): void; /** * Add missing conditions to an item if needed * Durabiltiy for repairable items @@ -102,7 +138,7 @@ export declare class RagfairOfferGenerator { * @param item item to add conditions to * @returns Item with conditions added */ - protected addMissingCondition(item: Item): Item; + protected addMissingConditions(item: Item): Item; /** * Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based * @param offerItems Items for sale in offer @@ -110,7 +146,7 @@ export declare class RagfairOfferGenerator { */ protected createBarterRequirement(offerItems: Item[]): IBarterScheme[]; /** - * Get an array of flea prices + item tpl, cached in generator class + * Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter` * @returns array with tpl/price values */ protected getFleaPricesAsArray(): { diff --git a/Faupi-MunitionsExpert/server/types/generators/ScavCaseRewardGenerator.d.ts b/Faupi-MunitionsExpert/server/types/generators/ScavCaseRewardGenerator.d.ts index 89cb5c8..394eeb0 100644 --- a/Faupi-MunitionsExpert/server/types/generators/ScavCaseRewardGenerator.d.ts +++ b/Faupi-MunitionsExpert/server/types/generators/ScavCaseRewardGenerator.d.ts @@ -2,7 +2,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { Product } from "../models/eft/common/tables/IBotBase"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase"; -import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData"; import { IScavCaseConfig } from "../models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "../models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -28,21 +27,15 @@ export declare class ScavCaseRewardGenerator { constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build - * @param body client request + * @param recipeId recipe of the scav case craft * @returns Product array */ - generate(body: IHideoutScavCaseStartRequestData): Product[]; + generate(recipeId: string): Product[]; /** * Get all db items that are not blacklisted in scavcase config * @returns filtered array of db items */ protected getDbItems(): ITemplateItem[]; - /** - * Check if a template id has a blacklisted parent id - * @param tplid template id to check - * @returns true if item is blacklisted - */ - protected itemHasBlacklistedParent(tplid: string): boolean; /** * Pick a number of items to be rewards, the count is defined by the values in * @param items item pool to pick rewards from diff --git a/Faupi-MunitionsExpert/server/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts b/Faupi-MunitionsExpert/server/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts new file mode 100644 index 0000000..75395be --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts @@ -0,0 +1,10 @@ +import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper"; +import { IInventoryMagGen } from "../IInventoryMagGen"; +import { InventoryMagGen } from "../InventoryMagGen"; +export declare class UbglExternalMagGen implements IInventoryMagGen { + protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + constructor(botWeaponGeneratorHelper: BotWeaponGeneratorHelper); + getPriority(): number; + canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean; + process(inventoryMagGen: InventoryMagGen): void; +} diff --git a/Faupi-MunitionsExpert/server/types/helpers/AssortHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/AssortHelper.d.ts index bfc157f..13512b2 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/AssortHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/AssortHelper.d.ts @@ -2,28 +2,31 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { LocalisationService } from "../services/LocalisationService"; import { ItemHelper } from "./ItemHelper"; import { QuestHelper } from "./QuestHelper"; export declare class AssortHelper { protected logger: ILogger; protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; protected questHelper: QuestHelper; - constructor(logger: ILogger, itemHelper: ItemHelper, databaseServer: DatabaseServer, questHelper: QuestHelper); + constructor(logger: ILogger, itemHelper: ItemHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, questHelper: QuestHelper); /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile * @param traderId traders id * @param assort assort items from a trader + * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile * @param traderId traders id * @param assort traders assorts - * @returns traders assorts minus locked loyality assorts + * @returns traders assorts minus locked loyalty assorts */ stripLockedLoyaltyAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort): ITraderAssort; /** diff --git a/Faupi-MunitionsExpert/server/types/helpers/BotDifficultyHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/BotDifficultyHelper.d.ts index a58ebdb..df2c269 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/BotDifficultyHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/BotDifficultyHelper.d.ts @@ -20,7 +20,7 @@ export declare class BotDifficultyHelper { getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** * Get difficulty settings for desired bot type, if not found use assault bot types - * @param type bot type to retreive difficulty of + * @param type bot type to retrieve difficulty of * @param difficulty difficulty to get settings for (easy/normal etc) * @returns Difficulty object */ diff --git a/Faupi-MunitionsExpert/server/types/helpers/BotGeneratorHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/BotGeneratorHelper.d.ts index 9ee017f..c7dd606 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/BotGeneratorHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/BotGeneratorHelper.d.ts @@ -1,217 +1,42 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; -import { Mods, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; -import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem"; -import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; -import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; -import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; -import { BotHelper } from "./BotHelper"; -import { BotWeaponGeneratorHelper } from "./BotWeaponGeneratorHelper"; -import { ContainerHelper } from "./ContainerHelper"; -import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; -import { ProbabilityHelper } from "./ProbabilityHelper"; -import { ProfileHelper } from "./ProfileHelper"; -export declare class BotModLimits { - scope: ItemCount; - scopeMax: number; - scopeBaseTypes: string[]; - flashlightLaser: ItemCount; - flashlightLaserMax: number; - flashlgihtLaserBaseTypes: string[]; -} -export declare class ItemCount { - count: number; -} export declare class BotGeneratorHelper { protected logger: ILogger; - protected jsonUtil: JsonUtil; - protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected probabilityHelper: ProbabilityHelper; protected databaseServer: DatabaseServer; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; - protected inventoryHelper: InventoryHelper; - protected containerHelper: ContainerHelper; - protected botEquipmentFilterService: BotEquipmentFilterService; - protected itemFilterService: ItemFilterService; - protected profileHelper: ProfileHelper; - protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; - protected botHelper: BotHelper; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botHelper: BotHelper, localisationService: LocalisationService, configServer: ConfigServer); - /** - * Check mods are compatible and add to array - * @param equipment Equipment item to add mods to - * @param modPool Mod list to choose frm - * @param parentId parentid of item to add mod to - * @param parentTemplate template objet of item to add mods to - * @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type - * @param botRole the bot role being generated for - * @param forceSpawn should this mod be forced to spawn - * @returns Item + compatible mods as an array - */ - generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, botRole: string, forceSpawn?: boolean): Item[]; - /** - * Add mods to a weapon using the provided mod pool - * @param sessionId session id - * @param weapon Weapon to add mods to - * @param modPool Pool of compatible mods to attach to weapon - * @param weaponParentId parentId of weapon - * @param parentWeaponTemplate Weapon which mods will be generated on - * @param modSpawnChances Mod spawn chances - * @param ammoTpl Ammo tpl to use when generating magazines/cartridges - * @param botRole Role of bot weapon is generated for - * @returns Weapon + mods array - */ - generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentWeaponTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number): Item[]; - /** - * - * @param modSlot Slot mod will fit into - * @param isRandomisableSlot Will generate a randomised mod pool if true - * @param modsParent Parent slot the item will be a part of - * @param botEquipBlacklist Blacklist to prevent mods from being picked - * @param itemModPool Pool of items to pick from - * @param weapon array with only weapon tpl in it, ready for mods to be added - * @param ammoTpl ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) - * @param parentTemplate Parent item the mod will go into - * @returns ITemplateItem - */ - protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, modsParent: Slot, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem]; - /** - * Find mod tpls of a provided type and add to modPool - * @param desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope) - * @param modTemplate db object for modItem we get compatible mods from - * @param modPool Pool of mods we are adding to - */ - protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void; - /** - * Check if mod item is on limited list + has surpassed the limit set for it - * @param botRole role the bot has e.g. assault - * @param modTemplate mods template data - * @param modLimits limits set for weapon being generated for this bot - * @returns true if over item limit - */ - protected modHasReachedItemLimit(botRole: string, modTemplate: ITemplateItem, modLimits: BotModLimits): boolean; - /** - * Initalise mod limits to be used when generating a weapon - * @param botRole "assault", "bossTagilla" or "pmc" - * @returns BotModLimits object - */ - protected initModLimits(botRole: string): BotModLimits; - /** - * Generate a pool of mods for this bots mod type if bot has values inside `randomisedWeaponModSlots` array found in bot.json/equipment[botrole] - * @param allowedMods Mods to be added to mod pool - * @param botEquipBlacklist blacklist of items not allowed to be added to mod pool - * @param modSlot Slot to generate mods for - * @param itemModPool base mod pool to replace values of - */ - protected generateDynamicWeaponModPool(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string, itemModPool: Record): void; - /** - * Find all compatible mods for equipment item and add to modPool - * @param itemDetails item to find mods for - * @param modPool ModPool to add mods to - * @param equipmentBlacklist equipment not allowed to be used by the bot - * @param botEquipmentRole bot type to generate pool for (e.g. assault, pmcBot, pmc for usec/bear) - */ - generateDynamicModPool(itemDetails: ITemplateItem, modPool: Mods, equipmentBlacklist: EquipmentFilterDetails[], botEquipmentRole: string): void; - /** - * Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist - * @param allowedMods base mods to filter - * @param botEquipBlacklist equipment blacklist - * @param modSlot slot mods belong to - * @returns Filtered array of mod tpls - */ - protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[]; - /** - * Check if the specific item type on the weapon has reached the set limit - * @param modTpl log mod tpl if over type limit - * @param currentCount current number of this item on gun - * @param maxLimit mod limit allowed - * @param botRole role of bot we're checking weapon of - * @returns true if limit reached - */ - protected weaponModLimitReached(modTpl: string, currentCount: { - count: number; - }, maxLimit: number, botRole: string): boolean; - /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param itemSlot slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate tempalte of the mods parent item - * @returns true if valid - */ - protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean; - /** - * Create a mod item with parameters as properties - * @param modId _id - * @param modTpl _tpl - * @param parentId parentId - * @param modSlot slotId - * @param modTemplate Used to add additional properites in the upd object - * @returns Item object - */ - protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item; - /** - * randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot - * never return true for an item that has 0% spawn chance - * @param itemSlot slot the item sits in - * @param modSlot slot the mod sits in - * @param modSpawnChances Chances for various mod spawns - * @returns boolean true if it should spawn - */ - protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean; - /** - * Get a list of containers that hold ammo - * e.g. mod_magazine / patron_in_weapon_000 - * @returns string array - */ - protected getAmmoContainers(): string[]; - /** - * Get a Slot property for an item (chamber/cartridge/slot) - * @param modSlot e.g patron_in_weapon - * @param parentTemplate item template - * @returns Slot item - */ - protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot; - /** - * With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines. - * Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0. - * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. - * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" - * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes - * @param parentId The CylinderMagazine's UID - * @param parentTemplate The CylinderMagazine's template - */ - protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void; - /** - * Take a record of camoras and merge the compatable shells into one array - * @param camorasWithShells camoras we want to merge into one array - * @returns string array of shells fro luitple camora sources - */ - protected mergeCamoraPoolsTogether(camorasWithShells: Record): string[]; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability * @param itemTemplate Item extra properties are being generated for - * @param botRole Used by weapons to randomise the durability values. Null for non-equipped items + * @param botRole Used by weapons to randomize the durability values. Null for non-equipped items * @returns Item Upd object with extra properties */ generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): { upd?: Upd; }; + /** + * Get the chance for the weapon attachment or helmet equipment to be set as activated + * @param botRole role of bot with weapon/helmet + * @param setting the setting of the weapon attachment/helmet equipment to be activated + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @returns Percent chance to be active + */ + protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for @@ -227,22 +52,16 @@ export declare class BotGeneratorHelper { */ protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; /** - * Get a random mod from an items compatible mods Filter array - * @param modTpl ???? - * @param parentSlot item mod will go into, used to get combatible items - * @param modSlot Slot to get mod to fill - * @param items items to ensure picked mod is compatible with - * @returns item tpl - */ - protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; - /** - * Can an item be added to an item without issue - * @param items items to check compatiblilities with - * @param tplToCheck tpl of the item to check for incompatibilities + * Can item be added to another item without conflict + * @param items Items to check compatibilities with + * @param tplToCheck Tpl of the item to check for incompatibilities * @param equipmentSlot Slot the item will be placed into - * @returns false if no incompatibilties + * @returns false if no incompatibilities, also has incompatibility reason */ - isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): boolean; + isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): { + incompatible: boolean; + reason: string; + }; /** * Convert a bots role to the equipment role used in config/bot.json * @param botRole Role to convert diff --git a/Faupi-MunitionsExpert/server/types/helpers/BotHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/BotHelper.d.ts index 2752a0e..3b49501 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/BotHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/BotHelper.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -22,11 +23,11 @@ export declare class BotHelper { */ getBotTemplate(role: string): IBotType; /** - * Randomise the chance the PMC will attack their own side + * Randomize the chance the PMC will attack their own side * Look up value in bot.json/chanceSameSideIsHostilePercent * @param difficultySettings pmc difficulty settings */ - randomisePmcHostility(difficultySettings: Difficulty): void; + randomizePmcHostility(difficultySettings: Difficulty): void; /** * Is the passed in bot role a PMC (usec/bear/pmc) * @param botRole bot role to check @@ -59,11 +60,29 @@ export declare class BotHelper { * @returns true if should be a pmc */ shouldBotBePmc(botRole: string): boolean; + rollChanceToBePmc(role: string, botConvertMinMax: MinMax): boolean; + botRoleIsPmc(botRole: string): boolean; /** - * Get randomisation settings for bot from config/bot.json + * Get randomization settings for bot from config/bot.json * @param botLevel level of bot * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomisationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + /** + * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * @returns pmc role + */ + getRandomizedPmcRole(): string; + /** + * Get the corresponding side when sptBear or sptUsec is passed in + * @param botRole role to get side for + * @returns side (usec/bear) + */ + getPmcSideByRole(botRole: string): string; + /** + * Get a randomized PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomizedPmcSide(): string; } diff --git a/Faupi-MunitionsExpert/server/types/helpers/BotWeaponGeneratorHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/BotWeaponGeneratorHelper.d.ts index 7e25f56..cefc3bd 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -2,8 +2,10 @@ import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { EquipmentSlots } from "../models/enums/EquipmentSlots"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; @@ -16,21 +18,22 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** - * Get a randomised number of bullets for a specific magazine + * Get a randomized number of bullets for a specific magazine * @param magCounts min and max count of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomisedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; /** - * Get a randomised count of magazines + * Get a randomized count of magazines * @param magCounts min and max value returned value can be between - * @returns numberical value of magazine count + * @returns numerical value of magazine count */ - getRandomisedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: MinMax): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -46,12 +49,13 @@ export declare class BotWeaponGeneratorHelper { */ createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** - * Add a specific number of cartrdiges to a bots inventory (vest/pocket) + * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets * @param cartridgeCount number of cartridges to add to vest/pockets * @param inventory bot inventory to add cartridges to + * @param equipmentSlotsToAddTo what equipment slots should bullets be added into */ - addBulletsToVestAndPockets(ammoTpl: string, cartridgeCount: number, inventory: Inventory): void; + addAmmoIntoEquipmentSlots(ammoTpl: string, cartridgeCount: number, inventory: Inventory, equipmentSlotsToAddTo?: EquipmentSlots[]): void; /** * Get a weapons default magazine template id * @param weaponTemplate weapon to get default magazine for @@ -59,7 +63,8 @@ export declare class BotWeaponGeneratorHelper { */ getWeaponsDefaultMagazineTpl(weaponTemplate: ITemplateItem): string; /** - * Adds an item with all its childern into specified equipmentSlots, wherever it fits. + * TODO - move into BotGeneratorHelper, this is not the class for it + * Adds an item with all its children into specified equipmentSlots, wherever it fits. * @param equipmentSlots * @param parentId * @param parentTpl diff --git a/Faupi-MunitionsExpert/server/types/helpers/DialogueHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/DialogueHelper.d.ts index 88a726e..8f03b81 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/DialogueHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/DialogueHelper.d.ts @@ -4,6 +4,7 @@ import { MessageType } from "../models/enums/MessageType"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; +import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; @@ -15,8 +16,9 @@ export declare class DialogueHelper { protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; + protected localisationService: LocalisationService; protected itemHelper: ItemHelper; - constructor(logger: ILogger, 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, localisationService: LocalisationService, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. diff --git a/Faupi-MunitionsExpert/server/types/helpers/DurabilityLimitsHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/DurabilityLimitsHelper.d.ts index 07a5db1..7122376 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/DurabilityLimitsHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/DurabilityLimitsHelper.d.ts @@ -9,10 +9,10 @@ export declare class DurabilityLimitsHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; constructor(randomUtil: RandomUtil, botHelper: BotHelper, configServer: ConfigServer); - getRandomisedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; - getRandomisedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; - getRandomisedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - getRandomisedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; protected generateMaxWeaponDurability(botRole: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; protected getLowestMaxWeaponFromConfig(botRole: string): number; @@ -23,4 +23,6 @@ export declare class DurabilityLimitsHelper { protected getMaxWeaponDeltaFromConfig(botRole: string): number; protected getMinArmorDeltaFromConfig(botRole: string): number; protected getMaxArmorDeltaFromConfig(botRole: string): number; + protected getMinArmorLimitPercentFromConfig(botRole: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole: string): number; } diff --git a/Faupi-MunitionsExpert/server/types/helpers/GameEventHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/GameEventHelper.d.ts index fa25eff..f502c95 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/GameEventHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/GameEventHelper.d.ts @@ -1,4 +1,4 @@ -import { ISeasonalEvent, ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig"; +import { ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; export declare class GameEventHelper { @@ -6,24 +6,4 @@ export declare class GameEventHelper { protected configServer: ConfigServer; protected seasonalEventConfig: ISeasonalEventConfig; constructor(databaseServer: DatabaseServer, configServer: ConfigServer); - get events(): Record; - get christmasEventItems(): string[]; - itemIsChristmasRelated(itemId: string): boolean; - christmasEventEnabled(): boolean; - /** - * Get the dates each seasonal event starts and ends - * @returns Record with event name + start/end date - */ - getEventDetails(): ISeasonalEvent[]; - /** - * Is detection of seasonal events enabled (halloween / christmas) - * @returns true if seasonal events should be checked for - */ - isAutomaticEventDetectionEnabled(): boolean; - /** - * Get a dictionary of gear changes to apply to bots for a specific event e.g. Christmas/Halloween - * @param eventName Name of event to get gear changes for - * @returns bots with equipment changes - */ - getEventBotGear(eventName: string): Record>>; } diff --git a/Faupi-MunitionsExpert/server/types/helpers/HandbookHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/HandbookHelper.d.ts index 1ab7800..aa329a9 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/HandbookHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/HandbookHelper.d.ts @@ -11,6 +11,7 @@ export declare class LookupCollection { } export declare class HandbookHelper { protected databaseServer: DatabaseServer; + protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; constructor(databaseServer: DatabaseServer); hydrateLookup(): void; @@ -35,18 +36,18 @@ export declare class HandbookHelper { isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Convert currency into roubles - * @param {number} value - * @param {string} currencyFrom - * @returns get rouble value of inputted currency - */ - inRUB(value: number, currencyFrom: string): number; - /** - * Gets Ruble to Currency conversion Value - * @param {number} value - * @param {string} currencyTo - * @returns number + * Convert non-roubles into roubles + * @param nonRoubleCurrencyCount Currency count to convert + * @param currencyTypeFrom What current currency is + * @returns Count in roubles */ - fromRUB(value: number, currencyTo: string): number; + inRUB(nonRoubleCurrencyCount: number, currencyTypeFrom: string): number; + /** + * Convert roubles into another currency + * @param roubleCurrencyCount roubles to convert + * @param currencyTypeTo Currency to convert roubles into + * @returns currency count in desired type + */ + fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; } export {}; diff --git a/Faupi-MunitionsExpert/server/types/helpers/HealthHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/HealthHelper.d.ts index 3116c9c..7a6d41d 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/HealthHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/HealthHelper.d.ts @@ -1,6 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; -import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { Effects, IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IHealthConfig } from "../models/spt/config/IHealthConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -16,7 +16,7 @@ export declare class HealthHelper { protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); /** - * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * Resets the profiles vitality/health and vitality/effects properties to their defaults * @param sessionID Session Id * @returns updated profile */ @@ -24,28 +24,34 @@ export declare class HealthHelper { /** * Update player profile with changes from request object * @param pmcData Player profile - * @param info Request object + * @param request Heal request * @param sessionID Session id * @param addEffects Should effects be added or removed (default - add) */ - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; + /** + * Adjust hydration/energy/temperate and body part hp values in player profile to values in profile.vitality + * @param pmcData Profile to update + * @param sessionId Session id + */ protected saveHealth(pmcData: IPmcData, sessionID: string): void; /** * Save effects to profile * Works by removing all effects and adding them back from profile - * Remoces empty 'Effects' objects if found + * Removes empty 'Effects' objects if found * @param pmcData Player profile - * @param sessionID Session id + * @param sessionId Session id + * @param bodyPartsWithEffects dict of body parts with effects that should be added to profile * @param addEffects Should effects be added back to profile - * @returns */ - protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + protected saveEffects(pmcData: IPmcData, sessionId: string, bodyPartsWithEffects: Effects, deleteExistingEffects?: boolean): void; /** * Add effect to body part in profile * @param pmcData Player profile * @param effectBodyPart body part to edit * @param effectType Effect to add to body part + * @param duration How long the effect has left in seconds (-1 by default, no duration). */ - protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string, duration?: number): void; protected isEmpty(map: any): boolean; } diff --git a/Faupi-MunitionsExpert/server/types/helpers/HideoutHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/HideoutHelper.d.ts index 9d51fed..a5849e3 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/HideoutHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/HideoutHelper.d.ts @@ -1,8 +1,9 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Common, HideoutArea, Production, Productive } from "../models/eft/common/tables/IBotBase"; +import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "../models/eft/common/tables/IBotBase"; import { Upd } from "../models/eft/common/tables/IItem"; import { StageBonus } from "../models/eft/hideout/IHideoutArea"; -import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; +import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; +import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData"; import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -15,7 +16,6 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { HashUtil } from "../utils/HashUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; -import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { InventoryHelper } from "./InventoryHelper"; import { ProfileHelper } from "./ProfileHelper"; @@ -23,7 +23,6 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -36,11 +35,13 @@ export declare class HideoutHelper { static waterCollector: string; static bitcoin: string; static expeditionaryFuelTank: string; + static maxSkillPoint: number; + private static generatorOffMultipler; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, configServer: ConfigServer); - registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, configServer: ConfigServer); + registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** - * This convinience function intialies new Production Object + * This convenience function initializes new Production Object * with all the constants. */ initProduction(recipeId: string, productionTime: number): Production; @@ -81,6 +82,26 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; + /** + * Update a productions progress value based on the amount of time that has passed + * @param pmcData Player profile + * @param prodId Production id being crafted + * @param recipe Recipe data being crafted + * @param hideoutProperties + */ + protected updateProductionProgress(pmcData: IPmcData, prodId: string, recipe: IHideoutProduction, hideoutProperties: { + btcFarmCGs?: number; + isGeneratorOn: boolean; + waterCollectorHasFilter?: boolean; + }): void; + /** + * Check if a productions progress value matches its corresponding recipes production time value + * @param pmcData Player profile + * @param prodId Production id + * @param recipe Recipe being crafted + * @returns progress matches productionTime from recipe + */ + protected doesProgressMatchProductionTime(pmcData: IPmcData, prodId: string): boolean; /** * Update progress timer for scav case * @param pmcData Profile to update @@ -105,7 +126,7 @@ export declare class HideoutHelper { * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update * @param production production object - * @param isGeneratorOn is generatory enabled + * @param isGeneratorOn is generator enabled * @param pmcData Player profile * @returns Updated HideoutArea object */ @@ -113,11 +134,53 @@ export declare class HideoutHelper { protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): void; protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + /** + * Get a count of how many BTC can be gathered by the profile + * @param pmcData Profile to look up + * @returns coin slot count + */ protected getBTCSlots(pmcData: IPmcData): number; protected getManagementSkillsSlots(): number; protected hasManagementSkillSlots(pmcData: IPmcData): boolean; protected getHideoutManagementSkill(pmcData: IPmcData): Common; protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; + /** + * Get the crafting skill details from player profile + * @param pmcData Player profile + * @returns crafting skill, null if not found + */ + protected getCraftingSkill(pmcData: IPmcData): Common; + /** + * Adjust craft time based on crafting skill level found in player profile + * @param pmcData Player profile + * @param productionTime Time to complete hideout craft in seconds + * @returns Adjusted craft time in seconds + */ + protected getCraftingSkillProductionTimeReduction(pmcData: IPmcData, productionTime: number): number; isProduction(productive: Productive): productive is Production; - getBTC(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Gather crafted BTC from hideout area and add to inventory + * Reset production start timestamp if hideout area at full coin capacity + * @param pmcData Player profile + * @param request Take production request + * @param sessionId Session id + * @returns IItemEventRouterResponse + */ + getBTC(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Upgrade hideout wall from starting level to interactable level if enough time has passed + * @param pmcProfile Profile to upgrade wall in + */ + unlockHideoutWallInProfile(pmcProfile: IPmcData): void; + /** + * Hideout improvement is flagged as complete + * @param improvement hideout improvement object + * @returns true if complete + */ + protected hideoutImprovementIsComplete(improvement: IHideoutImprovement): boolean; + /** + * Iterate over hideout improvements not completed and check if they need to be adjusted + * @param pmcProfile Profile to adjust + */ + setHideoutImprovementsToCompleted(pmcProfile: IPmcData): void; } diff --git a/Faupi-MunitionsExpert/server/types/helpers/InRaidHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/InRaidHelper.d.ts index 962df38..c69a810 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/InRaidHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/InRaidHelper.d.ts @@ -5,6 +5,7 @@ import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; +import { LocalisationService } from "../services/LocalisationService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { JsonUtil } from "../utils/JsonUtil"; import { InventoryHelper } from "./InventoryHelper"; @@ -16,8 +17,9 @@ export declare class InRaidHelper { protected databaseServer: DatabaseServer; protected inventoryHelper: InventoryHelper; protected paymentHelper: PaymentHelper; + protected localisationService: LocalisationService; protected profileFixerService: ProfileFixerService; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, profileFixerService: ProfileFixerService); + constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService); /** * Check an array of items and add an upd object to money items with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues @@ -38,10 +40,16 @@ export declare class InRaidHelper { * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data - * @param sessionID Sessino id + * @param sessionID Session id * @returns Reset profile object */ updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): IPmcData; + /** + * Take body part effects from client profile and apply to server profile + * @param saveProgressRequest post-raid request + * @param profileData player profile on server + */ + protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -58,7 +66,7 @@ export declare class InRaidHelper { * Adds SpawnedInSession property to items found in a raid * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true * @param preRaidProfile profile to update - * @param postRaidProfile profile to upate inventory contents of + * @param postRaidProfile profile to update inventory contents of * @param isPlayerScav Was this a p scav raid * @returns */ diff --git a/Faupi-MunitionsExpert/server/types/helpers/InventoryHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/InventoryHelper.d.ts index 6419f93..8855d1e 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/InventoryHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/InventoryHelper.d.ts @@ -1,6 +1,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; -import { IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData"; +import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData"; +import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; @@ -43,7 +44,44 @@ export declare class InventoryHelper { protected configServer: ConfigServer; protected inventoryConfig: IInventoryConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, httpResponse: HttpResponseUtil, fenceService: FenceService, databaseServer: DatabaseServer, paymentHelper: PaymentHelper, traderAssortHelper: TraderAssortHelper, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, containerHelper: ContainerHelper, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer); - addItem(pmcData: IPmcData, body: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: any, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse; + /** + * BUG: Passing the same item multiple times with a count of 1 will cause multiples of that item to be added (e.g. x3 separate objects of tar cola with count of 1 = 9 tarcolas being added to inventory) + * @param pmcData Profile to add items to + * @param request request data to add items + * @param output response to send back to client + * @param sessionID Session id + * @param callback Code to execute later (function) + * @param foundInRaid Will results added to inventory be set as found in raid + * @param addUpd Additional upd properties for items being added to inventory + * @returns IItemEventRouterResponse + */ + addItem(pmcData: IPmcData, request: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: { + (): void; + }, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse; + /** + * Add ammo to ammo boxes + * @param itemToAdd Item to check is ammo box + * @param toDo + * @param output IItemEventRouterResponse object + * @param sessionID Session id + * @param pmcData Profile to add ammobox to + */ + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, toDo: string[][], sessionID: string, output: IItemEventRouterResponse): void; + /** + * + * @param assortItems Items to add to inventory + * @param requestItem Details of purchased item to add to inventory + * @param result Array split stacks are added to + */ + protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; + /** + * Remove item from player inventory + * @param pmcData Profile to remove item from + * @param itemId Items id to remove + * @param sessionID Session id + * @param output Existing IItemEventRouterResponse object to append data to, creates new one by default if not supplied + * @returns IItemEventRouterResponse + */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): Record; diff --git a/Faupi-MunitionsExpert/server/types/helpers/ItemHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/ItemHelper.d.ts index fc88a46..de424d2 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/ItemHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/ItemHelper.d.ts @@ -5,12 +5,15 @@ import { IStaticAmmoDetails } from "../models/eft/common/tables/ILootBase"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocaleService } from "../services/LocaleService"; +import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { MathUtil } from "../utils/MathUtil"; import { ObjectId } from "../utils/ObjectId"; import { RandomUtil } from "../utils/RandomUtil"; +import { HandbookHelper } from "./HandbookHelper"; declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; @@ -19,22 +22,32 @@ declare class ItemHelper { protected objectId: ObjectId; protected mathUtil: MathUtil; protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemBaseClassService: ItemBaseClassService; + protected localisationService: LocalisationService; protected localeService: LocaleService; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl - * @returns boolean; true for items that may be in player posession and not quest items + * @returns boolean; true for items that may be in player possession and not quest items */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** * Check if the tpl / template Id provided is a descendent of the baseclass * * @param {string} tpl the item template id to check - * @param {string} baseclassTpl the baseclass to check for + * @param {string} baseClassTpl the baseclass to check for * @return {boolean} is the tpl a descendent? */ - isOfBaseclass(tpl: string, baseclassTpl: string): boolean; + isOfBaseclass(tpl: string, baseClassTpl: string): boolean; + /** + * Check if item has any of the supplied base classes + * @param tpl Item to check base classes of + * @param baseClassTpls base classes to check for + * @returns true if any supplied base classes match + */ + isOfBaseclasses(tpl: string, baseClassTpls: string[]): boolean; /** * Returns the item price based on the handbook or as a fallback from the prices.json if the item is not * found in the handbook. If the price can't be found at all return 0 @@ -152,7 +165,7 @@ declare class ItemHelper { */ getChildId(item: Item): string; /** - * Can the pased in item be stacked + * Can the passed in item be stacked * @param tpl item to check * @returns true if it can be stacked */ @@ -179,7 +192,7 @@ declare class ItemHelper { */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** - * Recursivly loop down through an items hierarchy to see if any of the ids match the supplied list, return true if any do + * WARNING, SLOW. Recursively loop down through an items hierarchy to see if any of the ids match the supplied list, return true if any do * @param {string} tpl * @param {Array} tplsToCheck * @returns boolean @@ -207,7 +220,15 @@ declare class ItemHelper { createRandomMagCartridges(magTemplate: ITemplateItem, parentId: string, staticAmmoDist: Record, caliber?: string): Item; protected getRandomValidCaliber(magTemplate: ITemplateItem): string; protected drawAmmoTpl(caliber: string, staticAmmoDist: Record): string; - createCartidges(parentId: string, ammoTpl: string, stackCount: number): Item; + /** + * + * @param parentId container cartridges will be placed in + * @param ammoTpl Cartridge to insert + * @param stackCount Count of cartridges inside parent + * @param location Location inside parent (e.g. 0, 1) + * @returns Item + */ + createCartridges(parentId: string, ammoTpl: string, stackCount: number, location: number): Item; /** * Get the size of a stack, return 1 if no stack object count property found * @param item Item to get stack size of diff --git a/Faupi-MunitionsExpert/server/types/helpers/NotificationSendHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/NotificationSendHelper.d.ts index 014ac95..c80f22d 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/NotificationSendHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/NotificationSendHelper.d.ts @@ -6,7 +6,7 @@ export declare class NotificationSendHelper { protected notificationService: NotificationService; constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** - * Send notification message to the appropiate channel + * Send notification message to the appropriate channel */ sendMessage(sessionID: string, notificationMessage: INotification): void; } diff --git a/Faupi-MunitionsExpert/server/types/helpers/PresetHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/PresetHelper.d.ts index a469582..cea210e 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/PresetHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/PresetHelper.d.ts @@ -5,8 +5,10 @@ export declare class PresetHelper { protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; + protected defaultPresets: Record; constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; + getDefaultPresets(): Record; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): Preset; diff --git a/Faupi-MunitionsExpert/server/types/helpers/ProfileHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/ProfileHelper.d.ts index 9c6560a..79652ad 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/ProfileHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/ProfileHelper.d.ts @@ -5,7 +5,6 @@ import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNic import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; -import { FenceService } from "../services/FenceService"; import { ProfileSnapshotService } from "../services/ProfileSnapshotService"; import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -20,9 +19,13 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - protected fenceService: FenceService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService); + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); resetProfileQuestCondition(sessionID: string, conditionId: string): void; + /** + * Get all profiles from server + * @returns Dictionary of profiles + */ + getProfiles(): Record; getCompleteProfile(sessionID: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen @@ -41,7 +44,7 @@ export declare class ProfileHelper { /** * Add experience to a PMC inside the players profile * @param sessionID Session id - * @param experienceToAdd Experiecne to add to PMC character + * @param experienceToAdd Experience to add to PMC character */ addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; diff --git a/Faupi-MunitionsExpert/server/types/helpers/QuestHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/QuestHelper.d.ts index edbd2e1..de7cba2 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/QuestHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/QuestHelper.d.ts @@ -1,8 +1,9 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { Quest } from "../models/eft/common/tables/IBotBase"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; -import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData"; +import { IFailQuestRequestData } from "../models/eft/quests/IFailQuestRequestData"; import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -10,6 +11,7 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; +import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -32,15 +34,16 @@ export declare class QuestHelper { protected dialogueHelper: DialogueHelper; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected localisationService: LocalisationService; protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search * @param questID Quest id to look up - * @returns QuestStauts enum + * @returns QuestStatus enum */ getQuestStatus(pmcData: IPmcData, questID: string): QuestStatus; /** @@ -52,7 +55,7 @@ export declare class QuestHelper { doesPlayerLevelFulfilCondition(playerLevel: number, condition: AvailableForConditions): boolean; /** * Get the quests found in both arrays (inner join) - * @param before Array of qeusts #1 + * @param before Array of quests #1 * @param after Array of quests #2 * @returns Reduction of cartesian product between two quest arrays */ @@ -61,22 +64,21 @@ export declare class QuestHelper { * Increase skill points of a skill on player profile * @param sessionID Session id * @param pmcData Player profile - * @param output output object to send back to client * @param skillName Name of skill to increase skill points of * @param progressAmount Amount of skill points to add to skill */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, output: IItemEventRouterResponse, skillName: string, progressAmount: number): void; - getQuestLocale(questId: string): any; + rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; /** - * Debug Routine for showing some information on the - * quest list in question. + * Get quest name by quest id + * @param questId id to get + * @returns */ - dumpQuests(quests: any): void; + getQuestNameFromLocale(questId: string): string; /** - * Check if trader has sufficient loyalty to fullfill quest requirement + * Check if trader has sufficient loyalty to fulfill quest requirement * @param questProperties Quest props * @param profile Player profile - * @returns true if loyalty is high enough to fulfil quest requirement + * @returns true if loyalty is high enough to fulfill quest requirement */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; protected processReward(reward: Reward): Reward[]; @@ -88,12 +90,12 @@ export declare class QuestHelper { */ getQuestRewardItems(quest: IQuest, state: QuestStatus): Reward[]; /** - * Update player profile with quest status (e.g. Fail/Success) - * @param pmcData profile to add quest to - * @param newState state the new quest should be in when added - * @param acceptedQuest Details of quest being added + * Look up quest in db by accepted quest id and construct a profile-ready object ready to store in profile + * @param pmcData Player profile + * @param newState State the new quest should be in when returned + * @param acceptedQuest Details of accepted quest from client */ - addQuestToPMCData(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): void; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; /** * TODO: what is going on here * @param acceptedQuestId Quest to add to profile @@ -109,12 +111,12 @@ export declare class QuestHelper { */ failedUnlocked(failedQuestId: string, sessionID: string): IQuest[]; /** - * Adjust quest money rewards by passed in multipler + * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards - * @param multipler Value to adjust money rewards by + * @param multiplier Value to adjust money rewards by * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multipler: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization @@ -125,12 +127,6 @@ export declare class QuestHelper { * @param output ItemEvent router response */ changeItemStack(pmcData: IPmcData, itemId: string, newStackSize: number, sessionID: string, output: IItemEventRouterResponse): void; - /** - * Get List of All Quests from db - * NOT CLONED - * @returns Array of IQuest objects - */ - getQuestsFromDb(): IQuest[]; /** * Get quests, strip all requirement conditions except level * @param quests quests to process @@ -145,45 +141,62 @@ export declare class QuestHelper { getQuestWithOnlyLevelRequirementStartCondition(quest: IQuest): IQuest; /** * Fail a quest in a player profile - * @param pmcData Profile - * @param failRequest fail quest request data + * @param pmcData Player profile + * @param failRequest Fail quest request data * @param sessionID Session id * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: any, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; /** - * Get quest by id from database - * @param questId questid to look for - * @param pmcData player profile + * Get List of All Quests from db + * NOT CLONED + * @returns Array of IQuest objects + */ + getQuestsFromDb(): IQuest[]; + /** + * Get quest by id from database (repeatables are stored in profile, check there if questId not found) + * @param questId Id of quest to find + * @param pmcData Player profile * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; /** * Get the locale Id from locale db for a quest message - * @param questMessageId Quest mesage id to look up + * @param questMessageId Quest message id to look up * @returns Locale Id from locale db */ getQuestLocaleIdFromDb(questMessageId: string): string; /** - * Alter a quests state + Add a record to tis status timers object + * Alter a quests state + Add a record to its status timers object * @param pmcData Profile to update - * @param newQuestState new state the qeust should be in - * @param questId id of the quest to alter the status of + * @param newQuestState New state the quest should be in + * @param questId Id of the quest to alter the status of */ updateQuestState(pmcData: IPmcData, newQuestState: QuestStatus, questId: string): void; /** - * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks - Returns reward items player earned * @param pmcData Player profile - * @param body complete quest request - * @param state State of the quest now its complete - * @param sessionID Seession id - * @returns array of reward objects + * @param questId questId of quest to get rewards for + * @param state State of the quest to get rewards for + * @param sessionId Session id + * @param questResponse Response to send back to client + * @returns Array of reward objects */ - applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: QuestStatus, sessionID: string): Reward[]; + applyQuestReward(pmcData: IPmcData, questId: string, state: QuestStatus, sessionId: string, questResponse: IItemEventRouterResponse): Reward[]; /** - * Get the intel center bonus a player has + * WIP - Find hideout craft id and add to unlockedProductionRecipe array in player profile + * also update client response recipeUnlocked array with craft id + * @param pmcData Player profile + * @param craftUnlockReward Reward item from quest with craft unlock details + * @param questDetails Quest with craft unlock reward + * @param sessionID Session id + * @param response Response to send back to client + */ + protected findAndAddHideoutProductionIdToProfile(pmcData: IPmcData, craftUnlockReward: Reward, questDetails: IQuest, sessionID: string, response: IItemEventRouterResponse): void; + /** + * Get players intel center bonus from profile * @param pmcData player profile - * @returns bonus in percent + * @returns bonus as a percent */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** @@ -192,4 +205,10 @@ export declare class QuestHelper { * @returns 'FindItem' condition id */ getFindItemIdForQuestHandIn(itemTpl: string): string; + /** + * Add all quests to a profile with the provided statuses + * @param pmcProfile profile to update + * @param statuses statuses quests should have + */ + addAllQuestsToProfile(pmcProfile: IPmcData, statuses: QuestStatus[]): void; } diff --git a/Faupi-MunitionsExpert/server/types/helpers/RagfairOfferHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/RagfairOfferHelper.d.ts index b73f786..3d0d570 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/RagfairOfferHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/RagfairOfferHelper.d.ts @@ -46,8 +46,14 @@ export declare class RagfairOfferHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); - getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Has a traders offer ran out of stock to sell to player + * @param offer Offer to check stock of + * @returns true if out of stock + */ + protected traderOutOfStock(offer: IRagfairOffer): boolean; /** * Check if trader offers' BuyRestrictionMax value has been reached * @param offer offer to check restriction properties of @@ -64,5 +70,5 @@ export declare class RagfairOfferHelper { protected getProfileOffers(sessionID: string): IRagfairOffer[]; protected deleteOfferByOfferId(sessionID: string, offerId: string): void; protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/Faupi-MunitionsExpert/server/types/helpers/RagfairSellHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/RagfairSellHelper.d.ts index 91b8a20..bf7aeb6 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/RagfairSellHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/RagfairSellHelper.d.ts @@ -11,12 +11,26 @@ export declare class RagfairSellHelper { protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); - calculateSellChance(baseChancePercent: number, offerPriceRub: number, playerListedPriceRub: number): number; + /** + * Get the percent chance to sell an item based on its average listed price vs player chosen listing price + * @param baseChancePercent Base chance to sell item + * @param averageOfferPriceRub Price of average offer in roubles + * @param playerListedPriceRub Price player listed item for in roubles + * @returns percent value + */ + calculateSellChance(baseChancePercent: number, averageOfferPriceRub: number, playerListedPriceRub: number): number; + /** + * Get percent chance to sell an item when price is below items average listing price + * @param playerListedPriceRub Price player listed item for in roubles + * @param averageOfferPriceRub Price of average offer in roubles + * @returns percent value + */ + protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Determine if the offer being listed will be sold * @param sellChancePercent chance item will sell * @param itemSellCount count of items to sell - * @returns Array of purchases of item(s) lsited + * @returns Array of purchases of item(s) listed */ rollForSale(sellChancePercent: number, itemSellCount: number): SellResult[]; } diff --git a/Faupi-MunitionsExpert/server/types/helpers/RagfairServerHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/RagfairServerHelper.d.ts index ec388d8..bfe6cc3 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/RagfairServerHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/RagfairServerHelper.d.ts @@ -42,7 +42,7 @@ export declare class RagfairServerHelper { protected isItemBlacklisted(itemTemplateId: string): boolean; isTrader(userID: string): boolean; isPlayer(userID: string): boolean; - returnItems(sessionID: string, items: any[]): void; + returnItems(sessionID: string, items: Item[]): void; calculateDynamicStackCount(tplId: string, isWeaponPreset: boolean): number; /** * Choose a currency at random with bias diff --git a/Faupi-MunitionsExpert/server/types/helpers/RagfairSortHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/RagfairSortHelper.d.ts index 4669ce6..6a06528 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/RagfairSortHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/RagfairSortHelper.d.ts @@ -7,7 +7,7 @@ export declare class RagfairSortHelper { protected localeService: LocaleService; constructor(databaseServer: DatabaseServer, localeService: LocaleService); /** - * Sort a list of ragfair offers by something (id/rating/offer name/price/expirty time) + * Sort a list of ragfair offers by something (id/rating/offer name/price/expiry time) * @param offers Offers to sort * @param type How to sort it * @param direction Ascending/descending diff --git a/Faupi-MunitionsExpert/server/types/helpers/RepairHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/RepairHelper.d.ts index 5b09320..0d0257a 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/RepairHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/RepairHelper.d.ts @@ -15,7 +15,7 @@ export declare class RepairHelper { protected repairConfig: IRepairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * + * Alter an items durability after a repair by trader/repair kit * @param itemToRepair item to update durability details * @param itemToRepairDetails db details of item to repair * @param isArmor Is item being repaired a piece of armor @@ -24,7 +24,12 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegredationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegredationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; + /** + * Is the supplied tpl a weapon + * @param tpl tplId to check is a weapon + * @returns true if tpl is a weapon + */ isWeaponTemplate(tpl: string): boolean; } diff --git a/Faupi-MunitionsExpert/server/types/helpers/TradeHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/TradeHelper.d.ts index 2a8f0b7..6811dd1 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/TradeHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/TradeHelper.d.ts @@ -6,8 +6,10 @@ import { Item, Upd } from "../models/eft/common/tables/IItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; @@ -20,28 +22,30 @@ export declare class TradeHelper { protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer, configServer: ConfigServer); /** * Buy item from flea or trader - * @param pmcData + * @param pmcData Player profile * @param buyRequestData data from client - * @param sessionID - * @param foundInRaid + * @param sessionID Session id + * @param foundInRaid Should item be found in raid * @param upd optional item details used when buying from flea * @returns */ buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData - * @param body - * @param sessionID - * @returns + * @param pmcData Profile to update + * @param sellRequest request data + * @param sessionID Session id + * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, body: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased - * Show error on screen if player attepts to buy more than what the buy max allows + * Show error on screen if player attempts to buy more than what the buy max allows * @param assortBeingPurchased assort being bought * @param itemsPurchasedCount number of items being bought */ diff --git a/Faupi-MunitionsExpert/server/types/helpers/TraderAssortHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/TraderAssortHelper.d.ts index 025efd6..a0294a1 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/TraderAssortHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/TraderAssortHelper.d.ts @@ -7,7 +7,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; +import { LocalisationService } from "../services/LocalisationService"; import { TraderAssortService } from "../services/TraderAssortService"; +import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; import { MathUtil } from "../utils/MathUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -27,11 +29,15 @@ export declare class TraderAssortHelper { protected ragfairAssortGenerator: RagfairAssortGenerator; protected ragfairOfferGenerator: RagfairOfferGenerator; protected traderAssortService: TraderAssortService; + protected localisationService: LocalisationService; + protected traderPurchasePersisterService: TraderPurchasePersisterService; protected traderHelper: TraderHelper; protected fenceService: FenceService; protected configServer: ConfigServer; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer); + protected mergedQuestAssorts: Record>; + protected createdMergedQuestAssorts: boolean; + constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, localisationService: LocalisationService, traderPurchasePersisterService: TraderPurchasePersisterService, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer); /** * Get a traders assorts * Can be used for returning ragfair / fence assorts @@ -41,6 +47,10 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Create a dict of all assort id = quest id mappings used to work out what items should be shown to player based on the quests they've started/completed/failed + */ + protected hydrateMergedQuestAssorts(): void; /** * Reset a traders assorts and move nextResupply value to future * Flag trader as needing a flea offer reset to be picked up by flea update() function @@ -57,7 +67,7 @@ export declare class TraderAssortHelper { * Iterate over all assorts barter_scheme values, find barters selling for money and multiply by multipler in config * @param traderAssort Assorts to multiple price of */ - protected multiplyItemPricesByConfigMultipler(traderAssort: ITraderAssort): void; + protected multiplyItemPricesByConfigMultiplier(traderAssort: ITraderAssort): void; /** * Get an array of pristine trader items prior to any alteration by player (as they were on server start) * @param traderId trader id diff --git a/Faupi-MunitionsExpert/server/types/helpers/TraderHelper.d.ts b/Faupi-MunitionsExpert/server/types/helpers/TraderHelper.d.ts index 0dc93e8..49aea28 100644 --- a/Faupi-MunitionsExpert/server/types/helpers/TraderHelper.d.ts +++ b/Faupi-MunitionsExpert/server/types/helpers/TraderHelper.d.ts @@ -8,6 +8,7 @@ import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { FenceService } from "../services/FenceService"; +import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; @@ -23,11 +24,14 @@ export declare class TraderHelper { protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; + protected localisationService: LocalisationService; protected fenceService: FenceService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + /** Dictionary of item tpl and the highest trader rouble price */ + protected highestTraderPriceItems: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -39,11 +43,11 @@ export declare class TraderHelper { resetTrader(sessionID: string, traderID: string): void; /** * Alter a traders unlocked status - * @param traderID Trader to alter + * @param traderId Trader to alter * @param status New status to use - * @param sessionID Session id + * @param sessionId Session id */ - setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; + setTraderUnlockedState(traderId: string, status: boolean, sessionId: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -53,22 +57,29 @@ export declare class TraderHelper { getPurchasesData(traderID: string, sessionID: string): Record; /** * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData - * @param item - * @param sellCategory + * @param pmcData Profile + * @param item Item to be checked is sellable to trader + * @param sellCategory categories trader will buy + * @param traderId Trader item is being checked can be sold to * @returns true if should NOT be sold to trader */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[]): boolean; + protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; /** - * Can this weapon be sold to a trader with its current durabiltiy level - * @param traderID - * @param item - * @returns boolean + * Check if item has durability so low it precludes it from being sold to the trader (inclusive) + * @param item Item to check durability of + * @param traderId Trader item is sold to + * @returns */ - protected isWeaponBelowTraderBuyDurability(traderID: string, item: Item): boolean; + protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; /** - * Get the price of an item and all of its attached children - * Take into account bonuses/adjsutments e.g. discounts + * Get the percentage threshold value a trader will buy armor/weapons above + * @param traderId Trader to look up + * @returns percentage + */ + protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; + /** + * Get the price of passed in item and all of its attached children (mods) + * Take into account bonuses/adjustments e.g. discounts * @param pmcData profile data * @param item item to calculate price of * @param buyPriceCoefficient @@ -85,14 +96,21 @@ export declare class TraderHelper { * @returns price as number */ protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; + /** + * Get discount modifier for desired trader + * @param trader Trader to get discount for + * @param buyPriceCoefficient + * @param fenceInfo fence info, needed if getting fence modifier value + * @returns discount modifier value + */ + protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold - * @param sessionID Session id - * @param traderId traders id + * @param sessionId Session id + * @param traderId Traders id * @param standingToAdd Standing value to add to trader */ - addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + addStandingToTrader(sessionId: string, traderId: string, standingToAdd: number): void; /** * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process @@ -113,10 +131,28 @@ export declare class TraderHelper { getTraderUpdateSeconds(traderId: string): number; /** * check if an item is allowed to be sold to a trader - * @param traderFilters array of allowed categories + * @param categoriesTraderBuys array of allowed categories * @param tplToCheck itemTpl of inventory - * @returns boolean + * @returns boolean if item can be sold to trader */ - traderFilter(traderFilters: string[], tplToCheck: string): boolean; + doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; + /** + * Store the purchase of an assort from a trader in the player profile + * @param sessionID Session id + * @param newPurchaseDetails New item assort id + count + */ + addTraderPurchasesToPlayerProfile(sessionID: string, newPurchaseDetails: { + items: { + item_id: string; + count: number; + }[]; + tid: string; + }): void; + /** + * Get the highest rouble price for an item from traders + * @param tpl Item to look up highest pride for + * @returns highest rouble cost for item + */ + getHighestTraderPriceRouble(tpl: string): number; } diff --git a/Faupi-MunitionsExpert/server/types/loaders/BundleLoader.d.ts b/Faupi-MunitionsExpert/server/types/loaders/BundleLoader.d.ts index 06ad698..b88723c 100644 --- a/Faupi-MunitionsExpert/server/types/loaders/BundleLoader.d.ts +++ b/Faupi-MunitionsExpert/server/types/loaders/BundleLoader.d.ts @@ -19,4 +19,11 @@ export declare class BundleLoader { getBundle(key: string, local: boolean): BundleInfo; addBundles(modpath: string): void; } +export interface BundleManifest { + manifest: Array; +} +export interface BundleManifestEntry { + key: string; + path: string; +} export {}; diff --git a/Faupi-MunitionsExpert/server/types/loaders/ModTypeCheck.d.ts b/Faupi-MunitionsExpert/server/types/loaders/ModTypeCheck.d.ts new file mode 100644 index 0000000..e907341 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/loaders/ModTypeCheck.d.ts @@ -0,0 +1,43 @@ +import { IPostAkiLoadMod } from "../models/external/IPostAkiLoadMod"; +import { IPostAkiLoadModAsync } from "../models/external/IPostAkiLoadModAsync"; +import { IPostDBLoadMod } from "../models/external/IPostDBLoadMod"; +import { IPostDBLoadModAsync } from "../models/external/IPostDBLoadModAsync"; +import { IPreAkiLoadMod } from "../models/external/IPreAkiLoadMod"; +import { IPreAkiLoadModAsync } from "../models/external/IPreAkiLoadModAsync"; +export declare class ModTypeCheck { + /** + * Use defined safe guard to check if the mod is a IPreAkiLoadMod + * @returns boolean + */ + isPreAkiLoad(mod: any): mod is IPreAkiLoadMod; + /** + * Use defined safe guard to check if the mod is a IPostAkiLoadMod + * @returns boolean + */ + isPostAkiLoad(mod: any): mod is IPostAkiLoadMod; + /** + * Use defined safe guard to check if the mod is a IPostDBLoadMod + * @returns boolean + */ + isPostDBAkiLoad(mod: any): mod is IPostDBLoadMod; + /** + * Use defined safe guard to check if the mod is a IPreAkiLoadModAsync + * @returns boolean + */ + isPreAkiLoadAsync(mod: any): mod is IPreAkiLoadModAsync; + /** + * Use defined safe guard to check if the mod is a IPostAkiLoadModAsync + * @returns boolean + */ + isPostAkiLoadAsync(mod: any): mod is IPostAkiLoadModAsync; + /** + * Use defined safe guard to check if the mod is a IPostDBLoadModAsync + * @returns boolean + */ + isPostDBAkiLoadAsync(mod: any): mod is IPostDBLoadModAsync; + /** + * Checks for mod to be compatible with 3.X+ + * @returns boolean + */ + isPostV3Compatible(mod: any): boolean; +} diff --git a/Faupi-MunitionsExpert/server/types/loaders/PostAkiModLoader.d.ts b/Faupi-MunitionsExpert/server/types/loaders/PostAkiModLoader.d.ts index edc6e5d..5df8c6c 100644 --- a/Faupi-MunitionsExpert/server/types/loaders/PostAkiModLoader.d.ts +++ b/Faupi-MunitionsExpert/server/types/loaders/PostAkiModLoader.d.ts @@ -1,21 +1,17 @@ import { DependencyContainer } from "tsyringe"; -import { HandbookController } from "../controllers/HandbookController"; import { IModLoader } from "../models/spt/mod/IModLoader"; -import { ModCompilerService } from "../services/ModCompilerService"; import { VFS } from "../utils/VFS"; import { BundleLoader } from "./BundleLoader"; +import { ModTypeCheck } from "./ModTypeCheck"; import { PreAkiModLoader } from "./PreAkiModLoader"; export declare class PostAkiModLoader implements IModLoader { protected bundleLoader: BundleLoader; - protected handbookController: HandbookController; protected vfs: VFS; - protected modCompilerService: ModCompilerService; protected preAkiModLoader: PreAkiModLoader; - constructor(bundleLoader: BundleLoader, handbookController: HandbookController, vfs: VFS, modCompilerService: ModCompilerService, preAkiModLoader: PreAkiModLoader); - getBundles(local: boolean): string; - getBundle(key: string, local: boolean): void; + protected modTypeCheck: ModTypeCheck; + constructor(bundleLoader: BundleLoader, vfs: VFS, preAkiModLoader: PreAkiModLoader, modTypeCheck: ModTypeCheck); getModPath(mod: string): string; - load(): void; - protected executeMods(container: DependencyContainer): void; + load(): Promise; + protected executeMods(container: DependencyContainer): Promise; protected addBundles(): void; } diff --git a/Faupi-MunitionsExpert/server/types/loaders/PostDBModLoader.d.ts b/Faupi-MunitionsExpert/server/types/loaders/PostDBModLoader.d.ts index 5101b7b..c4cda5c 100644 --- a/Faupi-MunitionsExpert/server/types/loaders/PostDBModLoader.d.ts +++ b/Faupi-MunitionsExpert/server/types/loaders/PostDBModLoader.d.ts @@ -1,11 +1,13 @@ import { DependencyContainer } from "tsyringe"; import { OnLoad } from "../di/OnLoad"; +import { ModTypeCheck } from "./ModTypeCheck"; import { PreAkiModLoader } from "./PreAkiModLoader"; export declare class PostDBModLoader implements OnLoad { protected preAkiModLoader: PreAkiModLoader; - constructor(preAkiModLoader: PreAkiModLoader); - onLoad(): void; + protected modTypeCheck: ModTypeCheck; + constructor(preAkiModLoader: PreAkiModLoader, modTypeCheck: ModTypeCheck); + onLoad(): Promise; getRoute(): string; getModPath(mod: string): string; - protected executeMods(container: DependencyContainer): void; + protected executeMods(container: DependencyContainer): Promise; } diff --git a/Faupi-MunitionsExpert/server/types/loaders/PreAkiModLoader.d.ts b/Faupi-MunitionsExpert/server/types/loaders/PreAkiModLoader.d.ts index f486a28..1949696 100644 --- a/Faupi-MunitionsExpert/server/types/loaders/PreAkiModLoader.d.ts +++ b/Faupi-MunitionsExpert/server/types/loaders/PreAkiModLoader.d.ts @@ -1,9 +1,5 @@ import { DependencyContainer } from "tsyringe"; -import { IPostAkiLoadMod } from "../models/external/IPostAkiLoadMod"; -import { IPostDBLoadMod } from "../models/external/IPostDBLoadMod"; -import { IPreAkiLoadMod } from "../models/external/IPreAkiLoadMod"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; -import { ModLoader } from "../models/spt/mod/IMod"; import { IModLoader } from "../models/spt/mod/IModLoader"; import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,6 +9,7 @@ import { ModCompilerService } from "../services/ModCompilerService"; import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; import { BundleLoader } from "./BundleLoader"; +import { ModTypeCheck } from "./ModTypeCheck"; export declare class PreAkiModLoader implements IModLoader { protected logger: ILogger; protected vfs: VFS; @@ -21,21 +18,22 @@ export declare class PreAkiModLoader implements IModLoader { protected bundleLoader: BundleLoader; protected localisationService: LocalisationService; protected configServer: ConfigServer; + protected modTypeCheck: ModTypeCheck; protected static container: DependencyContainer; protected readonly basepath = "user/mods/"; - protected imported: Record; + protected readonly modOrderPath = "user/mods/order.json"; + protected order: Record; + protected imported: Record; protected akiConfig: ICoreConfig; - constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; - getBundles(local: boolean): string; - getBundle(key: string, local: boolean): void; /** * Returns a list of mods with preserved load order * @returns Array of mod names in load order */ getImportedModsNames(): string[]; + getImportedModDetails(): Record; getModPath(mod: string): string; - protected importClass(name: string, filepath: string, container: DependencyContainer): void; protected importMods(): Promise; /** * Check for duplciate mods loaded, show error if duplicate mod found @@ -60,29 +58,8 @@ export declare class PreAkiModLoader implements IModLoader { * @returns dictionary */ protected getModsPackageData(mods: string[]): Record; - /** - * Use defined safe guard to check if the mod is a IPreAkiLoadMod - * @returns boolean - */ - protected isPreAkiLoad(mod: any): mod is IPreAkiLoadMod; - /** - * Use defined safe guard to check if the mod is a IPostAkiLoadMod - * @returns boolean - */ - protected isPostAkiLoad(mod: any): mod is IPostAkiLoadMod; - /** - * Use defined safe guard to check if the mod is a IPostDBLoadMod - * @returns boolean - */ - protected isPostDBAkiLoad(mod: any): mod is IPostDBLoadMod; - /** - * Check that the mod is compatible with SPT 3.X.X - * @param mod the mod to check - * @returns boolean - */ - protected isModSpt3XXCompatible(mod: any): boolean; protected isModCombatibleWithAki(mod: IPackageJsonData): boolean; - protected executeMods(container: DependencyContainer): void; + protected executeMods(container: DependencyContainer): Promise; sortModsLoadOrder(): string[]; protected addMod(mod: string): Promise; protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; @@ -94,6 +71,6 @@ export declare class PreAkiModLoader implements IModLoader { */ protected validMod(modName: string): boolean; protected getLoadOrderRecursive(mod: string, result: Record, visited: Record): void; - protected getLoadOrder(mods: Record): Record; + protected getLoadOrder(mods: Record): Record; getContainer(): DependencyContainer; } diff --git a/Faupi-MunitionsExpert/server/types/models/eft/common/IGlobals.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/common/IGlobals.d.ts index b53f106..b5ed401 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/common/IGlobals.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,9 @@ export interface Config { GlobalLootChanceModifier: number; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; + TradingSetting: number; + TradingSettings: ITradingSettings; + ItemsCommonSettings: IItemsCommonSettings; LoadTimeSpeedProgress: number; BaseLoadTime: number; BaseUnloadTime: number; @@ -36,6 +39,7 @@ export interface Config { Customization: Customization; UncheckOnShot: boolean; BotsEnabled: boolean; + BufferZone: IBufferZone; ArmorMaterials: ArmorMaterials; LegsOverdamage: number; HandsOverdamage: number; @@ -55,7 +59,6 @@ export interface Config { StaminaRestoration: StaminaRestoration; StaminaDrain: StaminaDrain; RequirementReferences: RequirementReferences; - RepairKitSettings: RepairKitSettings; RestrictionsInRaid: RestrictionsInRaid[]; SkillMinEffectiveness: number; SkillFatiguePerPoint: number; @@ -82,6 +85,23 @@ export interface Config { TestValue: number; Inertia: Inertia; Ballistic: Ballistic; + RepairSettings: RepairSettings; +} +export interface IBufferZone { + CustomerAccessTime: number; + CustomerCriticalTimeStart: number; + CustomerKickNotifTime: number; +} +export interface IItemsCommonSettings { + ItemRemoveAfterInterruptionTime: number; +} +export interface ITradingSettings { + BuyoutRestrictions: IBuyoutRestrictions; +} +export interface IBuyoutRestrictions { + MinDurability: number; + MinFoodDrinkResource: number; + MinMedsResource: number; } export interface Content { ip: string; @@ -321,6 +341,8 @@ export interface Effects { Pain: Pain; PainKiller: PainKiller; SandingScreen: SandingScreen; + MildMusclePain: IMusclePainEffect; + SevereMusclePain: IMusclePainEffect; Stimulator: Stimulator; Tremor: Tremor; ChronicStaminaFatigue: ChronicStaminaFatigue; @@ -457,6 +479,12 @@ export interface PainKiller { export interface SandingScreen { Dummy: number; } +export interface IMusclePainEffect { + GymEffectivity: number; + OfflineDurationMax: number; + OfflineDurationMin: number; + TraumaChance: number; +} export interface Stimulator { BuffLoopTime: number; Buffs: Buffs; @@ -803,7 +831,7 @@ export interface SkillsSettings { HMG: any[]; Launcher: any[]; AttachedLauncher: any[]; - Melee: any[]; + Melee: IMeleeSkill; DMR: WeaponSkills; BearAssaultoperations: any[]; BearAuthority: any[]; @@ -847,10 +875,25 @@ export interface SkillsSettings { BotSound: any[]; TroubleShooting: TroubleShooting; } +export interface IMeleeSkill { + BuffSettings: IBuffSettings; +} export interface ArmorSkills { + BuffMaxCount: number; + BuffSettings: IBuffSettings; + Counters: IArmorCounters; + MoveSpeedPenaltyReductionHVestsReducePerLevel: number; + RicochetChanceHVestsCurrentDurabilityThreshold: number; + RicochetChanceHVestsEliteLevel: number; + RicochetChanceHVestsMaxDurabilityThreshold: number; + MeleeDamageLVestsReducePerLevel: number; + MoveSpeedPenaltyReductionLVestsReducePerLevel: number; WearAmountRepairLVestsReducePerLevel: number; WearChanceRepairLVestsReduceEliteLevel: number; } +export interface IArmorCounters { + armorDurability: ISkillCounter; +} export interface HideoutManagement { SkillPointsPerAreaUpgrade: number; SkillPointsPerCraft: number; @@ -907,6 +950,7 @@ export interface Endurance { MovementAction: number; SprintAction: number; GainPerFatigueStack: number; + QTELevelMultipliers: Record>; } export interface Strength { SprintActionMin: number; @@ -915,9 +959,14 @@ export interface Strength { MovementActionMax: number; PushUpMin: number; PushUpMax: number; + QTELevelMultipliers: IQTELevelMultiplier[]; FistfightAction: number; ThrowAction: number; } +export interface IQTELevelMultiplier { + Level: number; + Multiplier: number; +} export interface Vitality { DamageTakenAction: number; HealthNegativeEffect: number; @@ -950,22 +999,42 @@ export interface Search { FindAction: number; } export interface WeaponTreatment { + BuffMaxCount: number; + BuffSettings: IBuffSettings; + Counters: IWeaponTreatmentCounters; DurLossReducePerLevel: number; SkillPointsPerRepair: number; Filter: any[]; WearAmountRepairGunsReducePerLevel: number; WearChanceRepairGunsReduceEliteLevel: number; } +export interface IWeaponTreatmentCounters { + firearmsDurability: ISkillCounter; +} +export interface IBuffSettings { + CommonBuffChanceLevelBonus: number; + CommonBuffMinChanceValue: number; + CurrentDurabilityLossToRemoveBuff?: number; + MaxDurabilityLossToRemoveBuff?: number; + RareBuffChanceCoff: number; + ReceivedDurabilityMaxPercent: number; +} export interface MagDrills { RaidLoadedAmmoAction: number; RaidUnloadedAmmoAction: number; MagazineCheckAction: number; } export interface Perception { + DependentSkillRatios: ISkillRatio[]; OnlineAction: number; UniqueLoot: number; } +export interface ISkillRatio { + Ratio: number; + SkillId: string; +} export interface Intellect { + Counters: IIntellectCounters; ExamineAction: number; SkillProgress: number; RepairAction: number; @@ -973,16 +1042,52 @@ export interface Intellect { WearChanceReduceEliteLevel: number; RepairPointsCostReduction: number; } +export interface IIntellectCounters { + armorDurability: ISkillCounter; + firearmsDurability: ISkillCounter; + meleeWeaponDurability: ISkillCounter; +} +export interface ISkillCounter { + divisor: number; + points: number; +} export interface Attention { + DependentSkillRatios: ISkillRatio[]; ExamineWithInstruction: number; FindActionFalse: number; FindActionTrue: number; } export interface Charisma { + BonusSettings: IBonusSettings; + Counters: ICharismaSkillCounters; SkillProgressInt: number; SkillProgressAtn: number; SkillProgressPer: number; } +export interface ICharismaSkillCounters { + insuranceCost: ISkillCounter; + repairCost: ISkillCounter; + repeatableQuestCompleteCount: ISkillCounter; + restoredHealthCost: ISkillCounter; + scavCaseCost: ISkillCounter; +} +export interface IBonusSettings { + EliteBonusSettings: IEliteBonusSettings; + LevelBonusSettings: ILevelBonusSettings; +} +export interface IEliteBonusSettings { + FenceStandingLossDiscount: number; + RepeatableQuestExtraCount: number; + ScavCaseDiscount: number; +} +export interface ILevelBonusSettings { + HealthRestoreDiscount: number; + HealthRestoreTraderDiscount: number; + InsuranceDiscount: number; + InsuranceTraderDiscount: number; + PaidExitDiscount: number; + RepeatableQuestChangeDiscount: number; +} export interface Memory { AnySkillUp: number; SkillProgress: number; @@ -1145,11 +1250,30 @@ export interface xyz { export interface Ballistic { GlobalDamageDegradationCoefficient: number; } -export interface RepairKitSettings { +export interface RepairSettings { + ItemEnhancementSettings: IItemEnhancementSettings; + MinimumLevelToApplyBuff: number; + RepairStrategies: IRepairStrategies; armorClassDivisor: number; durabilityPointCostArmor: number; durabilityPointCostGuns: number; } +export interface IItemEnhancementSettings { + DamageReduction: IPriceModifier; + MalfunctionProtections: IPriceModifier; + WeaponSpread: IPriceModifier; +} +export interface IPriceModifier { + PriceModifier: number; +} +export interface IRepairStrategies { + Armor: IRepairStrategy; + Firearms: IRepairStrategy; +} +export interface IRepairStrategy { + BuffTypes: string[]; + Filter: string[]; +} export interface BotPreset { UseThis: boolean; Role: string; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/common/ILocationBase.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/common/ILocationBase.d.ts index 78ade9a..1c3a2fa 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/common/ILocationBase.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/common/ILocationBase.d.ts @@ -118,6 +118,7 @@ export interface BossLocationSpawn { TriggerName: string; Delay?: number; Supports?: BossSupport[]; + sptId?: string; } export interface BossSupport { BossEscortAmount: string; @@ -179,6 +180,7 @@ export interface Exit { EntryPoints: string; ExfiltrationTime: number; ExfiltrationType: string; + RequiredSlot?: string; Id: string; MaxTime: number; MinTime: number; @@ -202,6 +204,7 @@ export interface Wave { slots_min: number; time_max: number; time_min: number; + sptId?: string; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IBotBase.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IBotBase.d.ts index 1c28ae0..dd7c478 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IBotBase.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IBotBase.d.ts @@ -21,6 +21,7 @@ export interface IBotBase { Hideout: Hideout; Quests: Quest[]; TradersInfo: Record; + UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; RepeatableQuests: IPmcDataRepeatableQuest[]; Bonuses: Bonus[]; @@ -31,6 +32,9 @@ export interface IBotBase { /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IUnlockedInfo { + unlockedProductionRecipe: string[]; +} export interface Info { EntryPoint: string; Nickname: string; @@ -100,7 +104,10 @@ export interface BodyPartsHealth { } export interface BodyPartHealth { Health: CurrentMax; - Effects?: Record; + Effects?: Record; +} +export interface BodyPartEffectProperties { + Time: number; } export interface CurrentMax { Current: number; @@ -120,7 +127,6 @@ export interface FastPanel { export interface Skills { Common: Common[]; Mastering: Mastering[]; - Bonuses?: any[]; Points: number; } export interface Common { @@ -265,12 +271,24 @@ export interface InsuredItem { export interface Hideout { Production: Record; Areas: HideoutArea[]; + Improvements: Record; + sptUpdateLastRunTimestamp: number; +} +export interface IHideoutImprovement { + completed: boolean; + improveCompleteTimestamp: number; } export interface Productive { Products: Product[]; + /** Seconds passed of production */ Progress?: number; + /** Is craft in some state of being worked on by client (crafting/ready to pick up) */ inProgress?: boolean; StartTimestamp?: number; + SkipTime?: number; + /** Seconds needed to fully craft */ + ProductionTime?: number; + sptIsScavCase?: boolean; } export interface Production extends Productive { RecipeId: string; @@ -327,10 +345,12 @@ export interface Quest { statusTimers?: Record; /** SPT specific property */ completedConditions?: string[]; + availableAfter?: number; } export interface TraderInfo { loyaltyLevel: number; salesSum: number; + disabled: boolean; standing: number; nextResupply: number; unlocked: boolean; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IBotType.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IBotType.d.ts index 55b4bd9..e02d990 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IBotType.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IBotType.d.ts @@ -57,6 +57,10 @@ export interface ModsChances { mod_pistol_grip: number; mod_reciever: number; mod_scope: number; + mod_scope_000: number; + mod_scope_001: number; + mod_scope_002: number; + mod_scope_003: number; mod_sight_front: number; mod_sight_rear: number; mod_stock: number; @@ -152,4 +156,4 @@ export interface Items { SpecialLoot: string[]; TacticalVest: string[]; } -export declare type Mods = Record>; +export type Mods = Record>; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IItem.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IItem.d.ts index 2dd2c03..ce00ae9 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IItem.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IItem.d.ts @@ -7,6 +7,7 @@ export interface Item { upd?: Upd; } export interface Upd { + Buff?: Buff; OriginalStackObjectsCount?: number; Togglable?: Togglable; Map?: Map; @@ -16,6 +17,7 @@ export interface Upd { StackObjectsCount?: number; UnlimitedCount?: boolean; Repairable?: Repairable; + RecodableComponent?: RecodableComponent; FireMode?: FireMode; SpawnedInSession?: boolean; Light?: Light; @@ -31,6 +33,12 @@ export interface Upd { SideEffect?: SideEffect; RepairKit?: RepairKit; } +export interface Buff { + rarity: string; + buffType: string; + value: number; + thresholdDurability?: number; +} export interface Togglable { On: boolean; } @@ -52,6 +60,9 @@ export interface Repairable { Durability: number; MaxDurability: number; } +export interface RecodableComponent { + IsEncoded: boolean; +} export interface MedKit { HpResource: number; } @@ -98,7 +109,8 @@ export interface Location { y: number; r: string | number; isSearched?: boolean; - rotation?: string; + /** SPT property? */ + rotation?: string | boolean; } export interface SideEffect { Value: number; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IProfileTemplate.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IProfileTemplate.d.ts index fbcd81a..66ebbe8 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -19,6 +19,8 @@ export interface TemplateSide { } export interface ProfileTraderTemplate { initialLoyaltyLevel: number; + setQuestsAvailableForStart?: boolean; + setQuestsAvailableForFinish?: boolean; initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IQuest.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IQuest.d.ts index c5b1cb2..5c939e1 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IQuest.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IQuest.d.ts @@ -2,7 +2,7 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { - QuestName: string; + QuestName?: string; _id: string; canShowNotificationsInGame: boolean; conditions: Conditions; @@ -15,6 +15,7 @@ export interface IQuest { image: string; type: string; isKey: boolean; + questStatus: any; restartable: boolean; instantComplete: boolean; secretQuest: boolean; @@ -22,7 +23,7 @@ export interface IQuest { successMessageText: string; templateId: string; rewards: Rewards; - status: string; + status: string | number; KeyQuest: boolean; changeQuestMessageText: string; side: string; @@ -37,18 +38,21 @@ export interface Conditions { export interface AvailableForConditions { _parent: string; _props: AvailableForProps; - dynamicLocale: boolean; + dynamicLocale?: boolean; } export interface AvailableForProps { id: string; index: number; parentId: string; + isEncoded: boolean; dynamicLocale: boolean; value?: number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; status?: QuestStatus[]; + availableAfter?: number; + dispersion?: number; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IRepeatableQuests.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IRepeatableQuests.d.ts index e23ec73..3a33f2e 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IRepeatableQuests.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/IRepeatableQuests.d.ts @@ -25,7 +25,7 @@ export interface IPmcDataRepeatableQuest { endTime: number; changeRequirement: TChangeRequirementRecord; } -export declare type TChangeRequirementRecord = Record; +export type TChangeRequirementRecord = Record; export interface IChangeRequirement { changeCost: IChangeCost[]; changeStandingCost: number; @@ -47,6 +47,7 @@ export interface IRepeatableQuest { canShowNotificationsInGame: boolean; rewards: IRewards; conditions: IConditions; + side: string; name: string; note: string; description: string; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/ITemplateItem.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/ITemplateItem.d.ts index 0fa7e18..cbad0a6 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/ITemplateItem.d.ts @@ -29,8 +29,11 @@ export interface Props { IsUnsaleable?: boolean; IsUnbuyable?: boolean; IsUngivable?: boolean; + IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsSpecialSlotOnly?: boolean; QuestItem?: boolean; + QuestStashMaxCount?: number; LootExperience?: number; ExamineExperience?: number; HideEntrails?: boolean; @@ -156,11 +159,12 @@ export interface Props { RigLayoutName?: string; MaxDurability?: number; armorZone?: string[]; - armorClass?: any; + armorClass?: string | number; mousePenalty?: number; weaponErgonomicPenalty?: number; BluntThroughput?: number; ArmorMaterial?: string; + ArmorType?: string; weapClass?: string; weapUseType?: string; ammoCaliber?: string; @@ -365,6 +369,8 @@ export interface Props { CanBeHiddenDuringThrow?: boolean; MinTimeToContactExplode?: number; ExplosionEffectType?: string; + LinkedWeapon?: string; + UseAmmoWithoutShell?: boolean; } export interface IHealthEffect { type: string; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/ITrader.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/ITrader.d.ts index 37b2d61..1fcfbaa 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/common/tables/ITrader.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/common/tables/ITrader.d.ts @@ -9,6 +9,7 @@ export interface ITrader { export interface ITraderBase { refreshTraderRagfairOffers: boolean; _id: string; + availableInRaid: boolean; avatar: string; balance_dol: number; balance_eur: number; @@ -20,6 +21,8 @@ export interface ITraderBase { discount_end: number; gridHeight: number; insurance: Insurance; + items_buy: IItemBuyData; + items_buy_prohibited: IItemBuyData; location: string; loyaltyLevels: LoyaltyLevel[]; medic: boolean; @@ -31,6 +34,10 @@ export interface ITraderBase { surname: string; unlockedByDefault: boolean; } +export interface IItemBuyData { + category: string[]; + id_list: string[]; +} export interface Insurance { availability: boolean; excluded_category: string[]; @@ -54,8 +61,9 @@ export interface Repair { currency: string; currency_coefficient: number; excluded_category: string[]; + /** Doesn't exist in client object */ excluded_id_list: any[]; - quality: string; + quality: number; } export interface ITraderAssort { nextResupply: number; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/dialog/IChatServer.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/dialog/IChatServer.d.ts new file mode 100644 index 0000000..48cacc4 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/models/eft/dialog/IChatServer.d.ts @@ -0,0 +1,16 @@ +export interface IChatServer { + _id: string; + RegistrationId: number; + VersionId: string; + Ip: string; + Port: number; + DateTime: number; + Chats: IChat[]; + Regions: string[]; + /** Possibly removed */ + IsDeveloper?: boolean; +} +export interface IChat { + _id: string; + Members: number; +} diff --git a/Faupi-MunitionsExpert/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 8a29319..f8d700c 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -1,7 +1,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; - Ignore: any[]; + Ignore: string[]; InIgnoreList: string[]; } export interface Friend { diff --git a/Faupi-MunitionsExpert/server/types/models/eft/game/IGameConfigResponse.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/game/IGameConfigResponse.d.ts index eb37a39..e1b7587 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/game/IGameConfigResponse.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/game/IGameConfigResponse.d.ts @@ -7,11 +7,13 @@ export interface IGameConfigResponse { activeProfileId: string; backend: Backend; utc_time: number; + /** Total in game time */ totalInGame: number; reportAvailable: boolean; twitchEventMember: boolean; } export interface Backend { + Lobby: string; Trading: string; Messaging: string; Main: string; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/game/IGetItemPricesResponse.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/game/IGetItemPricesResponse.d.ts new file mode 100644 index 0000000..ab6e818 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/models/eft/game/IGetItemPricesResponse.d.ts @@ -0,0 +1,5 @@ +export interface IGetItemPricesResponse { + supplyNextTime: number; + prices: Record; + currencyCourses: Record; +} diff --git a/Faupi-MunitionsExpert/server/types/models/eft/health/Effect.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/health/Effect.d.ts index 7eb3ffc..62d95a8 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/health/Effect.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/health/Effect.d.ts @@ -1,5 +1,7 @@ export declare enum Effect { FRACTURE = "Fracture", LIGHT_BLEEDING = "LightBleeding", - HEAVY_BLEEDING = "HeavyBleeding" + HEAVY_BLEEDING = "HeavyBleeding", + MILD_MUSCLE_PAIN = "MildMusclePain", + SEVERE_MUSCLE_PAIN = "SevereMusclePain" } diff --git a/Faupi-MunitionsExpert/server/types/models/eft/health/IWorkoutData.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/health/IWorkoutData.d.ts new file mode 100644 index 0000000..ba629d2 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/models/eft/health/IWorkoutData.d.ts @@ -0,0 +1,4 @@ +export interface IWorkoutData extends Record { + skills: any; + effects: any; +} diff --git a/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHandleQTEEventRequestData.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHandleQTEEventRequestData.d.ts new file mode 100644 index 0000000..5dda485 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHandleQTEEventRequestData.d.ts @@ -0,0 +1,8 @@ +export interface IHandleQTEEventRequestData { + Action: string; + /** true if QTE was successful, otherwise false */ + results: boolean[]; + /** Id of the QTE object used from db/hideout/qte.json */ + id: string; + timestamp: number; +} diff --git a/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutArea.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutArea.d.ts index d9fd2bf..fa5ca20 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutArea.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutArea.d.ts @@ -3,23 +3,55 @@ export interface IHideoutArea { type: number; enabled: boolean; needsFuel: boolean; + requirements: IAreaRequirement[]; takeFromSlotLocked: boolean; craftGivesExp: boolean; + displayLevel: boolean; + enableAreaRequirements: boolean; stages: Record; } +export interface IAreaRequirement { + areaType: number; + requiredlevel: number; + type: string; +} export interface Stage { - requirements: Requirement[]; + autoUpgrade: boolean; bonuses: StageBonus[]; - slots: number; constructionTime: number; description: string; + displayInterface: boolean; + improvements: IStageImprovement[]; + requirements: IStageRequirement[]; + slots: number; } -export interface Requirement { +export interface IStageImprovement { + id: string; + bonuses: IStageImprovementBonus[]; + improvementTime: number; + requirements: IStageImprovementRequirement[]; +} +export interface IStageImprovementBonus { + passive: boolean; + production: boolean; + type: string; + value: number; + visible: boolean; +} +export interface IStageImprovementRequirement { + count: number; + isEncoded: boolean; + isFunctional: boolean; + templateId: string; + type: string; +} +export interface IStageRequirement { areaType?: number; requiredLevel?: number; type: string; templateId?: string; count?: number; + isEncoded: false; isFunctional?: boolean; traderId?: string; loyaltyLevel?: number; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutContinousProductionStartRequestData.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutContinuousProductionStartRequestData.d.ts similarity index 59% rename from Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutContinousProductionStartRequestData.d.ts rename to Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutContinuousProductionStartRequestData.d.ts index dba83eb..3ef00c6 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutContinousProductionStartRequestData.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutContinuousProductionStartRequestData.d.ts @@ -1,4 +1,4 @@ -export interface IHideoutContinousProductionStartRequestData { +export interface IHideoutContinuousProductionStartRequestData { Action: "HideoutContinuousProductionStart"; recipeId: string; timestamp: number; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts new file mode 100644 index 0000000..7e927bf --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts @@ -0,0 +1,13 @@ +export interface IHideoutImproveAreaRequestData { + Action: "HideoutImproveArea"; + /** Hideout area id from areas.json */ + id: string; + areaType: number; + items: HideoutItem[]; + timestamp: number; +} +export interface HideoutItem { + /** Hideout inventory id that was used by improvement action */ + id: string; + count: number; +} diff --git a/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutProduction.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutProduction.d.ts index ce878be..2367e08 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/hideout/IHideoutProduction.d.ts @@ -3,8 +3,10 @@ export interface IHideoutProduction { areaType: number; requirements: Requirement[]; productionTime: number; - boosters: any; endProduct: string; + isEncoded: boolean; + locked: boolean; + needFuelForAllProductionTime: boolean; continuous: boolean; count: number; productionLimitCount: number; @@ -12,6 +14,7 @@ export interface IHideoutProduction { export interface Requirement { templateId?: string; count?: number; + isEncoded?: boolean; isFunctional?: boolean; type: string; areaType?: number; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/hideout/IQteData.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/hideout/IQteData.d.ts new file mode 100644 index 0000000..f842b84 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/models/eft/hideout/IQteData.d.ts @@ -0,0 +1,38 @@ +export interface IQteData { + Id: string; + Type: string; + Area: string; + AreaLevel: number; + QuickTimeEvents: IQuickTimeEvent[]; + Requirements: IQteRequirement[]; + Results: Record; +} +export interface IQuickTimeEvent { + Type: string; + Position: number; + StartDelay: number; + EndDelay: number; + Speed: number; + SuccessRange: string; + Key: string; +} +export interface IQteRequirement { + type: string; +} +export interface IQteResult { + Energy: number; + Hydration: number; + RewardsRange: IQteEffect[]; +} +export interface IQteEffect { + Type: string; + SkillId: string; + levelMultipliers: ISkillLevelMultiplier[]; + Time: number; + Weight: number; + Result: string; +} +export interface ISkillLevelMultiplier { + level: number; + multiplier: number; +} diff --git a/Faupi-MunitionsExpert/server/types/models/eft/hideout/IRecordShootingRangePoints.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/hideout/IRecordShootingRangePoints.d.ts new file mode 100644 index 0000000..5bfd2fd --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/models/eft/hideout/IRecordShootingRangePoints.d.ts @@ -0,0 +1,4 @@ +export interface IRecordShootingRangePoints { + Action: "RecordShootingRangePoints"; + points: number; +} diff --git a/Faupi-MunitionsExpert/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts index bf209c6..4579fdb 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts @@ -1 +1 @@ -export declare type IGetInsuranceCostResponseData = Record>; +export type IGetInsuranceCostResponseData = Record>; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/inventory/IAddItemRequestData.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/inventory/IAddItemRequestData.d.ts index 53db97a..61516d6 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/inventory/IAddItemRequestData.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/inventory/IAddItemRequestData.d.ts @@ -1,4 +1,9 @@ export interface IAddItemRequestData { tid: string; - items: any[]; + items: AddItem[]; +} +export interface AddItem { + count: number; + isPreset?: boolean; + item_id: string; } diff --git a/Faupi-MunitionsExpert/server/types/models/eft/inventory/IAddItemTempObject.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/inventory/IAddItemTempObject.d.ts new file mode 100644 index 0000000..62d4b64 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/models/eft/inventory/IAddItemTempObject.d.ts @@ -0,0 +1,7 @@ +import { Item, Location } from "../common/tables/IItem"; +export interface IAddItemTempObject { + itemRef: Item; + count: number; + isPreset: boolean; + location?: Location; +} diff --git a/Faupi-MunitionsExpert/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index b45e459..6d7c190 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -16,7 +16,7 @@ export interface ToLocation { export interface Container { id: string; container: string; - location: Location | number; + location?: Location | number; } export interface Location { x: number; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index 60ab284..dbf6330 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,4 +1,5 @@ -import { Skills } from "../common/tables/IBotBase"; +import { QuestStatus } from "../../../models/enums/QuestStatus"; +import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -7,7 +8,7 @@ export interface IItemEventRouterBase { warnings: Warning[]; profileChanges: TProfileChanges | ""; } -export declare type TProfileChanges = Record; +export type TProfileChanges = Record; export interface Warning { index: number; errmsg: string; @@ -21,10 +22,23 @@ export interface ProfileChange { ragFairOffers: IRagfairOffer[]; builds: BuildChange[]; items: ItemChanges; - production: Record; + production: Record; + /** Hideout area improvement id */ + improvements: Record; skills: Skills; - traderRelations: Record; + health: Health; + traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; + recipeUnlocked: Record; + questsStatus: QuestStatusChange[]; +} +export interface QuestStatusChange { + qid: string; + startTime: number; + status: QuestStatus; + statusTimers: Record; + completedConditions: string[]; + availableAfter: number; } export interface BuildChange { id: string; @@ -37,13 +51,9 @@ export interface ItemChanges { change: Product[]; del: Product[]; } -export interface Production { - Progress: number; - StartTimestamp: number; - ProductionTime: number; - inProgress: boolean; - RecipeId: string; - Products: Product[]; +export interface Improvement { + completed: boolean; + improveCompleteTimestamp: number; } export interface Product { _id: string; @@ -59,10 +69,3 @@ export interface ItemChangeLocation { r: number; isSearched?: boolean; } -export interface TraderRelations { - salesSum?: number; - standing?: number; - loyalty?: number; - unlocked?: boolean; - disabled?: boolean; -} diff --git a/Faupi-MunitionsExpert/server/types/models/eft/launcher/IRemoveProfileData.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/launcher/IRemoveProfileData.d.ts index d31c9ac..4cc5618 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/launcher/IRemoveProfileData.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/launcher/IRemoveProfileData.d.ts @@ -1,2 +1,2 @@ import { ILoginRequestData } from "./ILoginRequestData"; -export declare type IRemoveProfileData = ILoginRequestData; +export type IRemoveProfileData = ILoginRequestData; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts new file mode 100644 index 0000000..cbcc2f6 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts @@ -0,0 +1,30 @@ +export interface IGetRaidConfigurationRequestData { + timeVariant: string; + raidMode: string; + metabolismDisabled: boolean; + playersSpawnPlace: string; + timeAndWeatherSettings: TimeAndWeatherSettings; + botSettings: BotSettings; + wavesSettings: WavesSettings; + location: string; +} +export interface TimeAndWeatherSettings { + isRandomTime: boolean; + isRandomWeather: boolean; + cloudinessType: string; + rainType: string; + windType: string; + fogType: string; + timeFlowType: string; + hourOfDay: number; +} +export interface BotSettings { + isScavWars: boolean; + botAmount: string; +} +export interface WavesSettings { + botAmount: string; + botDifficulty: string; + isBosses: boolean; + isTaggedAndCursed: boolean; +} diff --git a/Faupi-MunitionsExpert/server/types/models/eft/match/IJoinMatchResult.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/match/IJoinMatchResult.d.ts index df695f4..81c9055 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/match/IJoinMatchResult.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/match/IJoinMatchResult.d.ts @@ -6,6 +6,8 @@ export interface IJoinMatchResult { port: number; version: string; location: string; - gamemode: string; + raidMode: string; + mode: string; shortid: string; + additional_info: any[]; } diff --git a/Faupi-MunitionsExpert/server/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/match/IStartOffineRaidRequestData.d.ts deleted file mode 100644 index 1983728..0000000 --- a/Faupi-MunitionsExpert/server/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { BotAmount } from "../../enums/BotAmount"; -import { BotDifficulty } from "../../enums/BotDifficulty"; -export interface IStartOfflineRaidRequestData { - locationName: string; - /** Current time, not in-game time */ - startTime: number; - /** CURR = am, past = pm */ - dateTime: "CURR" | "PAST"; - gameSettings: GameSettings; -} -export interface GameSettings { - timeAndWeatherSettings: TimeAndWeatherSettings; - botsSettings: BotsSettings; - wavesSettings: WavesSettings; -} -export interface TimeAndWeatherSettings { - isRandomTime: boolean; - isRandomWeather: boolean; -} -export interface BotsSettings { - isEnabled: boolean; - isScavWars: boolean; - botAmount: BotAmount; -} -export interface WavesSettings { - botDifficulty: BotDifficulty; - isBosses: boolean; - isTaggedAndCursed: boolean; - wavesBotAmount: BotAmount; -} diff --git a/Faupi-MunitionsExpert/server/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/profile/GetProfileStatusResponseData.d.ts index cb7368c..1228c2e 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -6,7 +6,13 @@ export interface ProfileData { profileid: string; profileToken: string; status: string; - sid: string; ip: string; port: number; + sid: string; + version?: string; + location?: string; + raidMode?: string; + mode?: string; + shortId?: string; + additional_info?: any[]; } diff --git a/Faupi-MunitionsExpert/server/types/models/eft/profile/IAkiProfile.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/profile/IAkiProfile.d.ts index cf28c12..2cea0c8 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/profile/IAkiProfile.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/profile/IAkiProfile.d.ts @@ -11,6 +11,12 @@ export interface IAkiProfile { vitality: Vitality; inraid: Inraid; insurance: Insurance[]; + /** Assort purchases made by player since last trader refresh */ + traderPurchases?: Record>; +} +export declare class TraderPurchaseData { + count: number; + purchaseTimestamp: number; } export interface Info { id: string; @@ -93,6 +99,13 @@ export interface DateTime { } export interface Aki { version: string; + mods?: ModDetails[]; +} +export interface ModDetails { + name: string; + version: string; + author: string; + dateAdded: number; } export interface Vitality { health: Health; diff --git a/Faupi-MunitionsExpert/server/types/models/eft/quests/IFailQuestRequestData.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/quests/IFailQuestRequestData.d.ts new file mode 100644 index 0000000..5881d91 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/models/eft/quests/IFailQuestRequestData.d.ts @@ -0,0 +1,5 @@ +export interface IFailQuestRequestData { + Action: "QuestComplete"; + qid: string; + removeExcessItems: boolean; +} diff --git a/Faupi-MunitionsExpert/server/types/models/eft/ragfair/IRagfairOffer.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/ragfair/IRagfairOffer.d.ts index 792ec7d..6b28718 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/ragfair/IRagfairOffer.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/ragfair/IRagfairOffer.d.ts @@ -23,6 +23,7 @@ export interface IRagfairOffer { summaryCost: number; user: IRagfairOfferUser; notAvailable: boolean; + /** TODO - implement this value - not currently used */ CurrentItemCount: number; priority: boolean; } diff --git a/Faupi-MunitionsExpert/server/types/models/eft/trade/IProcessSellTradeRequestData.d.ts b/Faupi-MunitionsExpert/server/types/models/eft/trade/IProcessSellTradeRequestData.d.ts index f1d555f..dee0cd5 100644 --- a/Faupi-MunitionsExpert/server/types/models/eft/trade/IProcessSellTradeRequestData.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/eft/trade/IProcessSellTradeRequestData.d.ts @@ -3,6 +3,7 @@ export interface IProcessSellTradeRequestData extends IProcessBaseTradeRequestDa Action: "sell_to_trader"; type: string; tid: string; + price: number; items: Item[]; } export interface Item { diff --git a/Faupi-MunitionsExpert/server/types/models/enums/BaseClasses.d.ts b/Faupi-MunitionsExpert/server/types/models/enums/BaseClasses.d.ts index 4eb6f7e..c6e880a 100644 --- a/Faupi-MunitionsExpert/server/types/models/enums/BaseClasses.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/enums/BaseClasses.d.ts @@ -1,13 +1,17 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", + UBGL = "55818b014bdc2ddc698b456b", ARMOR = "5448e54d4bdc2dcc718b4568", ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", HEADWEAR = "5a341c4086f77401f2541505", FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", + COMPOUND = "566162e44bdc2d3f298b4573", VISORS = "5448e5724bdc2ddf718b4568", FOOD = "5448e8d04bdc2ddf718b4569", + GAS_BLOCK = "56ea9461d2720b67698b456f", + RAIL_COVER = "55818b1d4bdc2d5b648b4572", DRINK = "5448e8d64bdc2dce718b4568", BARTER_ITEM = "5448eb774bdc2d0a728b4567", INFO = "5448ecbe4bdc2d60728b4568", @@ -27,6 +31,7 @@ export declare enum BaseClasses { MUZZLE = "5448fe394bdc2d0d028b456c", SIGHTS = "5448fe7a4bdc2d6f028b456b", MEDS = "543be5664bdc2dd4348b4569", + MAP = "567849dd4bdc2d150f8b456e", MONEY = "543be5dd4bdc2deb348b4569", NIGHTVISION = "5a2c3a9486f774688b05e574", KEY = "543be5e94bdc2df1348b4568", @@ -36,6 +41,7 @@ export declare enum BaseClasses { THROW_WEAPON = "543be6564bdc2df4348b4568", FOOD_DRINK = "543be6674bdc2df1348b4569", PISTOL = "5447b5cf4bdc2d65278b4567", + REVOLVER = "617f1ef5e8b54b0998387733", SMG = "5447b5e04bdc2d62278b4567", ASSAULT_RIFLE = "5447b5f14bdc2d61278b4567", ASSAULT_CARBINE = "5447b5fc4bdc2d87278b4567", @@ -73,9 +79,10 @@ export declare enum BaseClasses { TACTICAL_COMBO = "55818b164bdc2ddc698b456c", FLASHLIGHT = "55818b084bdc2d5b648b4571", MAGAZINE = "5448bc234bdc2d3c308b4569", - LIGHT_LASER = "55818b0e4bdc2dde698b456e", + LIGHT_LASER_DESIGNATOR = "55818b0e4bdc2dde698b456e", FLASH_HIDER = "550aa4bf4bdc2dd6348b456b", COLLIMATOR = "55818ad54bdc2ddc698b4569", + IRON_SIGHT = "55818ac54bdc2d5b648b456e", COMPACT_COLLIMATOR = "55818acf4bdc2dde698b456b", COMPENSATOR = "550aa4af4bdc2dd4348b456e", OPTIC_SCOPE = "55818ae44bdc2dde698b456c", diff --git a/Faupi-MunitionsExpert/server/types/models/enums/ELocationName.d.ts b/Faupi-MunitionsExpert/server/types/models/enums/ELocationName.d.ts index 7ae7caa..c52ae87 100644 --- a/Faupi-MunitionsExpert/server/types/models/enums/ELocationName.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/enums/ELocationName.d.ts @@ -8,5 +8,6 @@ export declare enum ELocationName { LIGHTHOUSE = "Lighthouse", LABORATORY = "laboratory", RESERVE = "RezervBase", + STREETS = "TarkovStreets", ANY = "any" } diff --git a/Faupi-MunitionsExpert/server/types/models/enums/ExitStatis.d.ts b/Faupi-MunitionsExpert/server/types/models/enums/ExitStatis.d.ts new file mode 100644 index 0000000..78d9733 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/models/enums/ExitStatis.d.ts @@ -0,0 +1,7 @@ +export declare enum ExitStatus { + SURVIVED = 0, + KILLED = 1, + LEFT = 2, + RUNNER = 3, + MISSINGINACTION = 4 +} diff --git a/Faupi-MunitionsExpert/server/types/models/enums/HideoutAreas.d.ts b/Faupi-MunitionsExpert/server/types/models/enums/HideoutAreas.d.ts index b44a20a..c8313d9 100644 --- a/Faupi-MunitionsExpert/server/types/models/enums/HideoutAreas.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/enums/HideoutAreas.d.ts @@ -21,5 +21,7 @@ export declare enum HideoutAreas { SOLAR_POWER = 18, BOOZE_GENERATOR = 19, BITCOIN_FARM = 20, - CHRISTMAS_TREE = 21 + CHRISTMAS_TREE = 21, + EMERGENCY_WALL = 22, + GYM = 23 } diff --git a/Faupi-MunitionsExpert/server/types/models/enums/HideoutEventActions.d.ts b/Faupi-MunitionsExpert/server/types/models/enums/HideoutEventActions.d.ts index e441477..aa04131 100644 --- a/Faupi-MunitionsExpert/server/types/models/enums/HideoutEventActions.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/enums/HideoutEventActions.d.ts @@ -7,5 +7,7 @@ export declare enum HideoutEventActions { HIDEOUT_SINGLE_PRODUCTION_START = "HideoutSingleProductionStart", HIDEOUT_SCAV_CASE_PRODUCTION_START = "HideoutScavCaseProductionStart", HIDEOUT_CONTINUOUS_PRODUCTION_START = "HideoutContinuousProductionStart", - HIDEOUT_TAKE_PRODUCTION = "HideoutTakeProduction" + HIDEOUT_TAKE_PRODUCTION = "HideoutTakeProduction", + HIDEOUT_RECORD_SHOOTING_RANGE_POINTS = "RecordShootingRangePoints", + HIDEOUT_IMPROVE_AREA = "HideoutImproveArea" } diff --git a/Faupi-MunitionsExpert/server/types/models/enums/ItemEventActions.d.ts b/Faupi-MunitionsExpert/server/types/models/enums/ItemEventActions.d.ts index 0e65453..94061f8 100644 --- a/Faupi-MunitionsExpert/server/types/models/enums/ItemEventActions.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/enums/ItemEventActions.d.ts @@ -15,5 +15,6 @@ export declare enum ItemEventActions { CREATE_MAP_MARKER = "CreateMapMarker", DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", - OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer" + OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" } diff --git a/Faupi-MunitionsExpert/server/types/models/enums/QuestRewardType.d.ts b/Faupi-MunitionsExpert/server/types/models/enums/QuestRewardType.d.ts index 16f7e39..ff8c5f4 100644 --- a/Faupi-MunitionsExpert/server/types/models/enums/QuestRewardType.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/enums/QuestRewardType.d.ts @@ -4,5 +4,6 @@ export declare enum QuestRewardType { TRADER_STANDING = "TraderStanding", TRADER_UNLOCK = "TraderUnlock", ITEM = "Item", - ASSORTMENT_UNLOCK = "AssortmentUnlock" + ASSORTMENT_UNLOCK = "AssortmentUnlock", + PRODUCTIONS_SCHEME = "ProductionScheme" } diff --git a/Faupi-MunitionsExpert/server/types/models/enums/QuestStatus.d.ts b/Faupi-MunitionsExpert/server/types/models/enums/QuestStatus.d.ts index ba65933..e706c05 100644 --- a/Faupi-MunitionsExpert/server/types/models/enums/QuestStatus.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/enums/QuestStatus.d.ts @@ -7,5 +7,6 @@ export declare enum QuestStatus { Fail = 5, FailRestartable = 6, MarkedAsFailed = 7, - Expired = 8 + Expired = 8, + AvailableAfter = 9 } diff --git a/Faupi-MunitionsExpert/server/types/models/enums/Traders.d.ts b/Faupi-MunitionsExpert/server/types/models/enums/Traders.d.ts index 163cd71..ffea725 100644 --- a/Faupi-MunitionsExpert/server/types/models/enums/Traders.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/enums/Traders.d.ts @@ -6,5 +6,6 @@ export declare enum Traders { PEACEKEEPER = "5935c25fb3acc3127c3d8cd9", MECHANIC = "5a7c2eca46aef81a7ca2145d", RAGMAN = "5ac3b934156ae10c4430e83c", - JAEGER = "5c0647fdd443bc2504c2d371" + JAEGER = "5c0647fdd443bc2504c2d371", + LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57" } diff --git a/Faupi-MunitionsExpert/server/types/models/external/HttpFramework.d.ts b/Faupi-MunitionsExpert/server/types/models/external/HttpFramework.d.ts index 3b4a56a..64a37d6 100644 --- a/Faupi-MunitionsExpert/server/types/models/external/HttpFramework.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/external/HttpFramework.d.ts @@ -1,6 +1,6 @@ /// import { IncomingMessage, ServerResponse } from "http"; -export declare type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void; +export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void; /** * Associates handlers, HTTP methods and a base url to a listener using a proxy * @param basePath The base path diff --git a/Faupi-MunitionsExpert/server/types/models/external/IPostAkiLoadModAsync.d.ts b/Faupi-MunitionsExpert/server/types/models/external/IPostAkiLoadModAsync.d.ts new file mode 100644 index 0000000..073ce6e --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/models/external/IPostAkiLoadModAsync.d.ts @@ -0,0 +1,4 @@ +import { DependencyContainer } from "./tsyringe"; +export interface IPostAkiLoadModAsync { + postAkiLoadAsync(container: DependencyContainer): Promise; +} diff --git a/Faupi-MunitionsExpert/server/types/models/external/IPostDBLoadModAsync.d.ts b/Faupi-MunitionsExpert/server/types/models/external/IPostDBLoadModAsync.d.ts new file mode 100644 index 0000000..b23825a --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/models/external/IPostDBLoadModAsync.d.ts @@ -0,0 +1,4 @@ +import { DependencyContainer } from "./tsyringe"; +export interface IPostDBLoadModAsync { + postDBLoadAsync(container: DependencyContainer): Promise; +} diff --git a/Faupi-MunitionsExpert/server/types/models/external/IPreAkiLoadModAsync.d.ts b/Faupi-MunitionsExpert/server/types/models/external/IPreAkiLoadModAsync.d.ts new file mode 100644 index 0000000..1249ff1 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/models/external/IPreAkiLoadModAsync.d.ts @@ -0,0 +1,4 @@ +import { DependencyContainer } from "./tsyringe"; +export interface IPreAkiLoadModAsync { + preAkiLoadAsync(container: DependencyContainer): Promise; +} diff --git a/Faupi-MunitionsExpert/server/types/models/spt/bots/BotGenerationDetails.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/bots/BotGenerationDetails.d.ts index 256de03..26571a2 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/bots/BotGenerationDetails.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/bots/BotGenerationDetails.d.ts @@ -3,6 +3,8 @@ export interface BotGenerationDetails { isPmc: boolean; /** assault/pmcBot etc */ role: string; + /** Side of bot */ + side: string; /** Active players current level */ playerLevel: number; /** Delta of highest level of bot */ diff --git a/Faupi-MunitionsExpert/server/types/models/spt/bots/GenerateWeaponResult.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/bots/GenerateWeaponResult.d.ts index f099752..56fa481 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/bots/GenerateWeaponResult.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/bots/GenerateWeaponResult.d.ts @@ -3,7 +3,8 @@ import { Item } from "../../eft/common/tables/IItem"; import { ITemplateItem } from "../../eft/common/tables/ITemplateItem"; export declare class GenerateWeaponResult { weapon: Item[]; - chosenAmmo: string; + chosenAmmoTpl: string; + chosenUbglAmmoTpl: string; weaponMods: Mods; weaponTemplate: ITemplateItem; } diff --git a/Faupi-MunitionsExpert/server/types/models/spt/callbacks/IDataCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/callbacks/IDataCallbacks.d.ts index a098560..b4f4f8c 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/callbacks/IDataCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/callbacks/IDataCallbacks.d.ts @@ -6,7 +6,6 @@ import { IHideoutProduction } from "../../eft/hideout/IHideoutProduction"; import { IHideoutScavCase } from "../../eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "../../eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { ILanguageBase } from "../server/ILocaleBase"; import { ISettingsBase } from "../server/ISettingsBase"; export interface IDataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; @@ -20,7 +19,7 @@ export interface IDataCallbacks { getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string; } diff --git a/Faupi-MunitionsExpert/server/types/models/spt/callbacks/IHideoutCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/callbacks/IHideoutCallbacks.d.ts index e9badb6..ad2af48 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/callbacks/IHideoutCallbacks.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/callbacks/IHideoutCallbacks.d.ts @@ -6,7 +6,7 @@ import { IHideoutPutItemInRequestData } from "../../eft/hideout/IHideoutPutItemI import { IHideoutTakeItemOutRequestData } from "../../eft/hideout/IHideoutTakeItemOutRequestData"; import { IHideoutToggleAreaRequestData } from "../../eft/hideout/IHideoutToggleAreaRequestData"; import { IHideoutSingleProductionStartRequestData } from "../../eft/hideout/IHideoutSingleProductionStartRequestData"; -import { IHideoutContinousProductionStartRequestData } from "../../eft/hideout/IHideoutContinousProductionStartRequestData"; +import { IHideoutContinuousProductionStartRequestData } from "../../eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutTakeProductionRequestData } from "../../eft/hideout/IHideoutTakeProductionRequestData"; import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; export interface IHideoutCallbacks { @@ -17,7 +17,7 @@ export interface IHideoutCallbacks { toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse; scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse; - continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; update(timeSinceLastRun: number): boolean; } diff --git a/Faupi-MunitionsExpert/server/types/models/spt/callbacks/IMatchCallbacks.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/callbacks/IMatchCallbacks.d.ts deleted file mode 100644 index fcbf173..0000000 --- a/Faupi-MunitionsExpert/server/types/models/spt/callbacks/IMatchCallbacks.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { IStartOfflineRaidRequestData } from "../../eft/match/IStartOffineRaidRequestData"; -import { IEndOfflineRaidRequestData } from "../../eft/match/IEndOfflineRaidRequestData"; -import { INullResponseData } from "../../eft/httpResponse/INullResponseData"; -import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { IPmcData } from "../../eft/common/IPmcData"; -export interface IMatchCallbacks { - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; - exitToMenu(url: string, info: any, sessionID: string): INullResponseData; - startGroupSearch(url: string, info: any, sessionID: string): INullResponseData; - stopGroupSearch(url: string, info: any, sessionID: string): INullResponseData; - sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; - getProfile(url: string, info: any, sessionID: string): IGetBodyResponseData; - serverAvailable(url: string, info: any, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; - joinMatch(url: string, info: any, sessionID: string): IGetBodyResponseData; - getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; - getGroupStatus(url: string, info: any, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; - deleteGroup(url: string, info: any, sessionID: string): INullResponseData; - startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; - endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; -} diff --git a/Faupi-MunitionsExpert/server/types/models/spt/config/IAirdropConfig.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/config/IAirdropConfig.d.ts index 53df991..627b603 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/config/IAirdropConfig.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/config/IAirdropConfig.d.ts @@ -6,6 +6,8 @@ export interface IAirdropConfig extends IBaseConfig { planeMinFlyHeight: number; planeMaxFlyHeight: number; planeVolume: number; + planeSpeed: number; + crateFallSpeed: number; airdropMinStartTimeSeconds: number; airdropMaxStartTimeSeconds: number; loot: AirdropLoot; @@ -17,6 +19,7 @@ export interface AirdropChancePercent { shoreline: number; interchange: number; reserve: number; + tarkovStreets: number; } export interface AirdropLoot { presetCount: MinMax; diff --git a/Faupi-MunitionsExpert/server/types/models/spt/config/IBotConfig.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/config/IBotConfig.d.ts index 83897db..fcbc179 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/config/IBotConfig.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/config/IBotConfig.d.ts @@ -25,6 +25,7 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; /** Batch generation size when type not available in cache */ @@ -66,8 +67,10 @@ export interface LootNvalue { } export interface EquipmentFilters { weaponModLimits: ModLimits; + weaponSightWhitelist: Record; faceShieldIsActiveChancePercent?: number; lightLaserIsActiveChancePercent?: number; + nvgIsActiveChancePercent?: number; randomisation: RandomisationDetails[]; blacklist: EquipmentFilterDetails[]; whitelist: EquipmentFilterDetails[]; @@ -82,6 +85,7 @@ export interface ModLimits { } export interface RandomisationDetails { levelRange: MinMax; + generation?: Record; randomisedWeaponModSlots?: string[]; randomisedArmorSlots?: string[]; /** Equipment chances */ diff --git a/Faupi-MunitionsExpert/server/types/models/spt/config/IBotDurability.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/config/IBotDurability.d.ts index 38a47cc..a4ff53c 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/config/IBotDurability.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/config/IBotDurability.d.ts @@ -14,19 +14,9 @@ export interface IBotDurability { } /** Durability values to be used when a more specific bot type cant be found */ export interface DefaultDurability { - armor: DefaultArmor; + armor: ArmorDurability; weapon: WeaponDurability; } -export interface DefaultArmor { - maxDelta: number; - minDelta: number; -} -export interface WeaponDurability { - lowestMax: number; - highestMax: number; - maxDelta: number; - minDelta: number; -} export interface PmcDurability { armor: PmcDurabilityArmor; weapon: WeaponDurability; @@ -44,4 +34,12 @@ export interface BotDurability { export interface ArmorDurability { maxDelta: number; minDelta: number; + minLimitPercent: number; +} +export interface WeaponDurability { + lowestMax: number; + highestMax: number; + maxDelta: number; + minDelta: number; + minLimitPercent: number; } diff --git a/Faupi-MunitionsExpert/server/types/models/spt/config/ICoreConfig.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/config/ICoreConfig.d.ts index cfcaf61..b2819a4 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/config/ICoreConfig.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/config/ICoreConfig.d.ts @@ -4,4 +4,5 @@ export interface ICoreConfig extends IBaseConfig { akiVersion: string; projectName: string; compatibleTarkovVersion: string; + commit: string; } diff --git a/Faupi-MunitionsExpert/server/types/models/spt/config/IHideoutConfig.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/config/IHideoutConfig.d.ts index f232052..0785f1e 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/config/IHideoutConfig.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/config/IHideoutConfig.d.ts @@ -3,9 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - generatorSpeedWithoutFuel: number; - generatorFuelFlowRate: number; - airFilterUnitFlowRate: number; - /** SEE HIDEOUTHELPER BEFORE CHANGING CONFIG */ - gpuBoostRate: number; + hideoutWallAppearTimeSeconds: number; } diff --git a/Faupi-MunitionsExpert/server/types/models/spt/config/IInsuranceConfig.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/config/IInsuranceConfig.d.ts index b27e753..fd498bc 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/config/IInsuranceConfig.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/config/IInsuranceConfig.d.ts @@ -5,5 +5,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnChancePercent: Record; blacklistedEquipment: string[]; slotIdsWithChanceOfNotReturning: string[]; + returnTimeOverrideSeconds: number; runIntervalSeconds: number; } diff --git a/Faupi-MunitionsExpert/server/types/models/spt/config/ILocationConfig.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/config/ILocationConfig.d.ts index 0551d57..f808ad8 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/config/ILocationConfig.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/config/ILocationConfig.d.ts @@ -1,8 +1,21 @@ +import { BossLocationSpawn, Wave } from "../../../models/eft/common/ILocationBase"; import { IBaseConfig } from "./IBaseConfig"; export interface ILocationConfig extends IBaseConfig { kind: "aki-location"; + fixEmptyBotWaves: boolean; + fixRoguesTakingAllSpawnsOnLighthouse: boolean; + lighthouseRogueSpawnTimeSeconds: number; looseLootMultiplier: LootMultiplier; staticLootMultiplier: LootMultiplier; + customWaves: CustomWaves; + /** Open zones to add to map */ + openZones: Record; + /** Key = map id, value = item tpls that should only have one forced loot spawn position */ + forcedLootSingleSpawnById: Record; +} +export interface CustomWaves { + boss: Record; + normal: Record; } export interface LootMultiplier { bigmap: number; diff --git a/Faupi-MunitionsExpert/server/types/models/spt/config/IPlayerScavConfig.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/config/IPlayerScavConfig.d.ts index 5ac3966..3a65e83 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/config/IPlayerScavConfig.d.ts @@ -9,6 +9,7 @@ export interface KarmaLevel { modifiers: Modifiers; itemLimits: ItemLimits; equipmentBlacklist: Record; + labsAccessCardChancePercent: number; } export interface Modifiers { equipment: Record; diff --git a/Faupi-MunitionsExpert/server/types/models/spt/config/IQuestConfig.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/config/IQuestConfig.d.ts index 45c9aae..9adfaba 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/config/IQuestConfig.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/config/IQuestConfig.d.ts @@ -3,12 +3,24 @@ import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { kind: "aki-quest"; redeemTime: number; + questTemplateIds: IPlayerTypeQuestIds; repeatableQuests: IRepeatableQuestConfig[]; + locationIdMap: Record; bearOnlyQuests: string[]; usecOnlyQuests: string[]; } +export interface IPlayerTypeQuestIds { + pmc: IQuestTypeIds; + scav: IQuestTypeIds; +} +export interface IQuestTypeIds { + Elimination: string; + Completion: string; + Exploration: string; +} export interface IRepeatableQuestConfig { name: string; + side: string; types: string[]; resetTime: number; numQuests: number; @@ -16,11 +28,12 @@ export interface IRepeatableQuestConfig { rewardScaling: IRewardScaling; locations: Record; traderWhitelist: ITraderWhitelist[]; - questConfig: IQuestConfig; + questConfig: IRepeatableQuestTypesConfig; /** Item base types to block when generating rewards */ rewardBaseTypeBlacklist: string[]; /** Item tplIds to ignore when generating rewards */ rewardBlacklist: string[]; + rewardAmmoStackMinSize: number; } export interface IRewardScaling { levels: number[]; @@ -34,7 +47,7 @@ export interface ITraderWhitelist { traderId: string; questTypes: string[]; } -export interface IQuestConfig { +export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; Elimination: IElimination; diff --git a/Faupi-MunitionsExpert/server/types/models/spt/config/IRagfairConfig.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/config/IRagfairConfig.d.ts index 6786417..3fa04de 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/config/IRagfairConfig.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/config/IRagfairConfig.d.ts @@ -16,7 +16,7 @@ export interface Sell { } export interface Chance { base: number; - overprices: number; + overpriced: number; underpriced: number; } export interface Time { @@ -29,6 +29,7 @@ export interface Reputation { loss: number; } export interface Dynamic { + purchasesAreFoundInRaid: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; @@ -43,9 +44,10 @@ export interface Dynamic { rating: MinMax; currencies: Record; showAsSingleStack: string[]; + removeSeasonalItemsWhenNotInEvent: boolean; blacklist: Blacklist; } -export declare class Barter { +export interface Barter { enable: boolean; chancePercent: number; itemCountMin: number; @@ -54,7 +56,7 @@ export declare class Barter { minRoubleCostToBecomeBarter: number; itemTypeBlacklist: string[]; } -export declare class OfferAdjustment { +export interface OfferAdjustment { maxPriceDifferenceBelowHandbookPercent: number; handbookPriceMultipier: number; priceThreshholdRub: number; diff --git a/Faupi-MunitionsExpert/server/types/models/spt/config/IRepairConfig.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/config/IRepairConfig.d.ts index 23e6838..b6db332 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/config/IRepairConfig.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/config/IRepairConfig.d.ts @@ -1,7 +1,25 @@ +import { MinMax } from "../../../models/common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; export interface IRepairConfig extends IBaseConfig { kind: "aki-repair"; priceMultiplier: number; applyRandomizeDurabilityLoss: boolean; weaponSkillRepairGain: number; + armorKitSkillPointGainPerRepairPointMultiplier: number; + repairKit: RepairKit; +} +export interface RepairKit { + armor: BonusSettings; + weapon: BonusSettings; +} +export interface BonusSettings { + rarityWeight: Record; + bonusTypeWeight: Record; + common: Record; + rare: Record; +} +export interface BonusValues { + valuesMinMax: MinMax; + /** What dura is buff active between (min max of current max) */ + activeDurabilityPercentMinMax: MinMax; } diff --git a/Faupi-MunitionsExpert/server/types/models/spt/config/ISeasonalEventConfig.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/config/ISeasonalEventConfig.d.ts index e410925..cedf9a9 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/config/ISeasonalEventConfig.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/config/ISeasonalEventConfig.d.ts @@ -5,6 +5,7 @@ export interface ISeasonalEventConfig extends IBaseConfig { /** event / botType / equipSlot / itemid */ eventGear: Record>>>; events: ISeasonalEvent[]; + gifterSettings: GifterSetting[]; } export interface ISeasonalEvent { name: string; @@ -13,3 +14,8 @@ export interface ISeasonalEvent { endDay: number; endMonth: number; } +export interface GifterSetting { + map: string; + zones: string; + spawnChance: number; +} diff --git a/Faupi-MunitionsExpert/server/types/models/spt/config/ITraderConfig.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/config/ITraderConfig.d.ts index 8342c99..56c7d35 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/config/ITraderConfig.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/config/ITraderConfig.d.ts @@ -1,10 +1,13 @@ +import { MinMax } from "../../../models/common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; + /** What % of max durability an item needs to sell to a trader*/ + durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; - minDurabilityForSale: number; + persistPurchaseDataInProfile: boolean; fence: FenceConfig; } export interface UpdateTime { @@ -12,13 +15,21 @@ export interface UpdateTime { seconds: number; } export interface FenceConfig { + discountOptions: DiscountOptions; partialRefreshTimeSeconds: number; partialRefreshChangePercent: number; assortSize: number; maxPresetsPercent: number; - presetPriceMult: number; itemPriceMult: number; - regenerateAssortsOnRefresh: boolean; + presetPriceMult: number; + armorMaxDurabilityPercentMinMax: MinMax; + presetMaxDurabilityPercentMinMax: MinMax; itemTypeLimits: Record; + regenerateAssortsOnRefresh: boolean; blacklist: string[]; } +export interface DiscountOptions { + assortSize: number; + itemPriceMult: number; + presetPriceMult: number; +} diff --git a/Faupi-MunitionsExpert/server/types/models/spt/mod/IMod.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/mod/IMod.d.ts deleted file mode 100644 index e6eec79..0000000 --- a/Faupi-MunitionsExpert/server/types/models/spt/mod/IMod.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export declare namespace ModLoader { - interface IMod { - name: string; - version: string; - main?: string; - author?: string; - license: string; - dependencies?: Record; - } -} diff --git a/Faupi-MunitionsExpert/server/types/models/spt/mod/IModLoader.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/mod/IModLoader.d.ts index 40a5e19..9a71f61 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/mod/IModLoader.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/mod/IModLoader.d.ts @@ -1,7 +1,5 @@ import { DependencyContainer } from "tsyringe"; export interface IModLoader { load(container: DependencyContainer): void; - getBundles(local: boolean): string; - getBundle(key: string, local: boolean): void; getModPath(mod: string): string; } diff --git a/Faupi-MunitionsExpert/server/types/models/spt/mod/IPackageJsonData.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/mod/IPackageJsonData.d.ts index 99e4ef9..06f7454 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/mod/IPackageJsonData.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/mod/IPackageJsonData.d.ts @@ -1,6 +1,6 @@ export interface IPackageJsonData { incompatibilities?: string[]; - dependencies?: string[]; + dependencies?: Record; modDependencies?: Record; name: string; author: string; @@ -8,5 +8,6 @@ export interface IPackageJsonData { akiVersion: string; licence: string; main: string; + isBundleMod: boolean; contributors: string[]; } diff --git a/Faupi-MunitionsExpert/server/types/models/spt/server/IDatabaseTables.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/server/IDatabaseTables.d.ts index 9978459..582d9e2 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/server/IDatabaseTables.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/server/IDatabaseTables.d.ts @@ -1,3 +1,4 @@ +import { IQteData } from "../../../models/eft/hideout/IQteData"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -30,6 +31,7 @@ export interface IDatabaseTables { production: IHideoutProduction[]; scavcase: IHideoutScavCase[]; settings: IHideoutSettingsBase; + qte: IQteData[]; }; locales?: ILocaleBase; locations?: ILocations; @@ -38,10 +40,8 @@ export interface IDatabaseTables { templates?: { character: string[]; items: Record; - quests: IQuest[]; + quests: Record; repeatableQuests: IRepeatableQuestDatabase; - /** DEPRECATED - Items file found in the client, massivly out of date compared to templates.items, try not to use this, remove ASAP*/ - clientItems: Record; handbook: IHandbookBase; customization: Record; /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ diff --git a/Faupi-MunitionsExpert/server/types/models/spt/server/ILocaleBase.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/server/ILocaleBase.d.ts index 6e20b89..3cdaf6f 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/server/ILocaleBase.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/server/ILocaleBase.d.ts @@ -1,49 +1,5 @@ export interface ILocaleBase { - global: Record; + global: Record>; menu: Record; - languages: ILanguageBase[]; -} -export interface ILocaleGlobalBase { - interface: Record; - enum: any[]; - mail: Record; - quest: Record; - preset: Record; - handbook: Record; - season: Record; - customization: Record; - repeatableQuest: Record; - templates: Record; - locations: Record; - banners: Record; - trading: Record; -} -export interface ILocaleQuest { - name: string; - description: string; - note: string; - failMessageText: string; - startedMessageText: string; - successMessageText: string; - conditions: Record; - location: string; -} -export interface ILocalePreset { - Name: string; -} -export interface ILocaleProps { - Name: string; - ShortName: string; - Description: string; -} -export interface ILocaleTradingProps { - FullName: string; - FirstName: string; - Nickname: string; - Location: string; - Description: string; -} -export interface ILanguageBase { - ShortName: string; - Name: string; + languages: Record; } diff --git a/Faupi-MunitionsExpert/server/types/models/spt/server/ISettingsBase.d.ts b/Faupi-MunitionsExpert/server/types/models/spt/server/ISettingsBase.d.ts index c067cda..2870cfb 100644 --- a/Faupi-MunitionsExpert/server/types/models/spt/server/ISettingsBase.d.ts +++ b/Faupi-MunitionsExpert/server/types/models/spt/server/ISettingsBase.d.ts @@ -10,7 +10,9 @@ export interface Config { FirstCycleDelaySeconds: number; FramerateLimit: FramerateLimit; GroupStatusInterval: number; + GroupStatusButtonInterval: number; KeepAliveInterval: number; + LobbyKeepAliveInterval: number; Mark502and504AsNonImportant: boolean; MemoryManagementSettings: MemoryManagementSettings; NVidiaHighlights: boolean; @@ -18,7 +20,10 @@ export interface Config { PingServerResultSendInterval: number; PingServersInterval: number; ReleaseProfiler: ReleaseProfiler; + RequestConfirmationTimeouts: number[]; + RequestsMadeThroughLobby: string[]; SecondCycleDelaySeconds: number; + ShouldEstablishLobbyConnection: boolean; TurnOffLogging: boolean; WeaponOverlapDistanceCulling: number; WebDiagnosticsEnabled: boolean; diff --git a/Faupi-MunitionsExpert/server/types/routers/EventOutputHolder.d.ts b/Faupi-MunitionsExpert/server/types/routers/EventOutputHolder.d.ts index 7a2387b..9a34219 100644 --- a/Faupi-MunitionsExpert/server/types/routers/EventOutputHolder.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/EventOutputHolder.d.ts @@ -1,11 +1,41 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IPmcData } from "../models/eft/common/IPmcData"; +import { IHideoutImprovement, Productive } from "../models/eft/common/tables/IBotBase"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { JsonUtil } from "../utils/JsonUtil"; +import { TimeUtil } from "../utils/TimeUtil"; export declare class EventOutputHolder { protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; - constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected timeUtil: TimeUtil; + /** What has client been informed of this game session */ + protected clientActiveSessionStorage: Record; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper, timeUtil: TimeUtil); protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; + /** + * Reset the response object to a default state + * Occurs prior to event being handled by server + * @param sessionID Players id + */ resetOutput(sessionID: string): void; + /** + * Update output object with most recent values from player profile + * @param sessionId Session id + */ + updateOutputProperties(sessionId: string): void; + /** + * Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true + * @param pmcData Player profile + * @returns dictionary of hideout improvements + */ + protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; + /** + * Return productions from player profile except those completed crafts the client has already seen + * @param pmcData Player profile + * @returns dictionary of hideout productions + */ + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; } diff --git a/Faupi-MunitionsExpert/server/types/routers/ItemEventRouter.d.ts b/Faupi-MunitionsExpert/server/types/routers/ItemEventRouter.d.ts index e80d16c..9c7f70e 100644 --- a/Faupi-MunitionsExpert/server/types/routers/ItemEventRouter.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/ItemEventRouter.d.ts @@ -1,14 +1,22 @@ -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 { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; +import { LocalisationService } from "../services/LocalisationService"; import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; - constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], localisationService: LocalisationService, eventOutputHolder: EventOutputHolder); + /** + * + * @param info Event request + * @param sessionID Session id + * @returns Item response + */ handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; } diff --git a/Faupi-MunitionsExpert/server/types/routers/item_events/CustomizationItemEventRouter.d.ts b/Faupi-MunitionsExpert/server/types/routers/item_events/CustomizationItemEventRouter.d.ts index e78445e..32519b1 100644 --- a/Faupi-MunitionsExpert/server/types/routers/item_events/CustomizationItemEventRouter.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/item_events/CustomizationItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { CustomizationCallbacks } from "../../callbacks/CustomizationCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class CustomizationItemEventRouter extends ItemEventRouterDefinition { protected customizationCallbacks: CustomizationCallbacks; constructor(customizationCallbacks: CustomizationCallbacks); diff --git a/Faupi-MunitionsExpert/server/types/routers/item_events/HealthItemEventRouter.d.ts b/Faupi-MunitionsExpert/server/types/routers/item_events/HealthItemEventRouter.d.ts index 99847c6..2b2b91d 100644 --- a/Faupi-MunitionsExpert/server/types/routers/item_events/HealthItemEventRouter.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/item_events/HealthItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { HealthCallbacks } from "../../callbacks/HealthCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class HealthItemEventRouter extends ItemEventRouterDefinition { protected healthCallbacks: HealthCallbacks; constructor(healthCallbacks: HealthCallbacks); diff --git a/Faupi-MunitionsExpert/server/types/routers/item_events/InsuranceItemEventRouter.d.ts b/Faupi-MunitionsExpert/server/types/routers/item_events/InsuranceItemEventRouter.d.ts index a922cc0..3b6ae8c 100644 --- a/Faupi-MunitionsExpert/server/types/routers/item_events/InsuranceItemEventRouter.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/item_events/InsuranceItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { InsuranceCallbacks } from "../../callbacks/InsuranceCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class InsuranceItemEventRouter extends ItemEventRouterDefinition { protected insuranceCallbacks: InsuranceCallbacks; constructor(insuranceCallbacks: InsuranceCallbacks); diff --git a/Faupi-MunitionsExpert/server/types/routers/item_events/InventoryItemEventRouter.d.ts b/Faupi-MunitionsExpert/server/types/routers/item_events/InventoryItemEventRouter.d.ts index 953d322..d6a6ae5 100644 --- a/Faupi-MunitionsExpert/server/types/routers/item_events/InventoryItemEventRouter.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/item_events/InventoryItemEventRouter.d.ts @@ -1,10 +1,12 @@ +import { HideoutCallbacks } from "../../callbacks/HideoutCallbacks"; import { InventoryCallbacks } from "../../callbacks/InventoryCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; import { IPmcData } from "../../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryItemEventRouter extends ItemEventRouterDefinition { protected inventoryCallbacks: InventoryCallbacks; - constructor(inventoryCallbacks: InventoryCallbacks); + protected hideoutCallbacks: HideoutCallbacks; + constructor(inventoryCallbacks: InventoryCallbacks, hideoutCallbacks: HideoutCallbacks); getHandledRoutes(): HandledRoute[]; handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse; } diff --git a/Faupi-MunitionsExpert/server/types/routers/item_events/NoteItemEventRouter.d.ts b/Faupi-MunitionsExpert/server/types/routers/item_events/NoteItemEventRouter.d.ts index 59bf598..71ed5d4 100644 --- a/Faupi-MunitionsExpert/server/types/routers/item_events/NoteItemEventRouter.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/item_events/NoteItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { NoteCallbacks } from "../../callbacks/NoteCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class NoteItemEventRouter extends ItemEventRouterDefinition { protected noteCallbacks: NoteCallbacks; constructor(noteCallbacks: NoteCallbacks); diff --git a/Faupi-MunitionsExpert/server/types/routers/item_events/PresetBuildItemEventRouter.d.ts b/Faupi-MunitionsExpert/server/types/routers/item_events/PresetBuildItemEventRouter.d.ts index 277db44..f2a7bf3 100644 --- a/Faupi-MunitionsExpert/server/types/routers/item_events/PresetBuildItemEventRouter.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/item_events/PresetBuildItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { PresetBuildCallbacks } from "../../callbacks/PresetBuildCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class PresetBuildItemEventRouter extends ItemEventRouterDefinition { protected presetBuildCallbacks: PresetBuildCallbacks; constructor(presetBuildCallbacks: PresetBuildCallbacks); diff --git a/Faupi-MunitionsExpert/server/types/routers/item_events/RagfairItemEventRouter.d.ts b/Faupi-MunitionsExpert/server/types/routers/item_events/RagfairItemEventRouter.d.ts index 9216cc5..986d9e7 100644 --- a/Faupi-MunitionsExpert/server/types/routers/item_events/RagfairItemEventRouter.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/item_events/RagfairItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { RagfairCallbacks } from "../../callbacks/RagfairCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class RagfairItemEventRouter extends ItemEventRouterDefinition { protected ragfairCallbacks: RagfairCallbacks; constructor(ragfairCallbacks: RagfairCallbacks); diff --git a/Faupi-MunitionsExpert/server/types/routers/item_events/RepairItemEventRouter.d.ts b/Faupi-MunitionsExpert/server/types/routers/item_events/RepairItemEventRouter.d.ts index 5196ba9..1c2768c 100644 --- a/Faupi-MunitionsExpert/server/types/routers/item_events/RepairItemEventRouter.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/item_events/RepairItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { RepairCallbacks } from "../../callbacks/RepairCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class RepairItemEventRouter extends ItemEventRouterDefinition { protected repairCallbacks: RepairCallbacks; constructor(repairCallbacks: RepairCallbacks); diff --git a/Faupi-MunitionsExpert/server/types/routers/item_events/TradeItemEventRouter.d.ts b/Faupi-MunitionsExpert/server/types/routers/item_events/TradeItemEventRouter.d.ts index a43bb0a..5d84559 100644 --- a/Faupi-MunitionsExpert/server/types/routers/item_events/TradeItemEventRouter.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/item_events/TradeItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { TradeCallbacks } from "../../callbacks/TradeCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class TradeItemEventRouter extends ItemEventRouterDefinition { protected tradeCallbacks: TradeCallbacks; constructor(tradeCallbacks: TradeCallbacks); diff --git a/Faupi-MunitionsExpert/server/types/routers/item_events/WishlistItemEventRouter.d.ts b/Faupi-MunitionsExpert/server/types/routers/item_events/WishlistItemEventRouter.d.ts index 38497fb..9e3c2a0 100644 --- a/Faupi-MunitionsExpert/server/types/routers/item_events/WishlistItemEventRouter.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/item_events/WishlistItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { WishlistCallbacks } from "../../callbacks/WishlistCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistItemEventRouter extends ItemEventRouterDefinition { protected wishlistCallbacks: WishlistCallbacks; constructor(wishlistCallbacks: WishlistCallbacks); diff --git a/Faupi-MunitionsExpert/server/types/routers/save_load/HealthSaveLoadRouter.d.ts b/Faupi-MunitionsExpert/server/types/routers/save_load/HealthSaveLoadRouter.d.ts index 114f5b2..26cb07a 100644 --- a/Faupi-MunitionsExpert/server/types/routers/save_load/HealthSaveLoadRouter.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/save_load/HealthSaveLoadRouter.d.ts @@ -1,5 +1,5 @@ -import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; import { HandledRoute, SaveLoadRouter } from "../../di/Router"; +import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; export declare class HealthSaveLoadRouter extends SaveLoadRouter { constructor(); getHandledRoutes(): HandledRoute[]; diff --git a/Faupi-MunitionsExpert/server/types/routers/save_load/InraidSaveLoadRouter.d.ts b/Faupi-MunitionsExpert/server/types/routers/save_load/InraidSaveLoadRouter.d.ts index 4c00b40..40f388e 100644 --- a/Faupi-MunitionsExpert/server/types/routers/save_load/InraidSaveLoadRouter.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/save_load/InraidSaveLoadRouter.d.ts @@ -1,5 +1,5 @@ -import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; import { HandledRoute, SaveLoadRouter } from "../../di/Router"; +import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; export declare class InraidSaveLoadRouter extends SaveLoadRouter { constructor(); getHandledRoutes(): HandledRoute[]; diff --git a/Faupi-MunitionsExpert/server/types/routers/save_load/InsuranceSaveLoadRouter.d.ts b/Faupi-MunitionsExpert/server/types/routers/save_load/InsuranceSaveLoadRouter.d.ts index 30ce98e..22d645e 100644 --- a/Faupi-MunitionsExpert/server/types/routers/save_load/InsuranceSaveLoadRouter.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/save_load/InsuranceSaveLoadRouter.d.ts @@ -1,5 +1,5 @@ -import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; import { HandledRoute, SaveLoadRouter } from "../../di/Router"; +import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; export declare class InsuranceSaveLoadRouter extends SaveLoadRouter { constructor(); getHandledRoutes(): HandledRoute[]; diff --git a/Faupi-MunitionsExpert/server/types/routers/save_load/ProfileSaveLoadRouter.d.ts b/Faupi-MunitionsExpert/server/types/routers/save_load/ProfileSaveLoadRouter.d.ts index 16c7619..f60af15 100644 --- a/Faupi-MunitionsExpert/server/types/routers/save_load/ProfileSaveLoadRouter.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/save_load/ProfileSaveLoadRouter.d.ts @@ -1,5 +1,5 @@ -import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; import { HandledRoute, SaveLoadRouter } from "../../di/Router"; +import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; export declare class ProfileSaveLoadRouter extends SaveLoadRouter { constructor(); getHandledRoutes(): HandledRoute[]; diff --git a/Faupi-MunitionsExpert/server/types/routers/serializers/ImageSerializer.d.ts b/Faupi-MunitionsExpert/server/types/routers/serializers/ImageSerializer.d.ts index 7f15bcf..5de48ff 100644 --- a/Faupi-MunitionsExpert/server/types/routers/serializers/ImageSerializer.d.ts +++ b/Faupi-MunitionsExpert/server/types/routers/serializers/ImageSerializer.d.ts @@ -1,7 +1,7 @@ /// +import { IncomingMessage, ServerResponse } from "http"; import { Serializer } from "../../di/Serializer"; import { ImageRouter } from "../ImageRouter"; -import { IncomingMessage, ServerResponse } from "http"; export declare class ImageSerializer extends Serializer { protected imageRouter: ImageRouter; constructor(imageRouter: ImageRouter); diff --git a/Faupi-MunitionsExpert/server/types/servers/RagfairServer.d.ts b/Faupi-MunitionsExpert/server/types/servers/RagfairServer.d.ts index c93864b..f49654a 100644 --- a/Faupi-MunitionsExpert/server/types/servers/RagfairServer.d.ts +++ b/Faupi-MunitionsExpert/server/types/servers/RagfairServer.d.ts @@ -4,6 +4,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { LocalisationService } from "../services/LocalisationService"; import { RagfairCategoriesService } from "../services/RagfairCategoriesService"; import { RagfairOfferService } from "../services/RagfairOfferService"; import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService"; @@ -14,13 +15,14 @@ export declare class RagfairServer { protected ragfairOfferService: RagfairOfferService; protected ragfairCategoriesService: RagfairCategoriesService; protected ragfairRequiredItemsService: RagfairRequiredItemsService; + protected localisationService: LocalisationService; protected traderHelper: TraderHelper; protected traderAssortHelper: TraderAssortHelper; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, traderHelper: TraderHelper, traderAssortHelper: TraderAssortHelper, configServer: ConfigServer); - load(): void; - update(): void; + constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, localisationService: LocalisationService, traderHelper: TraderHelper, traderAssortHelper: TraderAssortHelper, configServer: ConfigServer); + load(): Promise; + update(): Promise; /** * Get traders who need to be periodically refreshed * @returns string array of traders diff --git a/Faupi-MunitionsExpert/server/types/servers/SaveServer.d.ts b/Faupi-MunitionsExpert/server/types/servers/SaveServer.d.ts index 4dca514..402befc 100644 --- a/Faupi-MunitionsExpert/server/types/servers/SaveServer.d.ts +++ b/Faupi-MunitionsExpert/server/types/servers/SaveServer.d.ts @@ -14,17 +14,71 @@ export declare class SaveServer { protected logger: ILogger; protected profileFilepath: string; protected profiles: {}; - protected onSave: {}; + protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + /** + * Add callback to occur prior to saving profile changes + * @param id Id for save callback + * @param callback Callback to execute prior to running SaveServer.saveProfile() + */ + addBeforeSaveCallback(id: string, callback: (profile: Partial) => Partial): void; + /** + * Remove a callback from being executed prior to saving profile in SaveServer.saveProfile() + * @param id Id of callback to remove + */ + removeBeforeSaveCallback(id: string): void; + /** + * Load all profiles in /user/profiles folder into memory (this.profiles) + */ load(): void; + /** + * Save changes for each profile from memory into user/profiles json + */ save(): void; + /** + * Get a player profile from memory + * @param sessionId Session id + * @returns IAkiProfile + */ getProfile(sessionId: string): IAkiProfile; + /** + * Get all profiles from memory + * @returns Dictionary of IAkiProfile + */ getProfiles(): Record; + /** + * Delete a profile by id + * @param sessionID Id of profile to remove + * @returns true when deleted, false when profile not found + */ deleteProfileById(sessionID: string): boolean; + /** + * Create a new profile in memory with empty pmc/scav objects + * @param profileInfo Basic profile data + */ createProfile(profileInfo: Info): void; + /** + * Add full profile in memory by key (info.id) + * @param profileDetails Profile to save + */ addProfile(profileDetails: IAkiProfile): void; + /** + * Look up profile json in user/profiles by id and store in memory + * Execute saveLoadRouters callbacks after being loaded into memory + * @param sessionID Id of profile to store in memory + */ loadProfile(sessionID: string): void; + /** + * Save changes from in-memory profile to user/profiles json + * Execute onBeforeSaveCallbacks callbacks prior to being saved to json + * @param sessionID profile id (user/profiles/id.json) + */ saveProfile(sessionID: string): void; + /** + * Remove a physical profile json from user/profiles + * @param sessionID Profile id to remove + * @returns true if file no longer exists + */ removeProfile(sessionID: string): boolean; } diff --git a/Faupi-MunitionsExpert/server/types/servers/http/AkiHttpListener.d.ts b/Faupi-MunitionsExpert/server/types/servers/http/AkiHttpListener.d.ts index acf92aa..d02861e 100644 --- a/Faupi-MunitionsExpert/server/types/servers/http/AkiHttpListener.d.ts +++ b/Faupi-MunitionsExpert/server/types/servers/http/AkiHttpListener.d.ts @@ -13,16 +13,18 @@ export declare class AkiHttpListener implements IHttpListener { protected httpRouter: HttpRouter; protected serializers: Serializer[]; protected logger: ILogger; + protected requestsLogger: ILogger; protected jsonUtil: JsonUtil; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; protected httpBufferHandler: HttpBufferHandler; constructor(httpRouter: HttpRouter, // TODO: delay required - serializers: Serializer[], logger: ILogger, jsonUtil: JsonUtil, httpResponse: HttpResponseUtil, localisationService: LocalisationService, httpBufferHandler: HttpBufferHandler); + serializers: Serializer[], logger: ILogger, requestsLogger: ILogger, jsonUtil: JsonUtil, httpResponse: HttpResponseUtil, localisationService: LocalisationService, httpBufferHandler: HttpBufferHandler); canHandle(_: string, req: IncomingMessage): boolean; handle(sessionId: string, req: IncomingMessage, resp: ServerResponse): void; sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void; getResponse(sessionID: string, req: IncomingMessage, body: Buffer): string; - protected getBodyInfo(body: Buffer): string; - sendZlibJson(resp: ServerResponse, output: any, sessionID: string): void; + protected getBodyInfo(body: Buffer): any; + sendJson(resp: ServerResponse, output: string, sessionID: string): void; + sendZlibJson(resp: ServerResponse, output: string, sessionID: string): void; } diff --git a/Faupi-MunitionsExpert/server/types/services/BotEquipmentFilterService.d.ts b/Faupi-MunitionsExpert/server/types/services/BotEquipmentFilterService.d.ts index 43e64b0..089cfb5 100644 --- a/Faupi-MunitionsExpert/server/types/services/BotEquipmentFilterService.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,6 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; +import { MinMax } from "../models/common/MinMax"; +import { EquipmentChances, Generation, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -24,6 +25,24 @@ export declare class BotEquipmentFilterService { * @param baseValues Values to update */ protected adjustChances(equipmentChanges: Record, baseValues: EquipmentChances | ModsChances): void; + /** + * Iterate over the Generation changes and alter data in baseValues.Generation + * @param generationChanges Changes to apply + * @param baseBotGeneration dictionary to update + */ + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + /** + * Get equipment settings for bot + * @param botEquipmentRole equipment role to return + * @returns EquipmentFilters object + */ + getBotEquipmentSettings(botEquipmentRole: string): EquipmentFilters; + /** + * Get weapon sight whitelist for a specific bot type + * @param botEquipmentRole equipment role of bot to look up + * @returns Dictionary of weapon type and their whitelisted scope types + */ + getBotWeaponSightWhitelist(botEquipmentRole: string): Record; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for @@ -39,14 +58,14 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retreive clothing weighting adjustments from bot.json config + * Retrieve clothing weighting adjustments from bot.json config * @param botRole Bot type to get adjustments for * @param playerLevel level of player * @returns Weighting adjustments for bots clothing */ protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; /** - * Retreive item weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config * @param botRole Bot type to get adjustments for * @param playerLevel level of player * @returns Weighting adjustments for bot items @@ -54,7 +73,7 @@ export declare class BotEquipmentFilterService { protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json - * Prioritises whitelist first, if one is found blacklist is ignored + * Prioritizes whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update * @param blacklist equipment blacklist * @returns Filtered bot file @@ -62,10 +81,10 @@ export declare class BotEquipmentFilterService { protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** * Filter bot cartridges based on blacklist and whitelist from config/bot.json - * Prioritises whitelist first, if one is found blacklist is ignored + * Prioritizes whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update * @param blacklist equipment on this list should be excluded from the bot - * @param whitelist equipment on this list should be used exclusivly + * @param whitelist equipment on this list should be used exclusively * @returns Filtered bot file */ protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; diff --git a/Faupi-MunitionsExpert/server/types/services/BotEquipmentModPoolService.d.ts b/Faupi-MunitionsExpert/server/types/services/BotEquipmentModPoolService.d.ts new file mode 100644 index 0000000..adf59ff --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/services/BotEquipmentModPoolService.d.ts @@ -0,0 +1,65 @@ +import { ItemHelper } from "../helpers/ItemHelper"; +import { Mods } from "../models/eft/common/tables/IBotType"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { VFS } from "../utils/VFS"; +/** Store a mapping between weapons, their slots and the items that fit those slots */ +export declare class BotEquipmentModPoolService { + protected logger: ILogger; + protected vfs: VFS; + protected itemHelper: ItemHelper; + protected databaseServer: DatabaseServer; + protected configServer: ConfigServer; + protected botConfig: IBotConfig; + protected weaponModPool: Mods; + protected gearModPool: Mods; + protected weaponPoolGenerated: boolean; + protected armorPoolGenerated: boolean; + constructor(logger: ILogger, vfs: VFS, itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer); + /** + * Store dictionary of mods for each item passed in + * @param items items to find related mods and store in modPool + */ + protected generatePool(items: ITemplateItem[], poolType: string): void; + /** + * Empty the mod pool + */ + resetPool(): void; + /** + * Get array of compatible mods for an items mod slot (generate pool if it doesnt exist already) + * @param itemTpl item to look up + * @param slotName slot to get compatible mods for + * @returns tpls that fit the slot + */ + getCompatibleModsForWeaponSlot(itemTpl: string, slotName: string): string[]; + /** + * Get array of compatible mods for an items mod slot (generate pool if it doesnt exist already) + * @param itemTpl item to look up + * @param slotName slot to get compatible mods for + * @returns tpls that fit the slot + */ + getCompatibleModsFoGearSlot(itemTpl: string, slotName: string): string[]; + /** + * Get mods for a piece of gear by its tpl + * @param itemTpl items tpl to look up mods for + * @returns Dictionary of mods (keys are mod slot names) with array of compatible mod tpls as value + */ + getModsForGearSlot(itemTpl: string): Record; + /** + * Get mods for a weapon by its tpl + * @param itemTpl Weapons tpl to look up mods for + * @returns Dictionary of mods (keys are mod slot names) with array of compatible mod tpls as value + */ + getModsForWeaponSlot(itemTpl: string): Record; + /** + * Create weapon mod pool and set generated flag to true + */ + protected generateWeaponPool(): void; + /** + * Create gear mod pool and set generated flag to true + */ + protected generateGearPool(): void; +} diff --git a/Faupi-MunitionsExpert/server/types/services/BotGenerationCacheService.d.ts b/Faupi-MunitionsExpert/server/types/services/BotGenerationCacheService.d.ts index 0be0576..a491b03 100644 --- a/Faupi-MunitionsExpert/server/types/services/BotGenerationCacheService.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/BotGenerationCacheService.d.ts @@ -3,32 +3,34 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { ILogger } from "../models/spt/utils/ILogger"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { LocalisationService } from "./LocalisationService"; export declare class BotGenerationCacheService { protected logger: ILogger; protected randomUtil: RandomUtil; protected jsonUtil: JsonUtil; + protected localisationService: LocalisationService; protected botHelper: BotHelper; protected storedBots: Map; - constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, botHelper: BotHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, localisationService: LocalisationService, botHelper: BotHelper); /** * Store array of bots in cache, shuffle results before storage * @param botsToStore Bots we want to store in the cache */ - storeBots(botsToStore: IBotBase[]): void; + storeBots(key: string, botsToStore: IBotBase[]): void; /** * Find and return a bot based on its role * Remove bot from internal array so it can't be retreived again - * @param role role to retreive (assault/bossTagilla etc) + * @param key role to retreive (assault/bossTagilla etc) * @returns IBotBase object */ - getBot(role: string): IBotBase; + getBot(key: string): IBotBase; /** * Remove all cached bot profiles */ clearStoredBots(): void; /** - * Does cache have bots - * @returns true if empty + * Does cache have a bot with requested key + * @returns false if empty */ - cacheHasBotOfRole(role: string): boolean; + cacheHasBotOfRole(key: string): boolean; } diff --git a/Faupi-MunitionsExpert/server/types/services/BotLootCacheService.d.ts b/Faupi-MunitionsExpert/server/types/services/BotLootCacheService.d.ts index 00ffb9c..dab7c6d 100644 --- a/Faupi-MunitionsExpert/server/types/services/BotLootCacheService.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/BotLootCacheService.d.ts @@ -5,15 +5,17 @@ import { BotLootCache, LootCacheType } from "../models/spt/bots/BotLootCache"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { JsonUtil } from "../utils/JsonUtil"; +import { LocalisationService } from "./LocalisationService"; import { RagfairPriceService } from "./RagfairPriceService"; export declare class BotLootCacheService { protected logger: ILogger; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected pmcLootGenerator: PMCLootGenerator; + protected localisationService: LocalisationService; protected ragfairPriceService: RagfairPriceService; protected lootCache: Record; - constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, ragfairPriceService: RagfairPriceService); + constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService); /** * Remove all cached bot loot data */ diff --git a/Faupi-MunitionsExpert/server/types/services/BotWeaponModLimitService.d.ts b/Faupi-MunitionsExpert/server/types/services/BotWeaponModLimitService.d.ts new file mode 100644 index 0000000..f8ebc2f --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/services/BotWeaponModLimitService.d.ts @@ -0,0 +1,54 @@ +import { ItemHelper } from "../helpers/ItemHelper"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +export declare class BotModLimits { + scope: ItemCount; + scopeMax: number; + scopeBaseTypes: string[]; + flashlightLaser: ItemCount; + flashlightLaserMax: number; + flashlgihtLaserBaseTypes: string[]; +} +export declare class ItemCount { + count: number; +} +export declare class BotWeaponModLimitService { + protected logger: ILogger; + protected configServer: ConfigServer; + protected itemHelper: ItemHelper; + protected botConfig: IBotConfig; + constructor(logger: ILogger, configServer: ConfigServer, itemHelper: ItemHelper); + /** + * Initalise mod limits to be used when generating a weapon + * @param botRole "assault", "bossTagilla" or "pmc" + * @returns BotModLimits object + */ + getWeaponModLimits(botRole: string): BotModLimits; + /** + * Check if weapon mod item is on limited list + has surpassed the limit set for it + * Exception: Always allow ncstar backup mount + * Exception: Always allow scopes with a scope for a parent + * Exception: Always disallow mounts that hold only scopes once scope limit reached + * Exception: Always disallow mounts that hold only flashlights once flashlight limit reached + * @param botRole role the bot has e.g. assault + * @param modTemplate mods template data + * @param modLimits limits set for weapon being generated for this bot + * @param modsParent The parent of the mod to be checked + * @returns true if over item limit + */ + weaponModHasReachedLimit(botRole: string, modTemplate: ITemplateItem, modLimits: BotModLimits, modsParent: ITemplateItem, weapon: Item[]): boolean; + /** + * Check if the specific item type on the weapon has reached the set limit + * @param modTpl log mod tpl if over type limit + * @param currentCount current number of this item on gun + * @param maxLimit mod limit allowed + * @param botRole role of bot we're checking weapon of + * @returns true if limit reached + */ + protected weaponModLimitReached(modTpl: string, currentCount: { + count: number; + }, maxLimit: number, botRole: string): boolean; +} diff --git a/Faupi-MunitionsExpert/server/types/services/CustomLocationWaveService.d.ts b/Faupi-MunitionsExpert/server/types/services/CustomLocationWaveService.d.ts new file mode 100644 index 0000000..7d14f07 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/services/CustomLocationWaveService.d.ts @@ -0,0 +1,42 @@ +import { BossLocationSpawn, Wave } from "../models/eft/common/ILocationBase"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; +export declare class CustomLocationWaveService { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; + protected configServer: ConfigServer; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + /** + * Add a boss wave to a map + * @param locationId e.g. factory4_day, bigmap + * @param waveToAdd Boss wave to add to map + */ + addBossWaveToMap(locationId: string, waveToAdd: BossLocationSpawn): void; + /** + * Add a normal bot wave to a map + * @param locationId e.g. factory4_day, bigmap + * @param waveToAdd Wave to add to map + */ + addNormalWaveToMap(locationId: string, waveToAdd: Wave): void; + /** + * Clear all custom boss waves from a map + * @param locationId e.g. factory4_day, bigmap + */ + clearBossWavesForMap(locationId: string): void; + /** + * Clear all custom normal waves from a map + * @param locationId e.g. factory4_day, bigmap + */ + clearNormalWavesForMap(locationId: string): void; + /** + * Add custom boss and normal waves to maps found in config/location.json to db + */ + applyWaveChangesToAllMaps(): void; +} diff --git a/Faupi-MunitionsExpert/server/types/services/FenceService.d.ts b/Faupi-MunitionsExpert/server/types/services/FenceService.d.ts index bdcdeb2..d143380 100644 --- a/Faupi-MunitionsExpert/server/types/services/FenceService.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/FenceService.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; -import { FenceLevel } from "../models/eft/common/IGlobals"; +import { FenceLevel, Preset } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; @@ -15,6 +15,7 @@ import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { ItemFilterService } from "./ItemFilterService"; +import { LocalisationService } from "./LocalisationService"; /** * Handle actions surrounding Fence * e.g. generating or refreshing assorts / get next refresh time @@ -30,12 +31,25 @@ export declare class FenceService { protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected itemFilterService: ItemFilterService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; + /** Main assorts you see at all rep levels */ protected fenceAssort: ITraderAssort; + /** Assorts shown on a separte tab when you max out fence rep */ + protected fenceDiscountAssort: ITraderAssort; protected traderConfig: ITraderConfig; protected nextMiniRefreshTimestamp: number; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); - protected setFenceAssort(fenceAssort: ITraderAssort): void; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Replace main fence assort with new assort + * @param assort New assorts to replace old with + */ + protected setFenceAssort(assort: ITraderAssort): void; + /** + * Replace high rep level fence assort with new assort + * @param assort New assorts to replace old with + */ + protected setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -44,12 +58,27 @@ export declare class FenceService { */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; /** - * Adjust assorts price by a modifier - * @param item - * @param assort - * @param modifier + * Adjust all items contained inside an assort by a multiplier + * @param assort Assort that contains items with prices to adjust + * @param itemMultipler multipler to use on items + * @param presetMultiplier preset multipler to use on presets */ - protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; + protected adjustAssortItemPrices(assort: ITraderAssort, itemMultipler: number, presetMultiplier: number): void; + /** + * Merge two trader assort files together + * @param firstAssort assort 1# + * @param secondAssort assort #2 + * @returns merged assort + */ + protected mergeAssorts(firstAssort: ITraderAssort, secondAssort: ITraderAssort): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item assort item details + * @param assort assort to be modified + * @param modifier value to multiply item price by + * @param presetModifier value to multiply preset price by + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number, presetModifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -78,7 +107,7 @@ export declare class FenceService { /** * Choose an item (not mod) at random and remove from assorts */ - protected removeRandomItemFromAssorts(): void; + protected removeRandomItemFromAssorts(assort: ITraderAssort): void; /** * Get an integer rounded count of items to replace based on percentrage from traderConfig value * @param totalItemCount total item count @@ -91,20 +120,32 @@ export declare class FenceService { */ getOfferCount(): number; /** - * Create a trader assort for fence + * Create trader assorts for fence and store in fenceService cache */ - generateFenceAssortCache(): void; + generateFenceAssorts(): void; /** * Create skeleton to hold assort items * @returns ITraderAssort object */ protected createBaseTraderAssortItem(): ITraderAssort; /** - * Hydrate result parameter object with generated assorts + * Hydrate assorts parameter object with generated assorts * @param assortCount Number of assorts to generate - * @param assorts object to add assorts to + * @param assorts object to add created assorts to */ - protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + protected createAssorts(assortCount: number, assorts: ITraderAssort, loyaltyLevel: number): void; + protected addItemAssorts(assortCount: number, fenceAssortIds: string[], assorts: ITraderAssort, fenceAssort: ITraderAssort, itemTypeCounts: Record, loyaltyLevel: number): void; + /** + * Add preset weapons to fence presets + * @param assortCount how many assorts to add to assorts + * @param defaultWeaponPresets a dictionary of default weapon presets + * @param assorts object to add presets to + * @param loyaltyLevel loyalty level to requre item at + */ + protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/Faupi-MunitionsExpert/server/types/services/InsuranceService.d.ts b/Faupi-MunitionsExpert/server/types/services/InsuranceService.d.ts index 6be8a2f..886a298 100644 --- a/Faupi-MunitionsExpert/server/types/services/InsuranceService.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/InsuranceService.d.ts @@ -1,4 +1,6 @@ +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; +import { HandbookHelper } from "../helpers/HandbookHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -12,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; +import { LocalisationService } from "./LocalisationService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -21,14 +24,16 @@ export declare class InsuranceService { protected saveServer: SaveServer; protected traderHelper: TraderHelper; protected dialogueHelper: DialogueHelper; + protected handbookHelper: HandbookHelper; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; insuranceTraderArrayExists(sessionId: string, traderId: string): boolean; getInsurance(sessionId: string): Record; - getInsuranceItems(sessionId: string, traderId: string): any[]; + getInsuranceItems(sessionId: string, traderId: string): Item[]; resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; @@ -45,6 +50,13 @@ export declare class InsuranceService { * @param mapId Id of the map player died/exited that caused the insurance to be issued on */ sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; + /** + * Get a timestamp of what insurance items should be sent to player based on the type of trader used to insure + * @param pmcData Player profile + * @param trader Trader used to insure items + * @returns Timestamp to return items to player in seconds + */ + protected getInsuranceReturnTimestamp(pmcData: IPmcData, trader: ITraderBase): number; /** * Store lost gear post-raid inside profile * @param pmcData player profile to store gear in diff --git a/Faupi-MunitionsExpert/server/types/services/ItemBaseClassService.d.ts b/Faupi-MunitionsExpert/server/types/services/ItemBaseClassService.d.ts new file mode 100644 index 0000000..d7bc4bc --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/services/ItemBaseClassService.d.ts @@ -0,0 +1,39 @@ +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +/** + * Cache the baseids for each item in the tiems db inside a dictionary + */ +export declare class ItemBaseClassService { + protected logger: ILogger; + protected localisationService: LocalisationService; + protected databaseServer: DatabaseServer; + protected itemBaseClassesCache: Record; + protected cacheGenerated: boolean; + constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + /** + * Create cache and store inside ItemBaseClassService + */ + hydrateItemBaseClassCache(): void; + /** + * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary + * @param itemIdToUpdate item tpl to store base ids against in dictionary + * @param item item being checked + * @param allDbItems all items in db + */ + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + /** + * Does item tpl inherit from the requested base class + * @param itemTpl item to check base classes of + * @param baseClass base class to check for + * @returns true if item inherits from base class passed in + */ + itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Get base classes item inherits from + * @param itemTpl item to get base classes for + * @returns array of base classes + */ + getItemBaseClasses(itemTpl: string): string[]; +} diff --git a/Faupi-MunitionsExpert/server/types/services/LocaleService.d.ts b/Faupi-MunitionsExpert/server/types/services/LocaleService.d.ts index 8275b75..09c658b 100644 --- a/Faupi-MunitionsExpert/server/types/services/LocaleService.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/LocaleService.d.ts @@ -1,5 +1,4 @@ import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; -import { ILocaleGlobalBase } from "../models/spt/server/ILocaleBase"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -14,9 +13,9 @@ export declare class LocaleService { constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the eft globals db file based on the configured locale in config/locale.json, if not found, fall back to 'en' - * @returns ILocaleGlobalBase + * @returns dictionary */ - getLocaleDb(): ILocaleGlobalBase; + getLocaleDb(): Record; /** * Gets the game locale key from the locale.json file, * if value is 'system' get system locale diff --git a/Faupi-MunitionsExpert/server/types/services/OpenZoneService.d.ts b/Faupi-MunitionsExpert/server/types/services/OpenZoneService.d.ts new file mode 100644 index 0000000..8e70b94 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/services/OpenZoneService.d.ts @@ -0,0 +1,28 @@ +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; +import { LocalisationService } from "./LocalisationService"; +/** Service for adding new zones to a maps OpenZones property */ +export declare class OpenZoneService { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected configServer: ConfigServer; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Add open zone to specified map + * @param locationId map location (e.g. factory4_day) + * @param zoneToAdd zone to add + */ + addZoneToMap(locationId: string, zoneToAdd: string): void; + /** + * Add open zones to all maps found in config/location.json to db + */ + applyZoneChangesToAllMaps(): void; +} diff --git a/Faupi-MunitionsExpert/server/types/services/PaymentService.d.ts b/Faupi-MunitionsExpert/server/types/services/PaymentService.d.ts index c9ce95a..ac131ea 100644 --- a/Faupi-MunitionsExpert/server/types/services/PaymentService.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/PaymentService.d.ts @@ -25,12 +25,12 @@ export declare class PaymentService { constructor(logger: ILogger, httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, localisationService: LocalisationService, paymentHelper: PaymentHelper); /** * Take money and insert items into return to server request - * @param {Object} pmcData - * @param {Object} body + * @param {IPmcData} pmcData Player profile + * @param {IProcessBuyTradeRequestData} request * @param {string} sessionID * @returns Object */ - payMoney(pmcData: IPmcData, body: IProcessBuyTradeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse; + payMoney(pmcData: IPmcData, request: IProcessBuyTradeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Receive money back after selling * @param {IPmcData} pmcData @@ -60,9 +60,17 @@ export declare class PaymentService { /** * Prioritise player stash first over player inventory * Post-raid healing would often take money out of the players pockets/secure container - * @param a Firsat money stack item + * @param a First money stack item * @param b Second money stack item - * @returns sorted item + * @param inventoryItems players inventory items + * @returns sort order */ - protected moneySort(a: Item, b: Item): number; + protected prioritiseStashSort(a: Item, b: Item, inventoryItems: Item[]): number; + /** + * Recursivly check items parents to see if it is inside the players inventory, not stash + * @param itemId item id to check + * @param inventoryItems player inventory + * @returns true if its in inventory + */ + protected isInInventory(itemId: string, inventoryItems: Item[]): boolean; } diff --git a/Faupi-MunitionsExpert/server/types/services/PlayerService.d.ts b/Faupi-MunitionsExpert/server/types/services/PlayerService.d.ts index 2f364d5..1195b93 100644 --- a/Faupi-MunitionsExpert/server/types/services/PlayerService.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/PlayerService.d.ts @@ -1,5 +1,4 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { IPlayerIncrementSkillLevelRequestData } from "../models/eft/player/IPlayerIncrementSkillLevelRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "./LocalisationService"; @@ -11,11 +10,10 @@ export declare class PlayerService { /** * increases the profile skill and updates any output * @param {Object} pmcData - * @param {Object} output * @param {String} skillName * @param {Number} amount */ - incrementSkillLevel(pmcData: IPmcData, output: IPlayerIncrementSkillLevelRequestData, skillName: string, amount: number): void; + incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number): void; /** * @param {Object} pmcData * @returns number diff --git a/Faupi-MunitionsExpert/server/types/services/ProfileFixerService.d.ts b/Faupi-MunitionsExpert/server/types/services/ProfileFixerService.d.ts index 86a6af8..8d23ebc 100644 --- a/Faupi-MunitionsExpert/server/types/services/ProfileFixerService.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/ProfileFixerService.d.ts @@ -7,6 +7,7 @@ import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { HideoutAreas } from "../models/enums/HideoutAreas"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { TimeUtil } from "../utils/TimeUtil"; import { Watermark } from "../utils/Watermark"; import { LocalisationService } from "./LocalisationService"; export declare class ProfileFixerService { @@ -14,8 +15,9 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected localisationService: LocalisationService; + protected timeUtil: TimeUtil; protected databaseServer: DatabaseServer; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -32,6 +34,8 @@ export declare class ProfileFixerService { * @param pmcProfile profile to remove old counters from */ removeDanglingConditionCounters(pmcProfile: IPmcData): void; + addLighthouseKeeperIfMissing(pmcProfile: IPmcData): void; + protected addUnlockedInfoObjectIfMissing(pmcProfile: IPmcData): void; protected removeDanglingBackendCounters(pmcProfile: IPmcData): void; protected getActiveRepeatableQuests(repeatableQuests: IPmcDataRepeatableQuest[]): IRepeatableQuest[]; protected fixNullTraderSalesSums(pmcProfile: IPmcData): void; @@ -45,6 +49,11 @@ export declare class ProfileFixerService { protected updateProfileQuestDataValues(pmcProfile: IPmcData): void; protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void; protected addMissingWorkbenchWeaponSkills(pmcProfile: IPmcData): void; + /** + * Some profiles have hideout maxed and therefore no improvements + * @param pmcProfile Profile to add improvement data to + */ + protected addMissingWallImprovements(pmcProfile: IPmcData): void; /** * A new property was added to slot items "locationIndex", if this is missing, the hideout slot item must be removed * @param pmcProfile Profile to find and remove slots from @@ -85,4 +94,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(pmcProfile: IPmcData): void; + /** + * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 + * @param pmcProfile profile to update + */ + addMissingUpgradesPropertyToHideout(pmcProfile: IPmcData): void; + /** + * Iterate over associated profile template and check all hideout areas exist, add if not + * @param fullProfile Profile to update + */ + addMissingHideoutAreasToProfile(fullProfile: IAkiProfile): void; + /** + * These used to be used for storing scav case rewards, rewards are now generated on pickup + * @param pmcProfile Profile to update + */ + removeLegacyScavCaseProductionCrafts(pmcProfile: IPmcData): void; } diff --git a/Faupi-MunitionsExpert/server/types/services/RagfairLinkedItemService.d.ts b/Faupi-MunitionsExpert/server/types/services/RagfairLinkedItemService.d.ts index 6c34ee0..51511f9 100644 --- a/Faupi-MunitionsExpert/server/types/services/RagfairLinkedItemService.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/RagfairLinkedItemService.d.ts @@ -1,10 +1,21 @@ -import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { DatabaseServer } from "../servers/DatabaseServer"; export declare class RagfairLinkedItemService { protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected linkedItemsCache: Record>; - constructor(databaseServer: DatabaseServer); + constructor(databaseServer: DatabaseServer, itemHelper: ItemHelper); getLinkedItems(linkedSearchId: string): Iterable; + /** + * Create Dictionary of every item and the items associated with it + */ protected buildLinkedItemTable(): void; + /** + * Add ammo to revolvers linked item dictionary + * @param cylinder Revolvers cylinder + * @param applyLinkedItems + */ + protected addRevolverCylinderAmmoToLinkedItems(cylinder: ITemplateItem, applyLinkedItems: (items: string[]) => void): void; protected getFilters(item: ITemplateItem, slot: string): string[]; } diff --git a/Faupi-MunitionsExpert/server/types/services/RagfairOfferService.d.ts b/Faupi-MunitionsExpert/server/types/services/RagfairOfferService.d.ts index 86c1e52..fc08d39 100644 --- a/Faupi-MunitionsExpert/server/types/services/RagfairOfferService.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/RagfairOfferService.d.ts @@ -10,6 +10,7 @@ import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { RagfairOfferHolder } from "../utils/RagfairOfferHolder"; import { TimeUtil } from "../utils/TimeUtil"; import { LocalisationService } from "./LocalisationService"; import { RagfairCategoriesService } from "./RagfairCategoriesService"; @@ -26,10 +27,9 @@ export declare class RagfairOfferService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; - protected expiredOffers: Item[]; - /** offerId, offer */ - protected offers: Record; + protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; + protected ragfairOfferHandler: RagfairOfferHolder; constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers @@ -45,7 +45,7 @@ export declare class RagfairOfferService { * Get an array of expired items not yet processed into new offers * @returns items that need to be turned into offers */ - getExpiredOffers(): Item[]; + getExpiredOfferItems(): Item[]; resetExpiredOffers(): void; /** * Does the offer exist on the ragfair @@ -53,8 +53,17 @@ export declare class RagfairOfferService { * @returns offer exists - true */ doesOfferExist(offerId: string): boolean; + /** + * Remove an offer from ragfair by offer id + * @param offerId Offer id to remove + */ removeOfferById(offerId: string): void; - removeOfferStack(offerID: string, amount: number): void; + /** + * Reduce size of an offer stack by specified amount + * @param offerId Offer to adjust stack size of + * @param amount How much to deduct from offers stack size + */ + removeOfferStack(offerId: string, amount: number): void; removeAllOffersByTrader(traderId: string): void; /** * Do the trader offers on flea need to be refreshed @@ -65,11 +74,9 @@ export declare class RagfairOfferService { addPlayerOffers(): void; expireStaleOffers(): void; /** - * Get an array of stale offers that are still shown to player - * @returns IRagfairOffer array + * Remove stale offer from flea + * @param staleOffer Stale offer to process */ - protected getStaleOffers(): IRagfairOffer[]; - protected isStale(offer: IRagfairOffer, time: number): boolean; protected processStaleOffer(staleOffer: IRagfairOffer): void; protected returnPlayerOffer(offer: IRagfairOffer): IItemEventRouterResponse; } diff --git a/Faupi-MunitionsExpert/server/types/services/RagfairPriceService.d.ts b/Faupi-MunitionsExpert/server/types/services/RagfairPriceService.d.ts index 4ac7794..8b68bc4 100644 --- a/Faupi-MunitionsExpert/server/types/services/RagfairPriceService.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/RagfairPriceService.d.ts @@ -1,6 +1,8 @@ +import { OnLoad } from "../di/OnLoad"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; @@ -10,29 +12,38 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -import { OnLoad } from "../di/OnLoad"; +/** + * Stores flea prices for items as well as methods to interact with them + */ export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; + protected traderHelper: TraderHelper; 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; + constructor(handbookHelper: HandbookHelper, databaseServer: DatabaseServer, logger: ILogger, itemHelper: ItemHelper, presetHelper: PresetHelper, traderHelper: TraderHelper, randomUtil: RandomUtil, configServer: ConfigServer); + /** + * Generate static (handbook) and dynamic (prices.json) flea prices, store inside class as dictionaries + */ + onLoad(): Promise; getRoute(): string; /** * Iterate over all items of type "Item" in db and get template price, store in cache */ generateStaticPrices(): void; + /** + * Create a dictionary and store prices from prices.json in it + */ protected generateDynamicPrices(): void; /** - * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 * @param tplId Item tpl id to get price for * @returns price in roubles @@ -51,7 +62,12 @@ export declare class RagfairPriceService implements OnLoad { * @returns price in roubles */ getStaticPriceForItem(itemTpl: string): number; + /** + * Get prices for all items on flea, priorities dynamic prices from prices.json, use handbook prices if missing + * @returns Dictionary of item tpls and rouble cost + */ getAllFleaPrices(): Record; + getAllStaticPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -59,7 +75,18 @@ export declare class RagfairPriceService implements OnLoad { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; + /** + * Get the rouble price for an assorts barter scheme + * @param barterScheme + * @returns Rouble price + */ getBarterPrice(barterScheme: IBarterScheme[]): number; + /** + * Generate a currency cost for an item and its mods + * @param items Item with mods to get price for + * @param desiredCurrency Currency price desired in + * @returns cost of item in desired currency + */ 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 @@ -83,11 +110,20 @@ export declare class RagfairPriceService implements OnLoad { * @returns */ protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Get the highest price for an item that is stored in handbook or trader assorts + * @param itemTpl Item to get highest price of + * @returns rouble cost + */ + protected getHighestHandbookOrTraderPriceAsRouble(itemTpl: string): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) * @param presets weapon presets to choose from * @returns Default preset object */ - protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; + protected getWeaponPreset(presets: Preset[], weapon: Item): { + isDefault: boolean; + preset: Preset; + }; } diff --git a/Faupi-MunitionsExpert/server/types/services/RagfairRequiredItemsService.d.ts b/Faupi-MunitionsExpert/server/types/services/RagfairRequiredItemsService.d.ts index b05fc65..95c3ddb 100644 --- a/Faupi-MunitionsExpert/server/types/services/RagfairRequiredItemsService.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/RagfairRequiredItemsService.d.ts @@ -7,6 +7,6 @@ export declare class RagfairRequiredItemsService { protected ragfairOfferService: RagfairOfferService; protected requiredItemsCache: {}; constructor(logger: ILogger, paymentHelper: PaymentHelper, ragfairOfferService: RagfairOfferService); - getRequiredItems(searchId: string): any; + getRequiredItemsById(searchId: string): any; buildRequiredItemTable(): void; } diff --git a/Faupi-MunitionsExpert/server/types/services/RepairService.d.ts b/Faupi-MunitionsExpert/server/types/services/RepairService.d.ts index d3f1b35..a3c6c7a 100644 --- a/Faupi-MunitionsExpert/server/types/services/RepairService.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/RepairService.d.ts @@ -1,27 +1,33 @@ +import { ItemHelper } from "../helpers/ItemHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { RepairHelper } from "../helpers/RepairHelper"; import { TraderHelper } from "../helpers/TraderHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; -import { IRepairConfig } from "../models/spt/config/IRepairConfig"; +import { BonusSettings, IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; + protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected paymentService: PaymentService; protected repairHelper: RepairHelper; protected configServer: ConfigServer; - repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + protected repairConfig: IRepairConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -46,9 +52,8 @@ export declare class RepairService { * @param sessionId Session id * @param repairDetails details of item repaired, cost/item * @param pmcData Profile to add points to - * @param output IItemEventRouterResponse */ - addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData, output: IItemEventRouterResponse): void; + addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; /** * * @param sessionId Session id @@ -59,15 +64,65 @@ export declare class RepairService { * @returns Details of repair, item/price */ repairItemByKit(sessionId: string, pmcData: IPmcData, repairKits: RepairKitsInfo[], itemToRepairId: string, output: IItemEventRouterResponse): RepairDetails; + /** + * Calculate value repairkit points need to be divided by to get the durability points to be added to an item + * @param itemToRepairDetails Item to repair details + * @param isArmor Is the item being repaired armor + * @param pmcData Player profile + * @returns Number to divide kit points by + */ + protected getKitDivisor(itemToRepairDetails: ITemplateItem, isArmor: boolean, pmcData: IPmcData): number; + /** + * Get the bonus multiplier for a skill from a player profile + * @param skillBonusName Name of bonus to get multipler of + * @param pmcData Player profile to look in for skill + * @returns Multiplier value + */ + protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db * @param repairKitInInventory Repair kit to update */ protected addMaxResourceToKitIfMissing(repairKitDetails: ITemplateItem, repairKitInInventory: Item): void; + /** + * Chance to apply buff to an item (Armor/weapon) if repaired by armor kit + * @param repairDetails Repair details of item + * @param pmcData Player profile + */ + addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Add buff to item + * @param itemConfig weapon/armor config + * @param repairDetails Details for item to repair + */ + protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + /** + * Check if item should be buffed by checking the item type and relevant player skill level + * @param repairDetails Item that was repaired + * @param itemTpl tpl of item to be buffed + * @param pmcData Player profile + * @returns True if item should have buff applied + */ + protected shouldBuffItem(repairDetails: RepairDetails, pmcData: IPmcData): boolean; + /** + * Based on item, what underlying skill does this item use for buff settings + * @param itemTemplate Item to check for skill + * @returns Skill name + */ + protected getItemSkillType(itemTemplate: ITemplateItem): string; + /** + * Ensure multiplier is between 1 and 0.01 + * @param receiveDurabilityMaxPercent Max durabiltiy percent + * @param receiveDurabilityPercent current durability percent + * @returns durability multipler value + */ + protected getDurabilityMultiplier(receiveDurabilityMaxPercent: number, receiveDurabilityPercent: number): number; } export declare class RepairDetails { repairCost?: number; repairedItem: Item; repairedItemIsArmor: boolean; + repairAmount: number; + repairedByKit: boolean; } diff --git a/Faupi-MunitionsExpert/server/types/services/SeasonalEventService.d.ts b/Faupi-MunitionsExpert/server/types/services/SeasonalEventService.d.ts new file mode 100644 index 0000000..7474018 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/services/SeasonalEventService.d.ts @@ -0,0 +1,114 @@ +import { BotHelper } from "../helpers/BotHelper"; +import { Config } from "../models/eft/common/IGlobals"; +import { Inventory } from "../models/eft/common/tables/IBotType"; +import { ISeasonalEvent, ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class SeasonalEventService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected botHelper: BotHelper; + protected configServer: ConfigServer; + protected seasonalEventConfig: ISeasonalEventConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); + protected get events(): Record; + protected get christmasEventItems(): string[]; + protected get halloweenEventItems(): string[]; + /** + * Get an array of christmas items found in bots inventories as loot + * @returns array + */ + getChristmasEventItems(): string[]; + /** + * Get an array of halloween items found in bots inventories as loot + * @returns array + */ + getHalloweenEventItems(): string[]; + itemIsChristmasRelated(itemTpl: string): boolean; + itemIsHalloweenRelated(itemTpl: string): boolean; + /** + * Check if item id exists in christmas or halloween event arrays + * @param itemTpl item tpl to check for + * @returns + */ + itemIsSeasonalRelated(itemTpl: string): boolean; + /** + * Get an array of items that appear during a seasonal event + * returns multiple seasonal event items if they are both active + * @returns array of tpl strings + */ + getAllSeasonalEventItems(): string[]; + /** + * Get an array of seasonal items that should be blocked as seasonal is not active + * @returns Array of tpl strings + */ + getSeasonalEventItemsToBlock(): string[]; + /** + * Is a seasonal event currently active + * @returns true if event is active + */ + seasonalEventEnabled(): boolean; + /** + * is christmas event active + * @returns true if active + */ + christmasEventEnabled(): boolean; + /** + * is christmas event active + * @returns true if active + */ + halloweenEventEnabled(): boolean; + /** + * Is detection of seasonal events enabled (halloween / christmas) + * @returns true if seasonal events should be checked for + */ + isAutomaticEventDetectionEnabled(): boolean; + /** + * Get a dictionary of gear changes to apply to bots for a specific event e.g. Christmas/Halloween + * @param eventName Name of event to get gear changes for + * @returns bots with equipment changes + */ + protected getEventBotGear(eventName: string): Record>>; + /** + * Get the dates each seasonal event starts and ends at + * @returns Record with event name + start/end date + */ + getEventDetails(): ISeasonalEvent[]; + /** + * Check if current date falls inside any of the seasons events pased in, if so, handle them + */ + checkForAndEnableSeasonalEvents(): void; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in SeasonalEventService) + * @param nodeInventory Bots inventory to iterate over + * @param botRole the role of the bot being processed + */ + removeChristmasItemsFromBotInventory(nodeInventory: Inventory, botRole: string): void; + /** + * Make adjusted to server code based on the name of the event passed in + * @param globalConfig globals.json + * @param eventName Name of the event to enable. e.g. Christmas + */ + protected updateGlobalEvents(globalConfig: Config, eventName: string): void; + /** + * Add lootble items from backpack into patrol.ITEMS_TO_DROP difficulty property + */ + protected addLootItemsToGifterDropItemsList(): void; + /** + * Read in data from seasonalEvents.json and add found equipment items to bots + * @param eventName Name of the event to read equipment in from config + */ + protected addEventGearToBots(eventName: string): void; + protected addPumpkinsToScavBackpacks(): void; + /** + * Set Khorovod(dancing tree) chance to 100% on all maps that support it + */ + protected enableDancingTree(): void; + /** + * Add santa to maps + */ + protected addGifterBotToMaps(): void; +} diff --git a/Faupi-MunitionsExpert/server/types/services/TraderPurchasePersisterService.d.ts b/Faupi-MunitionsExpert/server/types/services/TraderPurchasePersisterService.d.ts new file mode 100644 index 0000000..7e7c88f --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/services/TraderPurchasePersisterService.d.ts @@ -0,0 +1,34 @@ +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { TraderPurchaseData } from "../models/eft/profile/IAkiProfile"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { TimeUtil } from "../utils/TimeUtil"; +/** + * Help with storing limited item purchases from traders in profile to persist them over server restarts + */ +export declare class TraderPurchasePersisterService { + protected logger: ILogger; + protected timeUtil: TimeUtil; + protected profileHelper: ProfileHelper; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, profileHelper: ProfileHelper, configServer: ConfigServer); + /** + * Get the purchases made from a trader for this profile before the last trader reset + * @param sessionId Session id + * @param traderId Trader to loop up purchases for + * @returns Dict of assort id and count purchased + */ + getProfileTraderPurchases(sessionId: string, traderId: string): Record; + /** + * Remove all trader purchase records from all profiles that exist + * @param traderId Traders id + */ + resetTraderPurchasesStoredInProfile(traderId: string): void; + /** + * Iterate over all server profiles and remove specific trader purchase data that has passed the trader refesh time + * @param traderId Trader id + */ + removeStalePurchasesFromProfiles(traderId: string): void; +} diff --git a/Faupi-MunitionsExpert/server/types/services/mod/onLoad/OnLoadMod.d.ts b/Faupi-MunitionsExpert/server/types/services/mod/onLoad/OnLoadMod.d.ts index 53fb062..a4b58b5 100644 --- a/Faupi-MunitionsExpert/server/types/services/mod/onLoad/OnLoadMod.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/mod/onLoad/OnLoadMod.d.ts @@ -1,8 +1,8 @@ import { OnLoad } from "../../../di/OnLoad"; -export declare class OnLoadMod extends OnLoad { +export declare class OnLoadMod implements OnLoad { private onLoadOverride; private getRouteOverride; constructor(onLoadOverride: () => void, getRouteOverride: () => string); - onLoad(): void; + onLoad(): Promise; getRoute(): string; } diff --git a/Faupi-MunitionsExpert/server/types/services/mod/onUpdate/OnUpdateMod.d.ts b/Faupi-MunitionsExpert/server/types/services/mod/onUpdate/OnUpdateMod.d.ts index ee89043..8dfe6dd 100644 --- a/Faupi-MunitionsExpert/server/types/services/mod/onUpdate/OnUpdateMod.d.ts +++ b/Faupi-MunitionsExpert/server/types/services/mod/onUpdate/OnUpdateMod.d.ts @@ -1,8 +1,8 @@ import { OnUpdate } from "../../../di/OnUpdate"; -export declare class OnUpdateMod extends OnUpdate { +export declare class OnUpdateMod implements OnUpdate { private onUpdateOverride; private getRouteOverride; constructor(onUpdateOverride: (timeSinceLastRun: number) => boolean, getRouteOverride: () => string); - onUpdate(timeSinceLastRun: number): boolean; + onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/Faupi-MunitionsExpert/server/types/utils/App.d.ts b/Faupi-MunitionsExpert/server/types/utils/App.d.ts index cc8a5af..b947c83 100644 --- a/Faupi-MunitionsExpert/server/types/utils/App.d.ts +++ b/Faupi-MunitionsExpert/server/types/utils/App.d.ts @@ -11,7 +11,7 @@ export declare class App { protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); - load(): void; - protected update(onUpdateComponents: OnUpdate[]): void; + load(): Promise; + protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; } diff --git a/Faupi-MunitionsExpert/server/types/utils/DatabaseImporter.d.ts b/Faupi-MunitionsExpert/server/types/utils/DatabaseImporter.d.ts index 31670ae..c09d63a 100644 --- a/Faupi-MunitionsExpert/server/types/utils/DatabaseImporter.d.ts +++ b/Faupi-MunitionsExpert/server/types/utils/DatabaseImporter.d.ts @@ -1,26 +1,35 @@ import { OnLoad } from "../di/OnLoad"; -import { IDatabaseTables } from "../models/spt/server/IDatabaseTables"; import { ILogger } from "../models/spt/utils/ILogger"; import { ImageRouter } from "../routers/ImageRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; +import { EncodingUtil } from "./EncodingUtil"; +import { HashUtil } from "./HashUtil"; +import { ImporterUtil } from "./ImporterUtil"; import { JsonUtil } from "./JsonUtil"; import { VFS } from "./VFS"; -export declare class DatabaseImporter extends OnLoad { +export declare class DatabaseImporter implements OnLoad { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected imageRouter: ImageRouter; - constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, localisationService: LocalisationService, databaseServer: DatabaseServer, imageRouter: ImageRouter); - onLoad(): void; + protected encodingUtil: EncodingUtil; + protected hashUtil: HashUtil; + protected importerUtil: ImporterUtil; + private hashedFile; + private valid; + private filepath; + constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, localisationService: LocalisationService, databaseServer: DatabaseServer, imageRouter: ImageRouter, encodingUtil: EncodingUtil, hashUtil: HashUtil, importerUtil: ImporterUtil); + onLoad(): Promise; /** * Read all json files in database folder and map into a json object * @param filepath path to database folder */ - protected hydrateDatabase(filepath: string): void; + protected hydrateDatabase(filepath: string): Promise; + private onReadValidate; getRoute(): string; - loadRecursive(filepath: string): IDatabaseTables; + private validateFile; loadImages(filepath: string): void; } diff --git a/Faupi-MunitionsExpert/server/types/utils/EncodingUtil.d.ts b/Faupi-MunitionsExpert/server/types/utils/EncodingUtil.d.ts new file mode 100644 index 0000000..dabb97a --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/utils/EncodingUtil.d.ts @@ -0,0 +1,15 @@ +export declare class EncodingUtil { + encode(value: string, encode: EncodeType): string; + decode(value: string, encode: EncodeType): string; + fromBase64(value: string): string; + toBase64(value: string): string; + fromHex(value: string): string; + toHex(value: string): string; +} +export declare enum EncodeType { + BASE64 = "base64", + HEX = "hex", + ASCII = "ascii", + BINARY = "binary", + UTF8 = "utf8" +} diff --git a/Faupi-MunitionsExpert/server/types/utils/ImporterUtil.d.ts b/Faupi-MunitionsExpert/server/types/utils/ImporterUtil.d.ts new file mode 100644 index 0000000..75aaf54 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/utils/ImporterUtil.d.ts @@ -0,0 +1,21 @@ +import { JsonUtil } from "./JsonUtil"; +import { VFS } from "./VFS"; +export declare class ImporterUtil { + protected vfs: VFS; + protected jsonUtil: JsonUtil; + constructor(vfs: VFS, jsonUtil: JsonUtil); + /** + * Load files into js objects recursively (asynchronous) + * @param filepath Path to folder with files + * @returns Promise return T type associated with this class + */ + loadRecursiveAsync(filepath: string, onReadCallback?: (fileWithPath: string, data: string) => void, onObjectDeserialized?: (fileWithPath: string, object: any) => void): Promise; + /** + * Load files into js objects recursively (synchronous) + * @param filepath Path to folder with files + * @returns + */ + loadRecursive(filepath: string, onReadCallback?: (fileWithPath: string, data: string) => void, onObjectDeserialized?: (fileWithPath: string, object: any) => void): T; + loadAsync(filepath: string, strippablePath?: string, onReadCallback?: (fileWithPath: string, data: string) => void, onObjectDeserialized?: (fileWithPath: string, object: any) => void): Promise; + protected placeObject(fileDeserialized: any, strippedFilePath: string, result: T, strippablePath: string): void; +} diff --git a/Faupi-MunitionsExpert/server/types/utils/JsonUtil.d.ts b/Faupi-MunitionsExpert/server/types/utils/JsonUtil.d.ts index 71e95f6..229dc26 100644 --- a/Faupi-MunitionsExpert/server/types/utils/JsonUtil.d.ts +++ b/Faupi-MunitionsExpert/server/types/utils/JsonUtil.d.ts @@ -6,6 +6,7 @@ export declare class JsonUtil { protected hashUtil: HashUtil; protected logger: ILogger; protected fileHashes: any; + protected jsonCacheExists: boolean; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string @@ -13,13 +14,14 @@ export declare class JsonUtil { * @param prettify Should output be prettified? * @returns string */ - serialize(data: any, prettify?: boolean): string; + serialize(data: T, prettify?: boolean): string; /** * From string to object * @param jsonString json string to turn into object * @returns object */ - deserialize(jsonString: string): any; - deserializeWithCacheCheck(jsonString: string, filePath: string): string; + deserialize(jsonString: string, filename?: string): T; + deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeWithCacheCheck(jsonString: string, filePath: string): T; clone(data: T): T; } diff --git a/Faupi-MunitionsExpert/server/types/utils/RagfairOfferHolder.d.ts b/Faupi-MunitionsExpert/server/types/utils/RagfairOfferHolder.d.ts new file mode 100644 index 0000000..46d9e23 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/utils/RagfairOfferHolder.d.ts @@ -0,0 +1,24 @@ +import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; +export declare class RagfairOfferHolder { + private offersById; + private offersByTemplate; + private offersByTrader; + constructor(); + getOfferById(id: string): IRagfairOffer; + getOffersByTemplate(templateId: string): Array; + getOffersByTrader(traderId: string): Array; + getOffers(): Array; + addOffers(offers: Array): void; + addOffer(offer: IRagfairOffer): void; + removeOffer(offer: IRagfairOffer): void; + removeOffers(offers: Array): void; + removeOfferByTrader(traderId: string): void; + /** + * Get an array of stale offers that are still shown to player + * @returns IRagfairOffer array + */ + getStaleOffers(time: number): Array; + private addOfferByTemplates; + private addOfferByTrader; + protected isStale(offer: IRagfairOffer, time: number): boolean; +} diff --git a/Faupi-MunitionsExpert/server/types/utils/RandomUtil.d.ts b/Faupi-MunitionsExpert/server/types/utils/RandomUtil.d.ts index aa556e3..fc0b05d 100644 --- a/Faupi-MunitionsExpert/server/types/utils/RandomUtil.d.ts +++ b/Faupi-MunitionsExpert/server/types/utils/RandomUtil.d.ts @@ -110,6 +110,7 @@ export declare class RandomUtil { getIntEx(max: number): number; getFloat(min: number, max: number): number; getBool(): boolean; + getPercentOfValue(percent: number, number: number, toFixed?: number): number; /** * Check if number passes a check out of 100 * @param chancePercent value check needs to be above diff --git a/Faupi-MunitionsExpert/server/types/utils/UUidGenerator.d.ts b/Faupi-MunitionsExpert/server/types/utils/UUidGenerator.d.ts index 000b719..ed1ffa6 100644 --- a/Faupi-MunitionsExpert/server/types/utils/UUidGenerator.d.ts +++ b/Faupi-MunitionsExpert/server/types/utils/UUidGenerator.d.ts @@ -1,4 +1,4 @@ import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator"; export declare class UUidGenerator implements IUUidGenerator { - generate: () => string; + generate(): string; } diff --git a/Faupi-MunitionsExpert/server/types/utils/VFS.d.ts b/Faupi-MunitionsExpert/server/types/utils/VFS.d.ts index e5eaf02..267b10f 100644 --- a/Faupi-MunitionsExpert/server/types/utils/VFS.d.ts +++ b/Faupi-MunitionsExpert/server/types/utils/VFS.d.ts @@ -1,7 +1,7 @@ /// /// -import "reflect-metadata"; import fs from "fs"; +import "reflect-metadata"; import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue"; import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator"; export declare class VFS { @@ -32,8 +32,9 @@ export declare class VFS { createDirAsync(filepath: string): Promise; copyDir(filepath: string, target: string, fileExtensions?: string | string[]): void; copyDirAsync(filepath: string, target: string, fileExtensions: string | string[]): Promise; - readFile(filepath: string): any; - readFileAsync(filepath: string): Promise; + readFile(...args: Parameters): string; + readFileAsync(path: fs.PathLike): Promise; + private isBuffer; writeFile(filepath: any, data?: string, append?: boolean, atomic?: boolean): void; writeFileAsync(filepath: any, data?: string, append?: boolean, atomic?: boolean): Promise; getFiles(filepath: string): string[]; diff --git a/Faupi-MunitionsExpert/server/types/utils/Watermark.d.ts b/Faupi-MunitionsExpert/server/types/utils/Watermark.d.ts index e02eba2..f870cf1 100644 --- a/Faupi-MunitionsExpert/server/types/utils/Watermark.d.ts +++ b/Faupi-MunitionsExpert/server/types/utils/Watermark.d.ts @@ -30,7 +30,11 @@ export declare class Watermark { * @returns string */ getVersionTag(withEftVersion?: boolean): string; - getVersionLabel(): string; + /** + * Get text shown in game on screen, can't be translated as it breaks bsgs client when certian characters are used + * @returns string + */ + getInGameVersionLabel(): string; /** Set window title */ setTitle(): void; /** Reset console cursor to top */ diff --git a/Faupi-MunitionsExpert/server/types/utils/collections/queue/Queue.d.ts b/Faupi-MunitionsExpert/server/types/utils/collections/queue/Queue.d.ts new file mode 100644 index 0000000..645d462 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/utils/collections/queue/Queue.d.ts @@ -0,0 +1,12 @@ +export declare class Queue { + private elements; + private head; + private tail; + constructor(); + enqueue(element: T): void; + enqueueAll(elements: T[]): void; + dequeue(): T; + peek(): T; + getLength(): number; + isEmpty(): boolean; +} diff --git a/Faupi-MunitionsExpert/server/types/utils/decorators/Singleton.d.ts b/Faupi-MunitionsExpert/server/types/utils/decorators/Singleton.d.ts deleted file mode 100644 index 7e89026..0000000 --- a/Faupi-MunitionsExpert/server/types/utils/decorators/Singleton.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type constructor from "./constructor"; -import { InjectionToken } from "tsyringe"; -declare function singleton(token?: InjectionToken): (target: constructor) => void; -export default singleton; diff --git a/Faupi-MunitionsExpert/server/types/utils/decorators/constructor.d.ts b/Faupi-MunitionsExpert/server/types/utils/decorators/constructor.d.ts deleted file mode 100644 index 416f354..0000000 --- a/Faupi-MunitionsExpert/server/types/utils/decorators/constructor.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare type constructor = { - new (...args: any[]): T; -}; -export default constructor; diff --git a/Faupi-HideoutArchitect/server/types/utils/Logger.d.ts b/Faupi-MunitionsExpert/server/types/utils/logging/AbstractWinstonLogger.d.ts similarity index 70% rename from Faupi-HideoutArchitect/server/types/utils/Logger.d.ts rename to Faupi-MunitionsExpert/server/types/utils/logging/AbstractWinstonLogger.d.ts index 1088701..1ae1100 100644 --- a/Faupi-HideoutArchitect/server/types/utils/Logger.d.ts +++ b/Faupi-MunitionsExpert/server/types/utils/logging/AbstractWinstonLogger.d.ts @@ -1,19 +1,17 @@ /// import fs from "fs"; import winston from "winston"; -import { Daum } from "../models/eft/itemEvent/IItemEventRouterRequest"; -import { LogBackgroundColor } from "../models/spt/logging/LogBackgroundColor"; -import { LogTextColor } from "../models/spt/logging/LogTextColor"; -import { SptLogger } from "../models/spt/logging/SptLogger"; -import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue"; -import { ILogger } from "../models/spt/utils/ILogger"; -import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator"; -export declare class WinstonLogger implements ILogger { +import { Daum } from "../../models/eft/itemEvent/IItemEventRouterRequest"; +import { LogBackgroundColor } from "../../models/spt/logging/LogBackgroundColor"; +import { LogTextColor } from "../../models/spt/logging/LogTextColor"; +import { SptLogger } from "../../models/spt/logging/SptLogger"; +import { IAsyncQueue } from "../../models/spt/utils/IAsyncQueue"; +import { ILogger } from "../../models/spt/utils/ILogger"; +import { IUUidGenerator } from "../../models/spt/utils/IUuidGenerator"; +export declare abstract class AbstractWinstonLogger implements ILogger { protected asyncQueue: IAsyncQueue; protected uuidGenerator: IUUidGenerator; protected showDebugInConsole: boolean; - protected folderPath: string; - protected file: string; protected filePath: string; protected logLevels: { levels: { @@ -47,6 +45,13 @@ export declare class WinstonLogger implements ILogger { protected logger: winston.Logger & SptLogger; protected writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator); + protected abstract isLogToFile(): boolean; + protected abstract isLogToConsole(): boolean; + protected abstract isLogExceptions(): boolean; + protected abstract getFilePath(): string; + protected abstract getFileName(): string; + protected getLogMaxSize(): string; + protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; log(data: string | Error | Record, color: string, backgroundColor?: string): Promise; error(data: string | Record): Promise; diff --git a/Faupi-MunitionsExpert/server/types/utils/logging/WinstonMainLogger.d.ts b/Faupi-MunitionsExpert/server/types/utils/logging/WinstonMainLogger.d.ts new file mode 100644 index 0000000..3c67902 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/utils/logging/WinstonMainLogger.d.ts @@ -0,0 +1,13 @@ +import { IAsyncQueue } from "../../models/spt/utils/IAsyncQueue"; +import { IUUidGenerator } from "../../models/spt/utils/IUuidGenerator"; +import { AbstractWinstonLogger } from "./AbstractWinstonLogger"; +export declare class WinstonMainLogger extends AbstractWinstonLogger { + protected asyncQueue: IAsyncQueue; + protected uuidGenerator: IUUidGenerator; + constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator); + protected isLogExceptions(): boolean; + protected isLogToFile(): boolean; + protected isLogToConsole(): boolean; + protected getFilePath(): string; + protected getFileName(): string; +} diff --git a/Faupi-MunitionsExpert/server/types/utils/logging/WinstonRequestLogger.d.ts b/Faupi-MunitionsExpert/server/types/utils/logging/WinstonRequestLogger.d.ts new file mode 100644 index 0000000..1475e43 --- /dev/null +++ b/Faupi-MunitionsExpert/server/types/utils/logging/WinstonRequestLogger.d.ts @@ -0,0 +1,14 @@ +import { IAsyncQueue } from "../../models/spt/utils/IAsyncQueue"; +import { IUUidGenerator } from "../../models/spt/utils/IUuidGenerator"; +import { AbstractWinstonLogger } from "./AbstractWinstonLogger"; +export declare class WinstonRequestLogger extends AbstractWinstonLogger { + protected asyncQueue: IAsyncQueue; + protected uuidGenerator: IUUidGenerator; + constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator); + protected isLogExceptions(): boolean; + protected isLogToFile(): boolean; + protected isLogToConsole(): boolean; + protected getFilePath(): string; + protected getFileName(): string; + protected getLogMaxSize(): string; +} diff --git a/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.1/bepInEx/plugins/KcY-SeeItemValue.dll b/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.2/bepInEx/plugins/KcY-SeeItemValue.dll similarity index 91% rename from KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.1/bepInEx/plugins/KcY-SeeItemValue.dll rename to KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.2/bepInEx/plugins/KcY-SeeItemValue.dll index 05de7af..293a2ed 100644 Binary files a/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.1/bepInEx/plugins/KcY-SeeItemValue.dll and b/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.2/bepInEx/plugins/KcY-SeeItemValue.dll differ diff --git a/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.1/user/mods/KcY-SeeItemValue 1.5.1/LICENSE.txt b/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.2/user/mods/KcY-SeeItemValue 1.5.2/LICENSE.txt similarity index 100% rename from KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.1/user/mods/KcY-SeeItemValue 1.5.1/LICENSE.txt rename to KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.2/user/mods/KcY-SeeItemValue 1.5.2/LICENSE.txt diff --git a/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.1/user/mods/KcY-SeeItemValue 1.5.1/package.json b/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.2/user/mods/KcY-SeeItemValue 1.5.2/package.json similarity index 91% rename from KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.1/user/mods/KcY-SeeItemValue 1.5.1/package.json rename to KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.2/user/mods/KcY-SeeItemValue 1.5.2/package.json index fa8f425..2313345 100644 --- a/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.1/user/mods/KcY-SeeItemValue 1.5.1/package.json +++ b/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.2/user/mods/KcY-SeeItemValue 1.5.2/package.json @@ -1,10 +1,10 @@ { "name": "SeeItemValue", "author": "KcY", - "version": "1.5.1", + "version": "1.5.2", "license": "NCSA Open Source", "main": "src/mod.js", - "akiVersion": "3.4.0", + "akiVersion": "3.5.0", "UpdatedBy": "CWX", "scripts": { "setup": "npm i", diff --git a/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.1/user/mods/KcY-SeeItemValue 1.5.1/src/config.json b/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.2/user/mods/KcY-SeeItemValue 1.5.2/src/config.json similarity index 100% rename from KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.1/user/mods/KcY-SeeItemValue 1.5.1/src/config.json rename to KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.2/user/mods/KcY-SeeItemValue 1.5.2/src/config.json diff --git a/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.1/user/mods/KcY-SeeItemValue 1.5.1/src/mod.ts b/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.2/user/mods/KcY-SeeItemValue 1.5.2/src/mod.ts similarity index 100% rename from KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.1/user/mods/KcY-SeeItemValue 1.5.1/src/mod.ts rename to KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.5.2/user/mods/KcY-SeeItemValue 1.5.2/src/mod.ts diff --git a/KcY-SeeItemValue/itemValue/Program.cs b/KcY-SeeItemValue/itemValue/Program.cs index 8c41d8d..0cc32e8 100644 --- a/KcY-SeeItemValue/itemValue/Program.cs +++ b/KcY-SeeItemValue/itemValue/Program.cs @@ -2,7 +2,7 @@ namespace itemValueMod { - [BepInPlugin("com.KcY.SeeItemValue", "KcY-SeeItemValue", "1.5.1")] + [BepInPlugin("com.KcY.SeeItemValue", "KcY-SeeItemValue", "1.5.2")] public class Plugin : BaseUnityPlugin { private void Awake() diff --git a/KcY-SeeItemValue/itemValue/itemValueMod.cs b/KcY-SeeItemValue/itemValue/itemValueMod.cs index 5a83d89..0746318 100644 --- a/KcY-SeeItemValue/itemValue/itemValueMod.cs +++ b/KcY-SeeItemValue/itemValue/itemValueMod.cs @@ -196,12 +196,12 @@ namespace itemValueMod var foodDrink = item.GetItemComponent(); if (foodDrink != null && foodDrink.HpPercent != 0) { - GInterface211 ginterface211_0 = (GInterface211)foodDrink.GetType().GetField("ginterface211_0", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(foodDrink); + GInterface233 ginterface233_0 = (GInterface233)foodDrink.GetType().GetField("ginterface233_0", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(foodDrink); DebugMode($" foodDrink Check - HpPercent is: {foodDrink.HpPercent}"); - DebugMode($" foodDrink Check - MaxResource is: {ginterface211_0.MaxResource}"); + DebugMode($" foodDrink Check - MaxResource is: {ginterface233_0.MaxResource}"); - editedPrice *= foodDrink.HpPercent / ginterface211_0.MaxResource; + editedPrice *= foodDrink.HpPercent / ginterface233_0.MaxResource; } DebugMode($" After foodDrink Check - price is: {editedPrice}"); @@ -209,12 +209,12 @@ namespace itemValueMod var keys = item.GetItemComponent(); if (keys != null) { - GInterface215 gInterface215_0 = (GInterface215)keys.GetType().GetField("Template", BindingFlags.Public | BindingFlags.Instance).GetValue(keys); + GInterface237 template = (GInterface237)keys.GetType().GetField("Template", BindingFlags.Public | BindingFlags.Instance).GetValue(keys); if (keys.NumberOfUsages > 0) { - double totalMinusUsed = Convert.ToDouble(gInterface215_0.MaximumNumberOfUsage - keys.NumberOfUsages); - double multi = totalMinusUsed / gInterface215_0.MaximumNumberOfUsage; + double totalMinusUsed = Convert.ToDouble(template.MaximumNumberOfUsage - keys.NumberOfUsages); + double multi = totalMinusUsed / template.MaximumNumberOfUsage; DebugMode($" foodDrink Check - totalMinusUsed is: {totalMinusUsed}"); DebugMode($" foodDrink Check - multi is: {multi}"); diff --git a/KcY-SeeItemValue/itemValue/itemValueMod.csproj b/KcY-SeeItemValue/itemValue/itemValueMod.csproj index b6104f8..c874547 100644 --- a/KcY-SeeItemValue/itemValue/itemValueMod.csproj +++ b/KcY-SeeItemValue/itemValue/itemValueMod.csproj @@ -2,7 +2,7 @@ net472 - 1.5.1 + 1.5.2 KcY-SeeItemValue diff --git a/KcY-SeeItemValue/itemValue/server/dist/package.json b/KcY-SeeItemValue/itemValue/server/dist/package.json index fa8f425..2313345 100644 --- a/KcY-SeeItemValue/itemValue/server/dist/package.json +++ b/KcY-SeeItemValue/itemValue/server/dist/package.json @@ -1,10 +1,10 @@ { "name": "SeeItemValue", "author": "KcY", - "version": "1.5.1", + "version": "1.5.2", "license": "NCSA Open Source", "main": "src/mod.js", - "akiVersion": "3.4.0", + "akiVersion": "3.5.0", "UpdatedBy": "CWX", "scripts": { "setup": "npm i", diff --git a/KcY-SeeItemValue/itemValue/server/package.json b/KcY-SeeItemValue/itemValue/server/package.json index fa8f425..2313345 100644 --- a/KcY-SeeItemValue/itemValue/server/package.json +++ b/KcY-SeeItemValue/itemValue/server/package.json @@ -1,10 +1,10 @@ { "name": "SeeItemValue", "author": "KcY", - "version": "1.5.1", + "version": "1.5.2", "license": "NCSA Open Source", "main": "src/mod.js", - "akiVersion": "3.4.0", + "akiVersion": "3.5.0", "UpdatedBy": "CWX", "scripts": { "setup": "npm i", diff --git a/KcY-SeeItemValue/itemValue/server/types/callbacks/DataCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/callbacks/DataCallbacks.d.ts index 2efcf81..26f5899 100644 --- a/KcY-SeeItemValue/itemValue/server/types/callbacks/DataCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/callbacks/DataCallbacks.d.ts @@ -1,14 +1,16 @@ +import { HideoutController } from "../controllers/HideoutController"; +import { RagfairController } from "../controllers/RagfairController"; 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 { IGetItemPricesResponse } from "../models/eft/game/IGetItemPricesResponse"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "../models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; -import { ILanguageBase } from "../models/spt/server/ILocaleBase"; import { ISettingsBase } from "../models/spt/server/ISettingsBase"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; @@ -18,7 +20,9 @@ import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer); + protected ragfairController: RagfairController; + protected hideoutController: HideoutController; + constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handles client/settings * @returns ISettingsBase @@ -54,7 +58,17 @@ export declare class DataCallbacks { getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle client/hideout/qte/list + */ + getQteList(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle client/items/prices/ + * Called when viewing a traders assorts + * TODO - fully implement this + */ + getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/KcY-SeeItemValue/itemValue/server/types/callbacks/DialogueCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/callbacks/DialogueCallbacks.d.ts index 7b2eeae..63d7163 100644 --- a/KcY-SeeItemValue/itemValue/server/types/callbacks/DialogueCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "../controllers/DialogueController"; import { OnUpdate } from "../di/OnUpdate"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; +import { IChatServer } from "../models/eft/dialog/IChatServer"; import { IFriendRequestData } from "../models/eft/dialog/IFriendRequestData"; import { IGetAllAttachmentsRequestData } from "../models/eft/dialog/IGetAllAttachmentsRequestData"; import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse"; @@ -20,7 +21,7 @@ import { DialogueInfo } from "../models/eft/profile/IAkiProfile"; import { HashUtil } from "../utils/HashUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { TimeUtil } from "../utils/TimeUtil"; -export declare class DialogueCallbacks extends OnUpdate { +export declare class DialogueCallbacks implements OnUpdate { protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected httpResponse: HttpResponseUtil; @@ -35,7 +36,7 @@ export declare class DialogueCallbacks extends OnUpdate { * Handles client/chatServer/list * @returns */ - getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData; + getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData; getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData; getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData; getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData; @@ -52,6 +53,6 @@ export declare class DialogueCallbacks extends OnUpdate { listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; friendRequest(url: string, request: IFriendRequestData, sessionID: string): INullResponseData; sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData; - onUpdate(timeSinceLastRun: number): boolean; + onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/callbacks/HandbookCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/callbacks/HandbookCallbacks.d.ts index 891e375..6bd3909 100644 --- a/KcY-SeeItemValue/itemValue/server/types/callbacks/HandbookCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/callbacks/HandbookCallbacks.d.ts @@ -1,8 +1,8 @@ import { HandbookController } from "../controllers/HandbookController"; import { OnLoad } from "../di/OnLoad"; -export declare class HandbookCallbacks extends OnLoad { +export declare class HandbookCallbacks implements OnLoad { protected handbookController: HandbookController; constructor(handbookController: HandbookController); - onLoad(): void; + onLoad(): Promise; getRoute(): string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/callbacks/HealthCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/callbacks/HealthCallbacks.d.ts index 7edf03e..bd3e507 100644 --- a/KcY-SeeItemValue/itemValue/server/types/callbacks/HealthCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/callbacks/HealthCallbacks.d.ts @@ -7,6 +7,7 @@ import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealReques import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { IWorkoutData } from "../models/eft/health/IWorkoutData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class HealthCallbacks { protected httpResponse: HttpResponseUtil; @@ -21,6 +22,14 @@ export declare class HealthCallbacks { * @returns empty response, no data sent back to client */ syncHealth(url: string, info: ISyncHealthRequestData, sessionID: string): IGetBodyResponseData; + /** + * Custom aki server request found in modules/QTEPatch.cs + * @param url + * @param info HealthListener.Instance.CurrentHealth class + * @param sessionID session id + * @returns empty response, no data sent back to client + */ + handleWorkoutEffects(url: string, info: IWorkoutData, sessionID: string): IGetBodyResponseData; /** * Handle Eat * @returns IItemEventRouterResponse diff --git a/KcY-SeeItemValue/itemValue/server/types/callbacks/HideoutCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/callbacks/HideoutCallbacks.d.ts index e39e806..d0247f9 100644 --- a/KcY-SeeItemValue/itemValue/server/types/callbacks/HideoutCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/callbacks/HideoutCallbacks.d.ts @@ -1,7 +1,9 @@ import { HideoutController } from "../controllers/HideoutController"; import { OnUpdate } from "../di/OnUpdate"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; +import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; +import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData"; import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData"; import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData"; @@ -10,10 +12,11 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData"; import { IHideoutUpgradeCompleteRequestData } from "../models/eft/hideout/IHideoutUpgradeCompleteRequestData"; import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData"; +import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ConfigServer } from "../servers/ConfigServer"; -export declare class HideoutCallbacks extends OnUpdate { +export declare class HideoutCallbacks implements OnUpdate { protected hideoutController: HideoutController; protected configServer: ConfigServer; protected hideoutConfig: IHideoutConfig; @@ -21,76 +24,52 @@ export declare class HideoutCallbacks extends OnUpdate { configServer: ConfigServer); /** * Handle HideoutUpgrade - * @param pmcData - * @param body - * @param sessionID - * @returns */ upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutUpgradeComplete - * @param pmcData - * @param body - * @param sessionID - * @returns */ upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutPutItemsInAreaSlots - * @param pmcData - * @param body - * @param sessionID - * @returns */ putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutTakeItemsFromAreaSlots - * @param pmcData - * @param body - * @param sessionID - * @returns */ takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutToggleArea - * @param pmcData - * @param body - * @param sessionID - * @returns */ toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutSingleProductionStart - * @param pmcData - * @param body - * @param sessionID - * @returns */ singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutScavCaseProductionStart - * @param pmcData - * @param body - * @param sessionID - * @returns */ scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutContinuousProductionStart - * @param pmcData - * @param body - * @param sessionID - * @returns */ - continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutTakeProduction - * @param pmcData - * @param body - * @param sessionID - * @returns */ takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; - onUpdate(timeSinceLastRun: number): boolean; + /** + * Handle HideoutQuickTimeEvent + */ + handleQTEEvent(pmcData: IPmcData, request: IHandleQTEEventRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - RecordShootingRangePoints + */ + recordShootingRangePoints(pmcData: IPmcData, request: IRecordShootingRangePoints, sessionId: string): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - RecordShootingRangePoints + */ + improveArea(pmcData: IPmcData, request: IHideoutImproveAreaRequestData, sessionId: string): IItemEventRouterResponse; + onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/callbacks/HttpCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/callbacks/HttpCallbacks.d.ts index 43928a1..10794fa 100644 --- a/KcY-SeeItemValue/itemValue/server/types/callbacks/HttpCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/callbacks/HttpCallbacks.d.ts @@ -1,9 +1,9 @@ import { OnLoad } from "../di/OnLoad"; import { HttpServer } from "../servers/HttpServer"; -export declare class HttpCallbacks extends OnLoad { +export declare class HttpCallbacks implements OnLoad { protected httpServer: HttpServer; constructor(httpServer: HttpServer); - onLoad(): void; + onLoad(): Promise; getRoute(): string; getImage(): string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/callbacks/InsuranceCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/callbacks/InsuranceCallbacks.d.ts index a171e1c..aea0756 100644 --- a/KcY-SeeItemValue/itemValue/server/types/callbacks/InsuranceCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/callbacks/InsuranceCallbacks.d.ts @@ -10,7 +10,7 @@ import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { InsuranceService } from "../services/InsuranceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; -export declare class InsuranceCallbacks extends OnUpdate { +export declare class InsuranceCallbacks implements OnUpdate { protected insuranceController: InsuranceController; protected insuranceService: InsuranceService; protected httpResponse: HttpResponseUtil; @@ -27,6 +27,6 @@ export declare class InsuranceCallbacks extends OnUpdate { * @returns IItemEventRouterResponse */ insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; - onUpdate(secondsSinceLastRun: number): boolean; + onUpdate(secondsSinceLastRun: number): Promise; getRoute(): string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/callbacks/MatchCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/callbacks/MatchCallbacks.d.ts index 10fbc44..52e3290 100644 --- a/KcY-SeeItemValue/itemValue/server/types/callbacks/MatchCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/callbacks/MatchCallbacks.d.ts @@ -7,10 +7,10 @@ import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequest import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; +import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; -import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; @@ -41,6 +41,6 @@ export declare class MatchCallbacks { getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; - startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; + getRaidConfiguration(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData; } diff --git a/KcY-SeeItemValue/itemValue/server/types/callbacks/ModCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/callbacks/ModCallbacks.d.ts index aec2f59..d1ec7f7 100644 --- a/KcY-SeeItemValue/itemValue/server/types/callbacks/ModCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/callbacks/ModCallbacks.d.ts @@ -3,20 +3,19 @@ import { PostAkiModLoader } from "../loaders/PostAkiModLoader"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { LocalisationService } from "../services/LocalisationService"; import { HttpFileUtil } from "../utils/HttpFileUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; -declare class ModCallbacks extends OnLoad { +declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; protected postAkiModLoader: PostAkiModLoader; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; - constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, configServer: ConfigServer); - onLoad(): void; + constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, localisationService: LocalisationService, configServer: ConfigServer); + onLoad(): Promise; getRoute(): string; - sendBundle(sessionID: string, req: any, resp: any, body: any): void; - getBundles(url: string, info: any, sessionID: string): string; - getBundle(url: string, info: any, sessionID: string): string; } export { ModCallbacks }; diff --git a/KcY-SeeItemValue/itemValue/server/types/callbacks/PresetCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/callbacks/PresetCallbacks.d.ts index 4553f8f..37bf4e8 100644 --- a/KcY-SeeItemValue/itemValue/server/types/callbacks/PresetCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/callbacks/PresetCallbacks.d.ts @@ -1,8 +1,8 @@ import { PresetController } from "../controllers/PresetController"; import { OnLoad } from "../di/OnLoad"; -export declare class PresetCallbacks extends OnLoad { +export declare class PresetCallbacks implements OnLoad { protected presetController: PresetController; constructor(presetController: PresetController); - onLoad(): void; + onLoad(): Promise; getRoute(): string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/callbacks/RagfairCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/callbacks/RagfairCallbacks.d.ts index 37f3807..97713e7 100644 --- a/KcY-SeeItemValue/itemValue/server/types/callbacks/RagfairCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/callbacks/RagfairCallbacks.d.ts @@ -1,5 +1,6 @@ +import { OnLoad } from "../di/OnLoad"; +import { OnUpdate } from "../di/OnUpdate"; import { RagfairController } from "../controllers/RagfairController"; -import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; @@ -14,7 +15,6 @@ import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferReque import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; @@ -22,23 +22,26 @@ import { JsonUtil } from "../utils/JsonUtil"; /** * Handle ragfair related callback events */ -export declare class RagfairCallbacks extends OnLoadOnUpdate { +export declare class RagfairCallbacks implements OnLoad, OnUpdate { protected httpResponse: HttpResponseUtil; - protected logger: ILogger; protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected ragfairController: RagfairController; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(httpResponse: HttpResponseUtil, logger: ILogger, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer); - onLoad(): void; + constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer); + onLoad(): Promise; getRoute(): string; search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData; getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData; - getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse; removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; - onUpdate(timeSinceLastRun: number): boolean; + /** + * Handle /client/items/prices + * Called when clicking an item to list on flea + */ + getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; + onUpdate(timeSinceLastRun: number): Promise; sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/KcY-SeeItemValue/itemValue/server/types/callbacks/SaveCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/callbacks/SaveCallbacks.d.ts index bbb6e53..93ffd96 100644 --- a/KcY-SeeItemValue/itemValue/server/types/callbacks/SaveCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/callbacks/SaveCallbacks.d.ts @@ -1,9 +1,10 @@ -import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate"; +import { OnLoad } from "../di/OnLoad"; +import { OnUpdate } from "../di/OnUpdate"; import { SaveServer } from "../servers/SaveServer"; -export declare class SaveCallbacks extends OnLoadOnUpdate { +export declare class SaveCallbacks implements OnLoad, OnUpdate { protected saveServer: SaveServer; constructor(saveServer: SaveServer); - onLoad(): void; + onLoad(): Promise; getRoute(): string; - onUpdate(secondsSinceLastRun: number): boolean; + onUpdate(secondsSinceLastRun: number): Promise; } diff --git a/KcY-SeeItemValue/itemValue/server/types/callbacks/TradeCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/callbacks/TradeCallbacks.d.ts index 272ae46..4291da8 100644 --- a/KcY-SeeItemValue/itemValue/server/types/callbacks/TradeCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/callbacks/TradeCallbacks.d.ts @@ -6,6 +6,9 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); + /** + * Handle client/game/profile/items/moving TradingConfirm + */ processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/KcY-SeeItemValue/itemValue/server/types/callbacks/TraderCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/callbacks/TraderCallbacks.d.ts index 40a1455..8df1049 100644 --- a/KcY-SeeItemValue/itemValue/server/types/callbacks/TraderCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/callbacks/TraderCallbacks.d.ts @@ -1,15 +1,16 @@ +import { OnLoad } from "../di/OnLoad"; +import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; -import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; -export declare class TraderCallbacks extends OnLoadOnUpdate { +export declare class TraderCallbacks implements OnLoad, OnUpdate { protected httpResponse: HttpResponseUtil; protected traderController: TraderController; constructor(httpResponse: HttpResponseUtil, traderController: TraderController); - onLoad(): void; - onUpdate(): boolean; + onLoad(): Promise; + onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; /** diff --git a/KcY-SeeItemValue/itemValue/server/types/context/ApplicationContext.d.ts b/KcY-SeeItemValue/itemValue/server/types/context/ApplicationContext.d.ts index a155bcd..28bbdf7 100644 --- a/KcY-SeeItemValue/itemValue/server/types/context/ApplicationContext.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/context/ApplicationContext.d.ts @@ -3,6 +3,15 @@ import { ContextVariableType } from "./ContextVariableType"; export declare class ApplicationContext { private variables; private static holderMaxSize; + /** + * Called like: + * + * const registerPlayerInfo = this.applicationContext.getLatestValue(ContextVariableType.REGISTER_PLAYER_REQUEST).getValue(); + * + * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.MATCH_INFO).getValue(); + * @param type + * @returns + */ getLatestValue(type: ContextVariableType): ContextVariable; getValues(type: ContextVariableType): ContextVariable[]; addValue(type: ContextVariableType, value: any): void; diff --git a/KcY-SeeItemValue/itemValue/server/types/context/ContextVariableType.d.ts b/KcY-SeeItemValue/itemValue/server/types/context/ContextVariableType.d.ts index a7dd9b5..49f3267 100644 --- a/KcY-SeeItemValue/itemValue/server/types/context/ContextVariableType.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/context/ContextVariableType.d.ts @@ -2,7 +2,9 @@ export declare enum ContextVariableType { /** Logged in users session id */ SESSION_ID = 0, /** Currently acive raid information */ - MATCH_INFO = 1, + RAID_CONFIGURATION = 1, /** Timestamp when client first connected */ - CLIENT_START_TIMESTAMP = 2 + CLIENT_START_TIMESTAMP = 2, + /** When player is loading into map and loot is requested */ + REGISTER_PLAYER_REQUEST = 3 } diff --git a/KcY-SeeItemValue/itemValue/server/types/controllers/BotController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/BotController.d.ts index 51c0c68..1d7eb9d 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/BotController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/BotController.d.ts @@ -3,7 +3,6 @@ import { BotGenerator } from "../generators/BotGenerator"; import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper"; import { BotHelper } from "../helpers/BotHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; -import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData"; import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; @@ -23,14 +22,13 @@ export declare class BotController { protected botDifficultyHelper: BotDifficultyHelper; protected botGenerationCacheService: BotGenerationCacheService; protected localisationService: LocalisationService; - protected weightedRandomHelper: WeightedRandomHelper; protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; static readonly pmcTypeLabel = "PMC"; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** * Return the number of bot loadout varieties to be generated * @param type bot Type we want the loadout gen count for @@ -57,6 +55,12 @@ export declare class BotController { * @returns IBotBase array */ generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[]; + /** + * Get the difficulty passed in, if its not "asoline", get selected difficulty from config + * @param requestedDifficulty + * @returns + */ + getPMCDifficulty(requestedDifficulty: string): string; /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value diff --git a/KcY-SeeItemValue/itemValue/server/types/controllers/CustomizationController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/CustomizationController.d.ts index 5fe51e3..a4ef8cf 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/CustomizationController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/CustomizationController.d.ts @@ -8,13 +8,15 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; +import { LocalisationService } from "../services/LocalisationService"; export declare class CustomizationController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; + protected localisationService: LocalisationService; protected profileHelper: ProfileHelper; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, 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/KcY-SeeItemValue/itemValue/server/types/controllers/DialogueController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/DialogueController.d.ts index 9c8b728..98d3d52 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/DialogueController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/DialogueController.d.ts @@ -27,6 +27,7 @@ export declare class DialogueController { */ getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo; /** + * Handle player clicking 'messenger' and seeing all the messages they've recieved * Set the content of the dialogue on the details panel, showing all the messages * for the specified dialogue. * @param dialogueID Dialog id diff --git a/KcY-SeeItemValue/itemValue/server/types/controllers/GameController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/GameController.d.ts index f4f5849..44264dc 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/GameController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/GameController.d.ts @@ -1,59 +1,74 @@ import { ApplicationContext } from "../context/ApplicationContext"; -import { GameEventHelper } from "../helpers/GameEventHelper"; +import { HideoutHelper } from "../helpers/HideoutHelper"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { Config } from "../models/eft/common/IGlobals"; +import { IPmcData } from "../models/eft/common/IPmcData"; 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"; -import { ISeasonalEvent } from "../models/spt/config/ISeasonalEventConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -import { LocaleService } from "../services/LocaleService"; +import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { LocalisationService } from "../services/LocalisationService"; +import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; -import { Watermark } from "../utils/Watermark"; +import { SeasonalEventService } from "../services/SeasonalEventService"; +import { TimeUtil } from "../utils/TimeUtil"; export declare class GameController { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected watermark: Watermark; + protected timeUtil: TimeUtil; + protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; - protected localeService: LocaleService; + protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; - protected gameEventHelper: GameEventHelper; + protected customLocationWaveService: CustomLocationWaveService; + protected openZoneService: OpenZoneService; + protected seasonalEventService: SeasonalEventService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, watermark: Watermark, httpServerHelper: HttpServerHelper, localeService: LocaleService, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, gameEventHelper: GameEventHelper, applicationContext: ApplicationContext, configServer: ConfigServer); + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; /** - * Check if current date falls inside any of the seasons events pased in, if so, handle them - * @param seasonalEvents events to check for + * When player logs in, iterate over all active effects and reduce timer + * TODO - add body part HP regen + * @param pmcProfile */ - protected checkForAndEnableSeasonalEvents(seasonalEvents: ISeasonalEvent[]): void; + protected updateProfileHealthValues(pmcProfile: IPmcData): void; /** - * Make adjusted to server code based on the name of the event passed in - * @param globalConfig globals.json - * @param eventName Name of the event to enable. e.g. Christmas + * Waves with an identical min/max values spawn nothing, the number of bots that spawn is the difference between min and max */ - protected updateGlobalEvents(globalConfig: Config, eventName: string): void; + protected fixBrokenOfflineMapWaves(): void; /** - * Read in data from seasonalEvents.json and add found equipment items to bots - * @param eventName Name of the event to read equipment in from config + * Make Rogues spawn later to allow for scavs to spawn first instead of rogues filling up all spawn positions */ - protected addEventGearToScavs(eventName: string): void; + protected fixRoguesSpawningInstantlyOnLighthouse(): void; /** - * Set Khorovod(dancing tree) chance to 100% on all maps that support it + * Get a list of installed mods and save their details to the profile being used + * @param fullProfile Profile to add mod details to */ - protected enableDancingTree(): void; + protected saveActiveModsToProfile(fullProfile: IAkiProfile): void; + /** + * Add the logged in players name to PMC name pool + * @param pmcProfile + */ + protected addPlayerToPMCNames(pmcProfile: IPmcData): void; + /** + * Blank out the "test" mail message from prapor + */ + protected removePraporTestMessage(): void; /** * Make non-trigger-spawned raiders spawn earlier + always */ @@ -61,6 +76,5 @@ export declare class GameController { protected logProfileDetails(fullProfile: IAkiProfile): void; getGameConfig(sessionID: string): IGameConfigResponse; getServer(): IServerDetails[]; - protected addPumpkinsToScavBackpacks(): void; getValidGameVersion(): ICheckVersionResponse; } diff --git a/KcY-SeeItemValue/itemValue/server/types/controllers/HealthController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/HealthController.d.ts index ce67993..7c149cc 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/HealthController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/HealthController.d.ts @@ -1,23 +1,28 @@ -import { ItemHelper } from "../helpers/ItemHelper"; -import { PaymentService } from "../services/PaymentService"; -import { InventoryHelper } from "../helpers/InventoryHelper"; import { HealthHelper } from "../helpers/HealthHelper"; +import { InventoryHelper } from "../helpers/InventoryHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData"; import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData"; import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; +import { IWorkoutData } from "../models/eft/health/IWorkoutData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; -import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { LocalisationService } from "../services/LocalisationService"; +import { PaymentService } from "../services/PaymentService"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class HealthController { protected logger: ILogger; + protected jsonUtil: JsonUtil; protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; + protected localisationService: LocalisationService; protected healthHelper: HealthHelper; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); + constructor(logger: ILogger, jsonUtil: JsonUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile @@ -25,7 +30,7 @@ export declare class HealthController { * @param sessionID * @param addEffects Should effects found be added or removed from profile */ - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** * When healing in menu * @param pmcData @@ -34,13 +39,35 @@ export declare class HealthController { * @returns */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Consume food/water outside of a raid + * @param pmcData Player profile + * @param body request Object + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; /** * Occurs on post-raid healing page * @param pmcData player profile - * @param info Request data from client + * @param healthTreatmentRequest Request data from client * @param sessionID Session id * @returns */ - healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; + healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; + /** + * applies skills from hideout workout. + * @param pmcData Player profile + * @param info Request data + * @param sessionID + */ + applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void; + /** + * Iterate over treatment request diff and find effects to remove from player limbs + * @param sessionId + * @param profile Profile to update + * @param treatmentRequest client request + * @param output response to send to client + */ + protected removeEffectsAfterPostRaidHeal(sessionId: string, profile: IPmcData, treatmentRequest: IHealthTreatmentRequestData, output: IItemEventRouterResponse): void; } diff --git a/KcY-SeeItemValue/itemValue/server/types/controllers/HideoutController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/HideoutController.d.ts index 5b6507b..e6e0243 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/HideoutController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/HideoutController.d.ts @@ -7,7 +7,9 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; -import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; +import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; +import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData"; import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData"; @@ -16,6 +18,8 @@ import { IHideoutTakeItemOutRequestData } from "../models/eft/hideout/IHideoutTa import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData"; import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData"; import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData"; +import { IQteData } from "../models/eft/hideout/IQteData"; +import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -23,6 +27,7 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; +import { FenceService } from "../services/FenceService"; import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { HashUtil } from "../utils/HashUtil"; @@ -49,12 +54,28 @@ export declare class HideoutController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; + protected fenceService: FenceService; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil); - upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; - upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** + * Start a hideout area upgrade + * @param pmcData Player profile + * @param request upgrade start request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + startUpgrade(pmcData: IPmcData, request: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Complete a hideout area upgrade + * @param pmcData Player profile + * @param request Completed upgrade request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory * @param pmcData Profile data * @param addItemToHideoutRequest reqeust from client to place item in area slot @@ -62,7 +83,14 @@ export declare class HideoutController { * @returns IItemEventRouterResponse object */ putItemsInAreaSlots(pmcData: IPmcData, addItemToHideoutRequest: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse; - takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Remove item from hideout area and place into player inventory + * @param pmcData Player profile + * @param request Take item out of area request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + takeItemsFromAreaSlots(pmcData: IPmcData, request: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse; /** * Find resource item in hideout area, add copy to player inventory, remove Item from hideout slot * @param sessionID Session id @@ -73,7 +101,21 @@ export declare class HideoutController { * @returns IItemEventRouterResponse response */ protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: HideoutArea): IItemEventRouterResponse; - toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Toggle area on/off + * @param pmcData Player profile + * @param request Toggle area request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + toggleArea(pmcData: IPmcData, request: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Start production for an item from hideout area + * @param pmcData Player profile + * @param body Start prodution of single item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles event after clicking 'start' on the scav case hideout page @@ -83,24 +125,96 @@ export declare class HideoutController { * @returns item event router response */ scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Adjust scav case time based on fence standing + * + * @param pmcData Player profile + * @param productionTime Time to complete scav case in seconds + * @returns Adjusted scav case time in seconds + */ + protected getScavCaseTime(pmcData: IPmcData, productionTime: number): number; /** * Add generated scav case rewards to player profile * @param pmcData player profile to add rewards to * @param rewards reward items to add to profile + * @param recipieId recipie id to save into Production dict */ - protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[]): void; - continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; - takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; - protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; + protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[], recipieId: string): void; + /** + * Start production of continuously created item + * @param pmcData Player profile + * @param request Continious production request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + continuousProductionStart(pmcData: IPmcData, request: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Take completed item out of hideout area and place into player inventory + * @param pmcData Player profile + * @param request Remove production from area request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + takeProduction(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Take recipie-type production out of hideout area and place into player inventory + * @param sessionID Session id + * @param recipe Completed recipie of item + * @param pmcData Player profile + * @param request Remove production from area request + * @param output Output object to update + * @returns IItemEventRouterResponse + */ + protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Handles giving rewards stored in player profile to player after clicking 'get rewards' - * @param sessionID - * @param pmcData - * @param body - * @param output - * @returns + * @param sessionID Session id + * @param pmcData Player profile + * @param request Get rewards from scavcase craft request + * @param output Output object to update + * @returns IItemEventRouterResponse + */ + protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; + /** + * Start area production for item + * @param pmcData Player profile + * @param request Start production request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + registerProduction(pmcData: IPmcData, request: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Get quick time event list for hideout + * // TODO - implement this + * @param sessionId Session id + * @returns IQteData array + */ + getQteList(sessionId: string): IQteData[]; + /** + * Handle HideoutQuickTimeEvent on client/game/profile/items/moving + * Called after completing workout at gym + * @param sessionId Session id + * @param pmcData Profile to adjust + * @param request QTE result object + */ + handleQTEEventOutcome(sessionId: string, pmcData: IPmcData, request: IHandleQTEEventRequestData): IItemEventRouterResponse; + /** + * Record a high score from the shooting range into a player profiles overallcounters + * @param sessionId Session id + * @param pmcData Profile to update + * @param request shooting range score request + * @returns IItemEventRouterResponse + */ + recordShootingRangePoints(sessionId: string, pmcData: IPmcData, request: IRecordShootingRangePoints): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - HideoutImproveArea + * @param sessionId Session id + * @param pmcData profile to improve area in + * @param request improve area request data + */ + improveArea(sessionId: string, pmcData: IPmcData, request: IHideoutImproveAreaRequestData): IItemEventRouterResponse; + /** + * Function called every x seconds as part of onUpdate event */ - protected handleScavCase(sessionID: string, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; - registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; update(): void; } diff --git a/KcY-SeeItemValue/itemValue/server/types/controllers/InraidController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/InraidController.d.ts index 39a6396..f954eff 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/InraidController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/InraidController.d.ts @@ -1,3 +1,4 @@ +import { ApplicationContext } from "../context/ApplicationContext"; import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; import { HealthHelper } from "../helpers/HealthHelper"; import { InRaidHelper } from "../helpers/InRaidHelper"; @@ -35,12 +36,13 @@ export declare class InraidController { protected traderHelper: TraderHelper; protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; + protected applicationContext: ApplicationContext; 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); + 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, applicationContext: ApplicationContext, configServer: ConfigServer); /** - * Save locationid to active profiles inraid object + * Save locationId to active profiles inraid object AND app context * @param sessionID Session id * @param info Register player request */ diff --git a/KcY-SeeItemValue/itemValue/server/types/controllers/InsuranceController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/InsuranceController.d.ts index 54f31b5..af6e68d 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/InsuranceController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/InsuranceController.d.ts @@ -31,13 +31,23 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, insuranceService: InsuranceService, configServer: ConfigServer); + /** + * Process insurance items prior to being given to player in mail + */ processReturn(): void; + /** + * Add insurance to an item + * @param pmcData Player profile + * @param body Insurance request + * @param sessionID Session id + * @returns IItemEventRouterResponse object to send to client + */ insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; /** * Calculate insurance cost * @param info request object * @param sessionID session id - * @returns response object to send to client + * @returns IGetInsuranceCostResponseData object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/KcY-SeeItemValue/itemValue/server/types/controllers/InventoryController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/InventoryController.d.ts index e1c08c0..129ede3 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/InventoryController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/InventoryController.d.ts @@ -129,9 +129,14 @@ export declare class InventoryController { protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** - * Handles sorting of Inventory. + * Handle ApplyInventoryChanges + * Sorts supplied items. + * @param pmcData Player profile + * @param request sort request + * @param sessionID Session id + * @returns IItemEventRouterResponse */ - sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse; + sortInventory(pmcData: IPmcData, request: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse; createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse; deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse; editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/KcY-SeeItemValue/itemValue/server/types/controllers/MatchController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/MatchController.d.ts index 2b0d150..cb0c755 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/MatchController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/MatchController.d.ts @@ -6,10 +6,9 @@ import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequest import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; +import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; -import { BotDifficulty } from "../models/enums/BotDifficulty"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; @@ -42,12 +41,17 @@ export declare class MatchController { joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; getGroupStatus(info: IGetGroupStatusRequestData): any; - startOfflineRaid(info: IStartOfflineRaidRequestData, sessionID: string): void; + /** + * Handle /client/raid/configuration + * @param request + * @param sessionID + */ + startOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void; /** * Convert a difficulty value from pre-raid screen to a bot difficulty - * @param botDifficulty dropdown difficulty + * @param botDifficulty dropdown difficulty value * @returns bot difficulty */ - protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: BotDifficulty): string; + protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: string): string; endOfflineRaid(info: IEndOfflineRaidRequestData, sessionID: string): void; } diff --git a/KcY-SeeItemValue/itemValue/server/types/controllers/ProfileController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/ProfileController.d.ts index 8c89a02..e76785a 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/ProfileController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/ProfileController.d.ts @@ -1,6 +1,7 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; +import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IMiniProfile } from "../models/eft/launcher/IMiniProfile"; @@ -24,8 +25,9 @@ export declare class ProfileController { protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; protected traderHelper: TraderHelper; + protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/KcY-SeeItemValue/itemValue/server/types/controllers/QuestController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/QuestController.d.ts index 842207f..fe1754d 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/QuestController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IQuest, Reward } from "../models/eft/common/tables/IQuest"; +import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData"; @@ -15,11 +16,14 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; +import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; +import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; @@ -29,9 +33,10 @@ export declare class QuestController { protected questConditionHelper: QuestConditionHelper; protected playerService: PlayerService; protected localeService: LocaleService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - 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); + constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) @@ -55,7 +60,30 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; + /** + * Handle the client accepting a repeatable quest and starting it + * Send starting rewards if any to player and + * Send start notification if any to player + * @param pmcData Profile to update with new quest + * @param acceptedQuest Quest being accepted + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Look for an accepted quest inside player profile, return matching + * @param pmcData Profile to search through + * @param acceptedQuest Quest to search for + * @returns IRepeatableQuest + */ + protected getRepeatableQuestFromProfile(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData): IRepeatableQuest; /** * Update completed quest in profile * Add newly unlocked quests to profile @@ -67,13 +95,20 @@ export declare class QuestController { */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; /** - * Send a popup to player on completion of a quest + * Send a popup to player on successful completion of a quest * @param sessionID session id - * @param pmcData player profile - * @param completedQuestId completed quest id - * @param questRewards rewards given to player + * @param pmcData Player profile + * @param completedQuestId Completed quest id + * @param questRewards Rewards given to player */ - protected sendDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Reward[]): void; + protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Reward[]): void; + /** + * Look for newly available quests after completing a quest with a requirement to wait x minutes (time-locked) before being available and add data to profile + * @param pmcData Player profile to update + * @param quests Quests to look for wait conditions in + * @param completedQuestId Quest just completed + */ + protected addTimeLockedQuestsToProfile(pmcData: IPmcData, quests: IQuest[], completedQuestId: string): void; /** * Returns a list of quests that should be failed when a quest is completed * @param completedQuestId quest completed id diff --git a/KcY-SeeItemValue/itemValue/server/types/controllers/RagfairController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/RagfairController.d.ts index 95702f2..fffcaa3 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/RagfairController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/RagfairController.d.ts @@ -67,16 +67,16 @@ export declare class RagfairController { protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; 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, localisationService: LocalisationService, configServer: ConfigServer); - getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; + getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data * @param itemsToAdd - * @param assorts + * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers */ - protected getOffersForSearchType(searchRequest: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + protected getOffersForSearchType(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; /** * Get categories for the type of search being performed, linked/required/all * @param searchRequest Client search request data @@ -100,8 +100,14 @@ export declare class RagfairController { /** * Update a trader flea offer with buy restrictions stored in the traders assort * @param offer flea offer to update + * @param profile full profile of player */ - protected setTraderOfferPurchaseLimits(offer: IRagfairOffer): void; + protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, profile: IAkiProfile): void; + /** + * Adjust ragfair offer stack count to match same value as traders assort stack count + * @param offer Flea offer to adjust + */ + protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; update(): void; @@ -114,6 +120,7 @@ export declare class RagfairController { addPlayerOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse; createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; + getStaticPrices(): Record; removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/KcY-SeeItemValue/itemValue/server/types/controllers/RepeatableQuestController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/RepeatableQuestController.d.ts index 333583b..dd8dc40 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/RepeatableQuestController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/RepeatableQuestController.d.ts @@ -1,3 +1,4 @@ +import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; @@ -20,6 +21,7 @@ import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { PaymentService } from "../services/PaymentService"; import { ProfileFixerService } from "../services/ProfileFixerService"; +import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { MathUtil } from "../utils/MathUtil"; import { ObjectId } from "../utils/ObjectId"; @@ -56,6 +58,7 @@ export declare class RepeatableQuestController { protected timeUtil: TimeUtil; protected logger: ILogger; protected randomUtil: RandomUtil; + protected httpResponse: HttpResponseUtil; protected mathUtil: MathUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; @@ -63,6 +66,7 @@ export declare class RepeatableQuestController { protected presetHelper: PresetHelper; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; + protected handbookHelper: HandbookHelper; protected ragfairServerHelper: RagfairServerHelper; protected eventOutputHolder: EventOutputHolder; protected localisationService: LocalisationService; @@ -71,7 +75,7 @@ export declare class RepeatableQuestController { 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, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, handbookHelper: HandbookHelper, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, 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. @@ -98,6 +102,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists + * @param repeatableConfig daily/weekly config + * @param pmcData Profile to search + * @returns IPmcDataRepeatableQuest + */ + protected getRepeatableQuestSubTypeFromProfile(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): IPmcDataRepeatableQuest; /** * This method is called by GetClientRepeatableQuests and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest @@ -106,17 +117,18 @@ export declare class RepeatableQuestController { /** * Just for debug reasons. Draws dailies a random assort of dailies extracted from dumps */ - generateDebugDailies(dailiesPool: any, factory: any, number: any): any; + generateDebugDailies(dailiesPool: any, factory: any, number: number): any; /** * Generates the base object of quest type format given as templates in assets/database/templates/repeatableQuests.json * The templates include Elimination, Completion and Extraction quest types * * @param {string} type quest type: "Elimination", "Completion" or "Extraction" * @param {string} traderId trader from which the quest will be provided + * @param {string} side scav daily or pmc daily/weekly quest * @returns {object} a object which contains the base elements for repeatable quests of the requests type * (needs to be filled with reward and conditions by called to make a valid quest) */ - generateRepeatableTemplate(type: string, traderId: string): IRepeatableQuest; + generateRepeatableTemplate(type: string, traderId: string, side: string): IRepeatableQuest; /** * Generates a valid Exploration quest * @@ -146,6 +158,12 @@ export declare class RepeatableQuestController { * @returns {object} object of quest type format for "Elimination" (see assets/database/templates/repeatableQuests.json) */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; + /** + * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * @param locationKey e.g factory4_day + * @returns guid + */ + protected getQuestLocationByMapId(locationKey: string): string; /** * Exploration repeatable quests can specify a required extraction point. * This method creates the according object which will be appended to the conditions array @@ -221,16 +239,17 @@ export declare class RepeatableQuestController { generateRewardItem(tpl: string, value: number, index: number, preset?: any): IReward; debugLogRepeatableQuestIds(pmcData: IPmcData): void; probabilityObjectArray(configArrayInput: ProbabilityObject[]): ProbabilityObjectArray; - changeRepeatableQuest(pmcDataIn: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; + changeRepeatableQuest(pmcData: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) - * @returns a list of rewardable items [[_tpl, itemTemplate],...] + * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * @param repeatableQuestConfig config file + * @returns a list of rewardable items [[_tpl, itemTemplate],...] */ protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [string, ITemplateItem][]; /** * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. - * @param {*} tpl template id of item to check + * @param {string} tpl template id of item to check * @returns boolean: true if item is valid reward */ isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean; diff --git a/KcY-SeeItemValue/itemValue/server/types/controllers/TradeController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/TradeController.d.ts index 0ed0556..dc7de19 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/TradeController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/TradeController.d.ts @@ -1,20 +1,30 @@ -import { RagfairServer } from "../servers/RagfairServer"; +import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; -import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { Upd } from "../models/eft/common/tables/IItem"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; -import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { ConfigServer } from "../servers/ConfigServer"; +import { RagfairServer } from "../servers/RagfairServer"; +import { LocalisationService } from "../services/LocalisationService"; +import { HttpResponseUtil } from "../utils/HttpResponseUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; + protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); + protected httpResponse: HttpResponseUtil; + protected localisationService: LocalisationService; + protected configServer: ConfigServer; + protected ragfairConfig: IRagfairConfig; + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/KcY-SeeItemValue/itemValue/server/types/controllers/TraderController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/TraderController.d.ts index d7afe95..b67aec9 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/TraderController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/TraderController.d.ts @@ -7,6 +7,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; +import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { @@ -17,10 +18,11 @@ export declare class TraderController { protected traderHelper: TraderHelper; protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; + protected traderPurchasePersisterService: TraderPurchasePersisterService; 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, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, 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/KcY-SeeItemValue/itemValue/server/types/controllers/WishlistController.d.ts b/KcY-SeeItemValue/itemValue/server/types/controllers/WishlistController.d.ts index 83be4b3..60c4a15 100644 --- a/KcY-SeeItemValue/itemValue/server/types/controllers/WishlistController.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/controllers/WishlistController.d.ts @@ -1,7 +1,7 @@ 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"; +import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"; export declare class WishlistController { protected eventOutputHolder: EventOutputHolder; constructor(eventOutputHolder: EventOutputHolder); diff --git a/KcY-SeeItemValue/itemValue/server/types/di/OnLoad.d.ts b/KcY-SeeItemValue/itemValue/server/types/di/OnLoad.d.ts index 064d07d..a5cdea3 100644 --- a/KcY-SeeItemValue/itemValue/server/types/di/OnLoad.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/di/OnLoad.d.ts @@ -1,4 +1,4 @@ -export declare class OnLoad { - onLoad(): void; +export interface OnLoad { + onLoad(): Promise; getRoute(): string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/di/OnLoadOnUpdate.d.ts b/KcY-SeeItemValue/itemValue/server/types/di/OnLoadOnUpdate.d.ts deleted file mode 100644 index 8bd3dc3..0000000 --- a/KcY-SeeItemValue/itemValue/server/types/di/OnLoadOnUpdate.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { OnLoad } from "./OnLoad"; -import { OnUpdate } from "./OnUpdate"; -export declare class OnLoadOnUpdate implements OnLoad, OnUpdate { - onUpdate(timeSinceLastRun: number): boolean; - onLoad(): void; - getRoute(): string; -} diff --git a/KcY-SeeItemValue/itemValue/server/types/di/OnUpdate.d.ts b/KcY-SeeItemValue/itemValue/server/types/di/OnUpdate.d.ts index 7fbbe09..e1ce375 100644 --- a/KcY-SeeItemValue/itemValue/server/types/di/OnUpdate.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/di/OnUpdate.d.ts @@ -1,4 +1,4 @@ -export declare class OnUpdate { - onUpdate(timeSinceLastRun: number): boolean; +export interface OnUpdate { + onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/generators/BotEquipmentModGenerator.d.ts b/KcY-SeeItemValue/itemValue/server/types/generators/BotEquipmentModGenerator.d.ts new file mode 100644 index 0000000..6703a36 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/generators/BotEquipmentModGenerator.d.ts @@ -0,0 +1,200 @@ +import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; +import { BotHelper } from "../helpers/BotHelper"; +import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; +import { ProbabilityHelper } from "../helpers/ProbabilityHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { Mods, ModsChances } from "../models/eft/common/tables/IBotType"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem"; +import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; +import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemFilterService } from "../services/ItemFilterService"; +import { LocalisationService } from "../services/LocalisationService"; +import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; +export declare class BotEquipmentModGenerator { + protected logger: ILogger; + protected jsonUtil: JsonUtil; + protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; + protected probabilityHelper: ProbabilityHelper; + protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; + protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemFilterService: ItemFilterService; + protected profileHelper: ProfileHelper; + protected botWeaponModLimitService: BotWeaponModLimitService; + protected botHelper: BotHelper; + protected botGeneratorHelper: BotGeneratorHelper; + protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected localisationService: LocalisationService; + protected botEquipmentModPoolService: BotEquipmentModPoolService; + protected configServer: ConfigServer; + protected botConfig: IBotConfig; + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + /** + * Check mods are compatible and add to array + * @param equipment Equipment item to add mods to + * @param modPool Mod list to choose frm + * @param parentId parentid of item to add mod to + * @param parentTemplate template objet of item to add mods to + * @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type + * @param botRole the bot role being generated for + * @param forceSpawn should this mod be forced to spawn + * @returns Item + compatible mods as an array + */ + generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, botRole: string, forceSpawn?: boolean): Item[]; + /** + * Add mods to a weapon using the provided mod pool + * @param sessionId session id + * @param weapon Weapon to add mods to + * @param modPool Pool of compatible mods to attach to weapon + * @param weaponParentId parentId of weapon + * @param parentTemplate Weapon which mods will be generated on + * @param modSpawnChances Mod spawn chances + * @param ammoTpl Ammo tpl to use when generating magazines/cartridges + * @param botRole Role of bot weapon is generated for + * @param botLevel lvel of the bot weapon is being generated for + * @param modLimits limits placed on certian mod types per gun + * @param botEquipmentRole role of bot when accessing bot.json equipment config settings + * @returns Weapon + mods array + */ + generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[]; + /** + * Is this modslot a front or rear sight + * @param modSlot Slot to check + * @returns true if it's a front/rear sight + */ + protected modIsFrontOrRearSight(modSlot: string): boolean; + /** + * Does the provided mod details show the mod can hold a scope + * @param modSlot e.g. mod_scope, mod_mount + * @param modsParentId Parent id of mod item + * @returns true if it can hold a scope + */ + protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean; + /** + * Set all scope mod chances to 100% + * @param modSpawnChances Chances objet to update + */ + protected setScopeSpawnChancesToFull(modSpawnChances: ModsChances): void; + protected sortModKeys(unsortedKeys: string[]): string[]; + /** + * Get a Slot property for an item (chamber/cartridge/slot) + * @param modSlot e.g patron_in_weapon + * @param parentTemplate item template + * @returns Slot item + */ + protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot; + /** + * randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot + * never return true for an item that has 0% spawn chance + * @param itemSlot slot the item sits in + * @param modSlot slot the mod sits in + * @param modSpawnChances Chances for various mod spawns + * @returns boolean true if it should spawn + */ + protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean; + /** + * + * @param modSlot Slot mod will fit into + * @param isRandomisableSlot Will generate a randomised mod pool if true + * @param modsParent Parent slot the item will be a part of + * @param botEquipBlacklist Blacklist to prevent mods from being picked + * @param itemModPool Pool of items to pick from + * @param weapon array with only weapon tpl in it, ready for mods to be added + * @param ammoTpl ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) + * @param parentTemplate Parent item the mod will go into + * @returns ITemplateItem + */ + protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem]; + /** + * Create a mod item with parameters as properties + * @param modId _id + * @param modTpl _tpl + * @param parentId parentId + * @param modSlot slotId + * @param modTemplate Used to add additional properites in the upd object + * @returns Item object + */ + protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item; + /** + * Get a list of containers that hold ammo + * e.g. mod_magazine / patron_in_weapon_000 + * @returns string array + */ + protected getAmmoContainers(): string[]; + /** + * Get a random mod from an items compatible mods Filter array + * @param modTpl ???? default value to return if nothing found + * @param parentSlot item mod will go into, used to get combatible items + * @param modSlot Slot to get mod to fill + * @param items items to ensure picked mod is compatible with + * @returns item tpl + */ + protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; + /** + * Log errors if mod is not compatible with slot + * @param modToAdd template of mod to check + * @param itemSlot slot the item will be placed in + * @param modSlot slot the mod will fill + * @param parentTemplate template of the mods parent item + * @returns true if valid + */ + protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean; + /** + * Find mod tpls of a provided type and add to modPool + * @param desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope) + * @param modTemplate db object for modItem we get compatible mods from + * @param modPool Pool of mods we are adding to + */ + protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void; + /** + * Get the possible items that fit a slot + * @param parentItemId item tpl to get compatible items for + * @param modSlot Slot item should fit in + * @param botEquipBlacklist equipment that should not be picked + * @returns array of compatible items for that slot + */ + protected getDynamicModPool(parentItemId: string, modSlot: string, botEquipBlacklist: EquipmentFilterDetails): string[]; + /** + * Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist + * @param allowedMods base mods to filter + * @param botEquipBlacklist equipment blacklist + * @param modSlot slot mods belong to + * @returns Filtered array of mod tpls + */ + protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[]; + /** + * With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines. + * Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0. + * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. + * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" + * @param items The items where the CylinderMagazine's camora are appended to + * @param modPool modPool which should include available cartrigdes + * @param parentId The CylinderMagazine's UID + * @param parentTemplate The CylinderMagazine's template + */ + protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void; + /** + * Take a record of camoras and merge the compatable shells into one array + * @param camorasWithShells camoras we want to merge into one array + * @returns string array of shells fro luitple camora sources + */ + protected mergeCamoraPoolsTogether(camorasWithShells: Record): string[]; + /** + * Filter out non-whitelisted weapon scopes + * @param weapon Weapon scopes will be added to + * @param scopes Full scope pool + * @param botWeaponSightWhitelist whitelist of scope types by weapon base type + * @returns array of scope tpls that have been filtered + */ + protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record): string[]; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/generators/BotGenerator.d.ts b/KcY-SeeItemValue/itemValue/server/types/generators/BotGenerator.d.ts index 08ad50a..9581259 100644 --- a/KcY-SeeItemValue/itemValue/server/types/generators/BotGenerator.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/generators/BotGenerator.d.ts @@ -1,16 +1,16 @@ import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper"; import { BotHelper } from "../helpers/BotHelper"; -import { GameEventHelper } from "../helpers/GameEventHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { Health as PmcHealth, IBotBase, Skills } from "../models/eft/common/tables/IBotBase"; -import { Health, IBotType, Inventory } from "../models/eft/common/tables/IBotType"; +import { Health as PmcHealth, IBotBase, Info, Skills } from "../models/eft/common/tables/IBotBase"; +import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -29,10 +29,10 @@ export declare class BotGenerator { protected weightedRandomHelper: WeightedRandomHelper; protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; - protected gameEventHelper: GameEventHelper; + protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -42,23 +42,12 @@ export declare class BotGenerator { */ generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase; /** - * Generate an array of bot objects based on a condition for a raid with - * @param sessionId session id - * @param botGenerationDetails details on how to generate the bots - * @returns Generated bots in array + * Create x number of bots of the type/side/difficulty defined in botGenerationDetails + * @param sessionId Session id + * @param botGenerationDetails details on how to generate bots + * @returns array of bots */ - generateByCondition(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[]; - /** - * Get the PMCs wildSpawnType value - * @param role "usec" / "bear" - * @returns wildSpawnType value as string - */ - protected getPmcRoleByDescription(role: string): string; - /** - * Get a randomised PMC side based on bot config value 'isUsec' - * @returns pmc side as string - */ - protected getRandomisedPmcSide(): string; + prepareAndGenerateBots(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[]; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -94,11 +83,6 @@ export declare class BotGenerator { */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; - /** - * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) - * @param nodeInventory Bots inventory to iterate over - */ - protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; /** * Generate a random Id for a bot and apply to bots _id and aid value * @param bot bot to update @@ -107,11 +91,12 @@ export declare class BotGenerator { protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; /** - * Get the difficulty passed in, if its not "asoline", get selected difficulty from config - * @param requestedDifficulty - * @returns + * Randomise a bots game version and account category + * Chooses from all the game versions (standard, eod etc) + * Chooses account type (default, Sherpa, etc) + * @param botInfo bot info object to update */ - protected getPMCDifficulty(requestedDifficulty: string): string; + protected getRandomisedGameVersionAndCategory(botInfo: Info): void; /** * Add a side-specific (usec/bear) dogtag item to a bots inventory * @param bot bot to add dogtag to diff --git a/KcY-SeeItemValue/itemValue/server/types/generators/BotInventoryGenerator.d.ts b/KcY-SeeItemValue/itemValue/server/types/generators/BotInventoryGenerator.d.ts index a3b5eaa..83a548b 100644 --- a/KcY-SeeItemValue/itemValue/server/types/generators/BotInventoryGenerator.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/generators/BotInventoryGenerator.d.ts @@ -4,13 +4,15 @@ import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; -import { IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { EquipmentFilterDetails, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator"; import { BotLootGenerator } from "./BotLootGenerator"; import { BotWeaponGenerator } from "./BotWeaponGenerator"; export declare class BotInventoryGenerator { @@ -24,9 +26,11 @@ export declare class BotInventoryGenerator { protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; + protected botEquipmentModPoolService: BotEquipmentModPoolService; + protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -62,6 +66,13 @@ export declare class BotInventoryGenerator { * @param randomisationDetails settings from bot.json to adjust how item is generated */ protected generateEquipment(equipmentSlot: string, equipmentPool: Record, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory, randomisationDetails: RandomisationDetails): void; + /** + * Get all possible mods for item and filter down based on equipment blacklist from bot.json config + * @param itemTpl Item mod pool is being retreived and filtered + * @param equipmentBlacklist blacklist to filter mod pool with + * @returns Filtered pool of mods + */ + protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: EquipmentFilterDetails[]): Record; /** * Work out what weapons bot should have equipped and add them to bot inventory * @param templateInventory bot/x.json data from db diff --git a/KcY-SeeItemValue/itemValue/server/types/generators/BotWeaponGenerator.d.ts b/KcY-SeeItemValue/itemValue/server/types/generators/BotWeaponGenerator.d.ts index b2eaf3b..a68b82f 100644 --- a/KcY-SeeItemValue/itemValue/server/types/generators/BotWeaponGenerator.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/generators/BotWeaponGenerator.d.ts @@ -12,10 +12,12 @@ import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator"; import { IInventoryMagGen } from "./weapongen/IInventoryMagGen"; export declare class BotWeaponGenerator { protected jsonUtil: JsonUtil; @@ -28,11 +30,13 @@ export declare class BotWeaponGenerator { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected botWeaponModLimitService: BotWeaponModLimitService; + protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -85,9 +89,10 @@ export declare class BotWeaponGenerator { /** * Checks if all required slots are occupied on a weapon and all it's mods * @param weaponItemArray Weapon + mods + * @param botRole role of bot weapon is for * @returns true if valid */ - protected isWeaponValid(weaponItemArray: Item[]): boolean; + protected isWeaponValid(weaponItemArray: Item[], botRole: string): boolean; /** * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer @@ -97,6 +102,13 @@ export declare class BotWeaponGenerator { * @param botRole The bot type we're getting generating extra mags for */ addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + /** + * Add Grendaes for UBGL to bots vest and secure container + * @param weaponMods Weapon array with mods + * @param generatedWeaponResult result of weapon generation + * @param inventory bot inventory to add grenades to + */ + protected addUbglGrenadesToBotInventory(weaponMods: Item[], generatedWeaponResult: GenerateWeaponResult, inventory: PmcInventory): void; /** * Add ammo to the secure container * @param stackCount How many stacks of ammo to add @@ -133,6 +145,13 @@ export declare class BotWeaponGenerator { * @param ammoTpl */ protected fillExistingMagazines(weaponMods: Item[], magazine: Item, ammoTpl: string): void; + /** + * Add desired ammo tpl as item to weaponmods array, placed as child to UBGL + * @param weaponMods + * @param ubglMod + * @param ubglAmmoTpl + */ + protected fillUbgl(weaponMods: Item[], ubglMod: Item, ubglAmmoTpl: string): void; /** * Add cartridge item to weapon Item array, if it already exists, update * @param weaponMods Weapon items array to amend diff --git a/KcY-SeeItemValue/itemValue/server/types/generators/LocationGenerator.d.ts b/KcY-SeeItemValue/itemValue/server/types/generators/LocationGenerator.d.ts index cc61dcf..a617048 100644 --- a/KcY-SeeItemValue/itemValue/server/types/generators/LocationGenerator.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/generators/LocationGenerator.d.ts @@ -1,5 +1,4 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; -import { GameEventHelper } from "../helpers/GameEventHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; @@ -9,6 +8,8 @@ import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticL import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { LocalisationService } from "../services/LocalisationService"; +import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; import { MathUtil } from "../utils/MathUtil"; import { ObjectId } from "../utils/ObjectId"; @@ -26,12 +27,13 @@ export declare class LocationGenerator { protected ragfairServerHelper: RagfairServerHelper; protected itemHelper: ItemHelper; protected mathUtil: MathUtil; - protected gameEventHelper: GameEventHelper; + protected seasonalEventService: SeasonalEventService; protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, gameEventHelper: GameEventHelper, containerHelper: ContainerHelper, presetHelper: PresetHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; protected getLooseLootMultiplerForLocation(location: string): number; protected getStaticLootMultiplerForLocation(location: string): number; @@ -47,7 +49,8 @@ export declare class LocationGenerator { * Add forced spawn point loot into loot parameter array * @param loot array to add forced loot to * @param forcedSpawnPoints forced loot to add + * @param name of map currently generating forced loot for */ - protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[]): void; + protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[], locationName: string): void; protected createItem(tpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/KcY-SeeItemValue/itemValue/server/types/generators/LootGenerator.d.ts b/KcY-SeeItemValue/itemValue/server/types/generators/LootGenerator.d.ts index bc0d7ec..0d2ef24 100644 --- a/KcY-SeeItemValue/itemValue/server/types/generators/LootGenerator.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/generators/LootGenerator.d.ts @@ -6,6 +6,7 @@ import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; +import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; export declare class LootGenerator { @@ -14,8 +15,9 @@ export declare class LootGenerator { protected databaseServer: DatabaseServer; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; + protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); + constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService); /** * Generate a list of items based on configuration options parameter * @param options parameters to adjust how loot is generated diff --git a/KcY-SeeItemValue/itemValue/server/types/generators/PMCLootGenerator.d.ts b/KcY-SeeItemValue/itemValue/server/types/generators/PMCLootGenerator.d.ts index b9f2a83..10918e3 100644 --- a/KcY-SeeItemValue/itemValue/server/types/generators/PMCLootGenerator.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/generators/PMCLootGenerator.d.ts @@ -3,6 +3,7 @@ import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; +import { SeasonalEventService } from "../services/SeasonalEventService"; /** * Handle the generation of dynamic PMC loot in pockets and backpacks * and the removal of blacklisted items @@ -12,10 +13,19 @@ export declare class PMCLootGenerator { protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; + protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService); + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); + /** + * Create an array of loot items a PMC can have in their pockets + * @returns string array of tpls + */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their backpack + * @returns string array of tpls + */ generatePMCBackpackLootPool(): string[]; } diff --git a/KcY-SeeItemValue/itemValue/server/types/generators/PlayerScavGenerator.d.ts b/KcY-SeeItemValue/itemValue/server/types/generators/PlayerScavGenerator.d.ts index bb2c730..3641268 100644 --- a/KcY-SeeItemValue/itemValue/server/types/generators/PlayerScavGenerator.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/generators/PlayerScavGenerator.d.ts @@ -1,4 +1,7 @@ +import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Skills, Stats } from "../models/eft/common/tables/IBotBase"; @@ -10,21 +13,30 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { BotLootCacheService } from "../services/BotLootCacheService"; import { FenceService } from "../services/FenceService"; +import { LocalisationService } from "../services/LocalisationService"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { BotGenerator } from "./BotGenerator"; export declare class PlayerScavGenerator { protected logger: ILogger; + protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; + protected hashUtil: HashUtil; + protected itemHelper: ItemHelper; + protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected botGeneratorHelper: BotGeneratorHelper; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; protected botHelper: BotHelper; protected jsonUtil: JsonUtil; protected fenceService: FenceService; protected botLootCacheService: BotLootCacheService; + protected localisationService: LocalisationService; protected botGenerator: BotGenerator; protected configServer: ConfigServer; protected playerScavConfig: IPlayerScavConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, botGenerator: BotGenerator, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer); /** * Update a player profile to include a new player scav profile * @param sessionID session id to specify what profile is updated diff --git a/KcY-SeeItemValue/itemValue/server/types/generators/RagfairAssortGenerator.d.ts b/KcY-SeeItemValue/itemValue/server/types/generators/RagfairAssortGenerator.d.ts index db4811d..630e863 100644 --- a/KcY-SeeItemValue/itemValue/server/types/generators/RagfairAssortGenerator.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/generators/RagfairAssortGenerator.d.ts @@ -4,6 +4,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; export declare class RagfairAssortGenerator { @@ -11,10 +12,11 @@ export declare class RagfairAssortGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; + protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected generatedAssortItems: Item[]; protected ragfairConfig: IRagfairConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Get an array of unique items that can be sold on the flea * @returns array of unique items diff --git a/KcY-SeeItemValue/itemValue/server/types/generators/RagfairOfferGenerator.d.ts b/KcY-SeeItemValue/itemValue/server/types/generators/RagfairOfferGenerator.d.ts index 23882d2..35fceff 100644 --- a/KcY-SeeItemValue/itemValue/server/types/generators/RagfairOfferGenerator.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/generators/RagfairOfferGenerator.d.ts @@ -7,7 +7,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairOffer, OfferRequirement } from "../models/eft/ragfair/IRagfairOffer"; -import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; +import { Dynamic, IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -88,13 +88,49 @@ export declare class RagfairOfferGenerator { * Create multiple offers for items by using a unique list of items we've generated previously * @param expiredOffers optional, expired offers to regenerate */ - generateDynamicOffers(expiredOffers?: Item[]): void; + generateDynamicOffers(expiredOffers?: Item[]): Promise; + protected createOffersForItems(assortItemIndex: string, assortItemsToProcess: Item[], expiredOffers: Item[], config: Dynamic): Promise; + /** + * Create one flea offer for a specific item + * @param items Item to create offer for + * @param isPreset Is item a weapon preset + * @param itemDetails raw db item details + * @returns + */ + protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise; /** * Generate trader offers on flea using the traders assort data * @param traderID Trader to generate offers for */ generateFleaOffersForTrader(traderID: string): void; - protected getItemCondition(userID: string, items: Item[], itemDetails: ITemplateItem): Item[]; + /** + * Get array of an item with its mods + condition properties (e.g durability) + * Apply randomisation adjustments to condition if item base is found in ragfair.json/dynamic/condition + * @param userID id of owner of item + * @param itemWithMods Item and mods, get condition of first item (only first array item is used) + * @param itemDetails db details of first item + * @returns + */ + protected getItemCondition(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[]; + /** + * Get the relevant condition id if item tpl matches in ragfair.json/condition + * @param tpl Item to look for matching condition object + * @returns condition id + */ + protected getDynamicConditionIdForTpl(tpl: string): string; + /** + * Alter an items condition based on its item base type + * @param conditionSettingsId also the parentId of item being altered + * @param item Item to adjust condition details of + * @param itemDetails db item details of first item in array + */ + protected randomiseItemCondition(conditionSettingsId: string, item: Item, itemDetails: ITemplateItem): void; + /** + * Adjust an items durability/maxDurability value + * @param item item (weapon/armor) to adjust + * @param multiplier Value to multiple durability by + */ + protected randomiseDurabilityValues(item: Item, multiplier: number): void; /** * Add missing conditions to an item if needed * Durabiltiy for repairable items @@ -102,7 +138,7 @@ export declare class RagfairOfferGenerator { * @param item item to add conditions to * @returns Item with conditions added */ - protected addMissingCondition(item: Item): Item; + protected addMissingConditions(item: Item): Item; /** * Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based * @param offerItems Items for sale in offer @@ -110,7 +146,7 @@ export declare class RagfairOfferGenerator { */ protected createBarterRequirement(offerItems: Item[]): IBarterScheme[]; /** - * Get an array of flea prices + item tpl, cached in generator class + * Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter` * @returns array with tpl/price values */ protected getFleaPricesAsArray(): { diff --git a/KcY-SeeItemValue/itemValue/server/types/generators/ScavCaseRewardGenerator.d.ts b/KcY-SeeItemValue/itemValue/server/types/generators/ScavCaseRewardGenerator.d.ts index 89cb5c8..394eeb0 100644 --- a/KcY-SeeItemValue/itemValue/server/types/generators/ScavCaseRewardGenerator.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/generators/ScavCaseRewardGenerator.d.ts @@ -2,7 +2,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { Product } from "../models/eft/common/tables/IBotBase"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase"; -import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData"; import { IScavCaseConfig } from "../models/spt/config/IScavCaseConfig"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "../models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -28,21 +27,15 @@ export declare class ScavCaseRewardGenerator { constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Create an array of rewards that will be given to the player upon completing their scav case build - * @param body client request + * @param recipeId recipe of the scav case craft * @returns Product array */ - generate(body: IHideoutScavCaseStartRequestData): Product[]; + generate(recipeId: string): Product[]; /** * Get all db items that are not blacklisted in scavcase config * @returns filtered array of db items */ protected getDbItems(): ITemplateItem[]; - /** - * Check if a template id has a blacklisted parent id - * @param tplid template id to check - * @returns true if item is blacklisted - */ - protected itemHasBlacklistedParent(tplid: string): boolean; /** * Pick a number of items to be rewards, the count is defined by the values in * @param items item pool to pick rewards from diff --git a/KcY-SeeItemValue/itemValue/server/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts b/KcY-SeeItemValue/itemValue/server/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts new file mode 100644 index 0000000..75395be --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts @@ -0,0 +1,10 @@ +import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper"; +import { IInventoryMagGen } from "../IInventoryMagGen"; +import { InventoryMagGen } from "../InventoryMagGen"; +export declare class UbglExternalMagGen implements IInventoryMagGen { + protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + constructor(botWeaponGeneratorHelper: BotWeaponGeneratorHelper); + getPriority(): number; + canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean; + process(inventoryMagGen: InventoryMagGen): void; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/AssortHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/AssortHelper.d.ts index bfc157f..13512b2 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/AssortHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/AssortHelper.d.ts @@ -2,28 +2,31 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { LocalisationService } from "../services/LocalisationService"; import { ItemHelper } from "./ItemHelper"; import { QuestHelper } from "./QuestHelper"; export declare class AssortHelper { protected logger: ILogger; protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; protected questHelper: QuestHelper; - constructor(logger: ILogger, itemHelper: ItemHelper, databaseServer: DatabaseServer, questHelper: QuestHelper); + constructor(logger: ILogger, itemHelper: ItemHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, questHelper: QuestHelper); /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile * @param traderId traders id * @param assort assort items from a trader + * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile * @param traderId traders id * @param assort traders assorts - * @returns traders assorts minus locked loyality assorts + * @returns traders assorts minus locked loyalty assorts */ stripLockedLoyaltyAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort): ITraderAssort; /** diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/BotDifficultyHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/BotDifficultyHelper.d.ts index a58ebdb..df2c269 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/BotDifficultyHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/BotDifficultyHelper.d.ts @@ -20,7 +20,7 @@ export declare class BotDifficultyHelper { getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** * Get difficulty settings for desired bot type, if not found use assault bot types - * @param type bot type to retreive difficulty of + * @param type bot type to retrieve difficulty of * @param difficulty difficulty to get settings for (easy/normal etc) * @returns Difficulty object */ diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/BotGeneratorHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/BotGeneratorHelper.d.ts index 9ee017f..c7dd606 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/BotGeneratorHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/BotGeneratorHelper.d.ts @@ -1,217 +1,42 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; -import { Mods, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; -import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem"; -import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; -import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; -import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; -import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; -import { BotHelper } from "./BotHelper"; -import { BotWeaponGeneratorHelper } from "./BotWeaponGeneratorHelper"; -import { ContainerHelper } from "./ContainerHelper"; -import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; -import { ProbabilityHelper } from "./ProbabilityHelper"; -import { ProfileHelper } from "./ProfileHelper"; -export declare class BotModLimits { - scope: ItemCount; - scopeMax: number; - scopeBaseTypes: string[]; - flashlightLaser: ItemCount; - flashlightLaserMax: number; - flashlgihtLaserBaseTypes: string[]; -} -export declare class ItemCount { - count: number; -} export declare class BotGeneratorHelper { protected logger: ILogger; - protected jsonUtil: JsonUtil; - protected hashUtil: HashUtil; protected randomUtil: RandomUtil; - protected probabilityHelper: ProbabilityHelper; protected databaseServer: DatabaseServer; protected durabilityLimitsHelper: DurabilityLimitsHelper; protected itemHelper: ItemHelper; - protected inventoryHelper: InventoryHelper; - protected containerHelper: ContainerHelper; - protected botEquipmentFilterService: BotEquipmentFilterService; - protected itemFilterService: ItemFilterService; - protected profileHelper: ProfileHelper; - protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; - protected botHelper: BotHelper; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botHelper: BotHelper, localisationService: LocalisationService, configServer: ConfigServer); - /** - * Check mods are compatible and add to array - * @param equipment Equipment item to add mods to - * @param modPool Mod list to choose frm - * @param parentId parentid of item to add mod to - * @param parentTemplate template objet of item to add mods to - * @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type - * @param botRole the bot role being generated for - * @param forceSpawn should this mod be forced to spawn - * @returns Item + compatible mods as an array - */ - generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, botRole: string, forceSpawn?: boolean): Item[]; - /** - * Add mods to a weapon using the provided mod pool - * @param sessionId session id - * @param weapon Weapon to add mods to - * @param modPool Pool of compatible mods to attach to weapon - * @param weaponParentId parentId of weapon - * @param parentWeaponTemplate Weapon which mods will be generated on - * @param modSpawnChances Mod spawn chances - * @param ammoTpl Ammo tpl to use when generating magazines/cartridges - * @param botRole Role of bot weapon is generated for - * @returns Weapon + mods array - */ - generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentWeaponTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number): Item[]; - /** - * - * @param modSlot Slot mod will fit into - * @param isRandomisableSlot Will generate a randomised mod pool if true - * @param modsParent Parent slot the item will be a part of - * @param botEquipBlacklist Blacklist to prevent mods from being picked - * @param itemModPool Pool of items to pick from - * @param weapon array with only weapon tpl in it, ready for mods to be added - * @param ammoTpl ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) - * @param parentTemplate Parent item the mod will go into - * @returns ITemplateItem - */ - protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, modsParent: Slot, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem]; - /** - * Find mod tpls of a provided type and add to modPool - * @param desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope) - * @param modTemplate db object for modItem we get compatible mods from - * @param modPool Pool of mods we are adding to - */ - protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void; - /** - * Check if mod item is on limited list + has surpassed the limit set for it - * @param botRole role the bot has e.g. assault - * @param modTemplate mods template data - * @param modLimits limits set for weapon being generated for this bot - * @returns true if over item limit - */ - protected modHasReachedItemLimit(botRole: string, modTemplate: ITemplateItem, modLimits: BotModLimits): boolean; - /** - * Initalise mod limits to be used when generating a weapon - * @param botRole "assault", "bossTagilla" or "pmc" - * @returns BotModLimits object - */ - protected initModLimits(botRole: string): BotModLimits; - /** - * Generate a pool of mods for this bots mod type if bot has values inside `randomisedWeaponModSlots` array found in bot.json/equipment[botrole] - * @param allowedMods Mods to be added to mod pool - * @param botEquipBlacklist blacklist of items not allowed to be added to mod pool - * @param modSlot Slot to generate mods for - * @param itemModPool base mod pool to replace values of - */ - protected generateDynamicWeaponModPool(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string, itemModPool: Record): void; - /** - * Find all compatible mods for equipment item and add to modPool - * @param itemDetails item to find mods for - * @param modPool ModPool to add mods to - * @param equipmentBlacklist equipment not allowed to be used by the bot - * @param botEquipmentRole bot type to generate pool for (e.g. assault, pmcBot, pmc for usec/bear) - */ - generateDynamicModPool(itemDetails: ITemplateItem, modPool: Mods, equipmentBlacklist: EquipmentFilterDetails[], botEquipmentRole: string): void; - /** - * Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist - * @param allowedMods base mods to filter - * @param botEquipBlacklist equipment blacklist - * @param modSlot slot mods belong to - * @returns Filtered array of mod tpls - */ - protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[]; - /** - * Check if the specific item type on the weapon has reached the set limit - * @param modTpl log mod tpl if over type limit - * @param currentCount current number of this item on gun - * @param maxLimit mod limit allowed - * @param botRole role of bot we're checking weapon of - * @returns true if limit reached - */ - protected weaponModLimitReached(modTpl: string, currentCount: { - count: number; - }, maxLimit: number, botRole: string): boolean; - /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param itemSlot slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate tempalte of the mods parent item - * @returns true if valid - */ - protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean; - /** - * Create a mod item with parameters as properties - * @param modId _id - * @param modTpl _tpl - * @param parentId parentId - * @param modSlot slotId - * @param modTemplate Used to add additional properites in the upd object - * @returns Item object - */ - protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item; - /** - * randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot - * never return true for an item that has 0% spawn chance - * @param itemSlot slot the item sits in - * @param modSlot slot the mod sits in - * @param modSpawnChances Chances for various mod spawns - * @returns boolean true if it should spawn - */ - protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean; - /** - * Get a list of containers that hold ammo - * e.g. mod_magazine / patron_in_weapon_000 - * @returns string array - */ - protected getAmmoContainers(): string[]; - /** - * Get a Slot property for an item (chamber/cartridge/slot) - * @param modSlot e.g patron_in_weapon - * @param parentTemplate item template - * @returns Slot item - */ - protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot; - /** - * With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines. - * Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0. - * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. - * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" - * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes - * @param parentId The CylinderMagazine's UID - * @param parentTemplate The CylinderMagazine's template - */ - protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void; - /** - * Take a record of camoras and merge the compatable shells into one array - * @param camorasWithShells camoras we want to merge into one array - * @returns string array of shells fro luitple camora sources - */ - protected mergeCamoraPoolsTogether(camorasWithShells: Record): string[]; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability * @param itemTemplate Item extra properties are being generated for - * @param botRole Used by weapons to randomise the durability values. Null for non-equipped items + * @param botRole Used by weapons to randomize the durability values. Null for non-equipped items * @returns Item Upd object with extra properties */ generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): { upd?: Upd; }; + /** + * Get the chance for the weapon attachment or helmet equipment to be set as activated + * @param botRole role of bot with weapon/helmet + * @param setting the setting of the weapon attachment/helmet equipment to be activated + * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null + * @returns Percent chance to be active + */ + protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number; /** * Create a repairable object for a weapon that containers durability + max durability properties * @param itemTemplate weapon object being generated for @@ -227,22 +52,16 @@ export declare class BotGeneratorHelper { */ protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; /** - * Get a random mod from an items compatible mods Filter array - * @param modTpl ???? - * @param parentSlot item mod will go into, used to get combatible items - * @param modSlot Slot to get mod to fill - * @param items items to ensure picked mod is compatible with - * @returns item tpl - */ - protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; - /** - * Can an item be added to an item without issue - * @param items items to check compatiblilities with - * @param tplToCheck tpl of the item to check for incompatibilities + * Can item be added to another item without conflict + * @param items Items to check compatibilities with + * @param tplToCheck Tpl of the item to check for incompatibilities * @param equipmentSlot Slot the item will be placed into - * @returns false if no incompatibilties + * @returns false if no incompatibilities, also has incompatibility reason */ - isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): boolean; + isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): { + incompatible: boolean; + reason: string; + }; /** * Convert a bots role to the equipment role used in config/bot.json * @param botRole Role to convert diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/BotHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/BotHelper.d.ts index 2752a0e..3b49501 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/BotHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/BotHelper.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -22,11 +23,11 @@ export declare class BotHelper { */ getBotTemplate(role: string): IBotType; /** - * Randomise the chance the PMC will attack their own side + * Randomize the chance the PMC will attack their own side * Look up value in bot.json/chanceSameSideIsHostilePercent * @param difficultySettings pmc difficulty settings */ - randomisePmcHostility(difficultySettings: Difficulty): void; + randomizePmcHostility(difficultySettings: Difficulty): void; /** * Is the passed in bot role a PMC (usec/bear/pmc) * @param botRole bot role to check @@ -59,11 +60,29 @@ export declare class BotHelper { * @returns true if should be a pmc */ shouldBotBePmc(botRole: string): boolean; + rollChanceToBePmc(role: string, botConvertMinMax: MinMax): boolean; + botRoleIsPmc(botRole: string): boolean; /** - * Get randomisation settings for bot from config/bot.json + * Get randomization settings for bot from config/bot.json * @param botLevel level of bot * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomisationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + /** + * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * @returns pmc role + */ + getRandomizedPmcRole(): string; + /** + * Get the corresponding side when sptBear or sptUsec is passed in + * @param botRole role to get side for + * @returns side (usec/bear) + */ + getPmcSideByRole(botRole: string): string; + /** + * Get a randomized PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomizedPmcSide(): string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/BotWeaponGeneratorHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/BotWeaponGeneratorHelper.d.ts index 7e25f56..cefc3bd 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -2,8 +2,10 @@ import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { EquipmentSlots } from "../models/enums/EquipmentSlots"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; @@ -16,21 +18,22 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** - * Get a randomised number of bullets for a specific magazine + * Get a randomized number of bullets for a specific magazine * @param magCounts min and max count of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomisedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; /** - * Get a randomised count of magazines + * Get a randomized count of magazines * @param magCounts min and max value returned value can be between - * @returns numberical value of magazine count + * @returns numerical value of magazine count */ - getRandomisedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: MinMax): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -46,12 +49,13 @@ export declare class BotWeaponGeneratorHelper { */ createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** - * Add a specific number of cartrdiges to a bots inventory (vest/pocket) + * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets * @param cartridgeCount number of cartridges to add to vest/pockets * @param inventory bot inventory to add cartridges to + * @param equipmentSlotsToAddTo what equipment slots should bullets be added into */ - addBulletsToVestAndPockets(ammoTpl: string, cartridgeCount: number, inventory: Inventory): void; + addAmmoIntoEquipmentSlots(ammoTpl: string, cartridgeCount: number, inventory: Inventory, equipmentSlotsToAddTo?: EquipmentSlots[]): void; /** * Get a weapons default magazine template id * @param weaponTemplate weapon to get default magazine for @@ -59,7 +63,8 @@ export declare class BotWeaponGeneratorHelper { */ getWeaponsDefaultMagazineTpl(weaponTemplate: ITemplateItem): string; /** - * Adds an item with all its childern into specified equipmentSlots, wherever it fits. + * TODO - move into BotGeneratorHelper, this is not the class for it + * Adds an item with all its children into specified equipmentSlots, wherever it fits. * @param equipmentSlots * @param parentId * @param parentTpl diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/DialogueHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/DialogueHelper.d.ts index 88a726e..8f03b81 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/DialogueHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/DialogueHelper.d.ts @@ -4,6 +4,7 @@ import { MessageType } from "../models/enums/MessageType"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; +import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { ItemHelper } from "./ItemHelper"; import { NotificationSendHelper } from "./NotificationSendHelper"; @@ -15,8 +16,9 @@ export declare class DialogueHelper { protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; protected notificationSendHelper: NotificationSendHelper; + protected localisationService: LocalisationService; protected itemHelper: ItemHelper; - constructor(logger: ILogger, 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, localisationService: LocalisationService, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; /** * Add a templated message to the dialogue. diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/DurabilityLimitsHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/DurabilityLimitsHelper.d.ts index 07a5db1..7122376 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/DurabilityLimitsHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/DurabilityLimitsHelper.d.ts @@ -9,10 +9,10 @@ export declare class DurabilityLimitsHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; constructor(randomUtil: RandomUtil, botHelper: BotHelper, configServer: ConfigServer); - getRandomisedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; - getRandomisedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; - getRandomisedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - getRandomisedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; protected generateMaxWeaponDurability(botRole: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; protected getLowestMaxWeaponFromConfig(botRole: string): number; @@ -23,4 +23,6 @@ export declare class DurabilityLimitsHelper { protected getMaxWeaponDeltaFromConfig(botRole: string): number; protected getMinArmorDeltaFromConfig(botRole: string): number; protected getMaxArmorDeltaFromConfig(botRole: string): number; + protected getMinArmorLimitPercentFromConfig(botRole: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole: string): number; } diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/GameEventHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/GameEventHelper.d.ts index fa25eff..f502c95 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/GameEventHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/GameEventHelper.d.ts @@ -1,4 +1,4 @@ -import { ISeasonalEvent, ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig"; +import { ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; export declare class GameEventHelper { @@ -6,24 +6,4 @@ export declare class GameEventHelper { protected configServer: ConfigServer; protected seasonalEventConfig: ISeasonalEventConfig; constructor(databaseServer: DatabaseServer, configServer: ConfigServer); - get events(): Record; - get christmasEventItems(): string[]; - itemIsChristmasRelated(itemId: string): boolean; - christmasEventEnabled(): boolean; - /** - * Get the dates each seasonal event starts and ends - * @returns Record with event name + start/end date - */ - getEventDetails(): ISeasonalEvent[]; - /** - * Is detection of seasonal events enabled (halloween / christmas) - * @returns true if seasonal events should be checked for - */ - isAutomaticEventDetectionEnabled(): boolean; - /** - * Get a dictionary of gear changes to apply to bots for a specific event e.g. Christmas/Halloween - * @param eventName Name of event to get gear changes for - * @returns bots with equipment changes - */ - getEventBotGear(eventName: string): Record>>; } diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/HandbookHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/HandbookHelper.d.ts index 1ab7800..aa329a9 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/HandbookHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/HandbookHelper.d.ts @@ -11,6 +11,7 @@ export declare class LookupCollection { } export declare class HandbookHelper { protected databaseServer: DatabaseServer; + protected lookupCacheGenerated: boolean; protected handbookPriceCache: LookupCollection; constructor(databaseServer: DatabaseServer); hydrateLookup(): void; @@ -35,18 +36,18 @@ export declare class HandbookHelper { isCategory(category: string): boolean; childrenCategories(x: string): string[]; /** - * Convert currency into roubles - * @param {number} value - * @param {string} currencyFrom - * @returns get rouble value of inputted currency - */ - inRUB(value: number, currencyFrom: string): number; - /** - * Gets Ruble to Currency conversion Value - * @param {number} value - * @param {string} currencyTo - * @returns number + * Convert non-roubles into roubles + * @param nonRoubleCurrencyCount Currency count to convert + * @param currencyTypeFrom What current currency is + * @returns Count in roubles */ - fromRUB(value: number, currencyTo: string): number; + inRUB(nonRoubleCurrencyCount: number, currencyTypeFrom: string): number; + /** + * Convert roubles into another currency + * @param roubleCurrencyCount roubles to convert + * @param currencyTypeTo Currency to convert roubles into + * @returns currency count in desired type + */ + fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; } export {}; diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/HealthHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/HealthHelper.d.ts index 3116c9c..7a6d41d 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/HealthHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/HealthHelper.d.ts @@ -1,6 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; -import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { Effects, IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IHealthConfig } from "../models/spt/config/IHealthConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -16,7 +16,7 @@ export declare class HealthHelper { protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); /** - * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * Resets the profiles vitality/health and vitality/effects properties to their defaults * @param sessionID Session Id * @returns updated profile */ @@ -24,28 +24,34 @@ export declare class HealthHelper { /** * Update player profile with changes from request object * @param pmcData Player profile - * @param info Request object + * @param request Heal request * @param sessionID Session id * @param addEffects Should effects be added or removed (default - add) */ - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; + /** + * Adjust hydration/energy/temperate and body part hp values in player profile to values in profile.vitality + * @param pmcData Profile to update + * @param sessionId Session id + */ protected saveHealth(pmcData: IPmcData, sessionID: string): void; /** * Save effects to profile * Works by removing all effects and adding them back from profile - * Remoces empty 'Effects' objects if found + * Removes empty 'Effects' objects if found * @param pmcData Player profile - * @param sessionID Session id + * @param sessionId Session id + * @param bodyPartsWithEffects dict of body parts with effects that should be added to profile * @param addEffects Should effects be added back to profile - * @returns */ - protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + protected saveEffects(pmcData: IPmcData, sessionId: string, bodyPartsWithEffects: Effects, deleteExistingEffects?: boolean): void; /** * Add effect to body part in profile * @param pmcData Player profile * @param effectBodyPart body part to edit * @param effectType Effect to add to body part + * @param duration How long the effect has left in seconds (-1 by default, no duration). */ - protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string, duration?: number): void; protected isEmpty(map: any): boolean; } diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/HideoutHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/HideoutHelper.d.ts index 9d51fed..a5849e3 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/HideoutHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/HideoutHelper.d.ts @@ -1,8 +1,9 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Common, HideoutArea, Production, Productive } from "../models/eft/common/tables/IBotBase"; +import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "../models/eft/common/tables/IBotBase"; import { Upd } from "../models/eft/common/tables/IItem"; import { StageBonus } from "../models/eft/hideout/IHideoutArea"; -import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; +import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; +import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData"; import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -15,7 +16,6 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { HashUtil } from "../utils/HashUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; -import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { InventoryHelper } from "./InventoryHelper"; import { ProfileHelper } from "./ProfileHelper"; @@ -23,7 +23,6 @@ export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; - protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -36,11 +35,13 @@ export declare class HideoutHelper { static waterCollector: string; static bitcoin: string; static expeditionaryFuelTank: string; + static maxSkillPoint: number; + private static generatorOffMultipler; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, configServer: ConfigServer); - registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, configServer: ConfigServer); + registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** - * This convinience function intialies new Production Object + * This convenience function initializes new Production Object * with all the constants. */ initProduction(recipeId: string, productionTime: number): Production; @@ -81,6 +82,26 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; + /** + * Update a productions progress value based on the amount of time that has passed + * @param pmcData Player profile + * @param prodId Production id being crafted + * @param recipe Recipe data being crafted + * @param hideoutProperties + */ + protected updateProductionProgress(pmcData: IPmcData, prodId: string, recipe: IHideoutProduction, hideoutProperties: { + btcFarmCGs?: number; + isGeneratorOn: boolean; + waterCollectorHasFilter?: boolean; + }): void; + /** + * Check if a productions progress value matches its corresponding recipes production time value + * @param pmcData Player profile + * @param prodId Production id + * @param recipe Recipe being crafted + * @returns progress matches productionTime from recipe + */ + protected doesProgressMatchProductionTime(pmcData: IPmcData, prodId: string): boolean; /** * Update progress timer for scav case * @param pmcData Profile to update @@ -105,7 +126,7 @@ export declare class HideoutHelper { * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update * @param production production object - * @param isGeneratorOn is generatory enabled + * @param isGeneratorOn is generator enabled * @param pmcData Player profile * @returns Updated HideoutArea object */ @@ -113,11 +134,53 @@ export declare class HideoutHelper { protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): void; protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; + /** + * Get a count of how many BTC can be gathered by the profile + * @param pmcData Profile to look up + * @returns coin slot count + */ protected getBTCSlots(pmcData: IPmcData): number; protected getManagementSkillsSlots(): number; protected hasManagementSkillSlots(pmcData: IPmcData): boolean; protected getHideoutManagementSkill(pmcData: IPmcData): Common; protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; + /** + * Get the crafting skill details from player profile + * @param pmcData Player profile + * @returns crafting skill, null if not found + */ + protected getCraftingSkill(pmcData: IPmcData): Common; + /** + * Adjust craft time based on crafting skill level found in player profile + * @param pmcData Player profile + * @param productionTime Time to complete hideout craft in seconds + * @returns Adjusted craft time in seconds + */ + protected getCraftingSkillProductionTimeReduction(pmcData: IPmcData, productionTime: number): number; isProduction(productive: Productive): productive is Production; - getBTC(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Gather crafted BTC from hideout area and add to inventory + * Reset production start timestamp if hideout area at full coin capacity + * @param pmcData Player profile + * @param request Take production request + * @param sessionId Session id + * @returns IItemEventRouterResponse + */ + getBTC(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Upgrade hideout wall from starting level to interactable level if enough time has passed + * @param pmcProfile Profile to upgrade wall in + */ + unlockHideoutWallInProfile(pmcProfile: IPmcData): void; + /** + * Hideout improvement is flagged as complete + * @param improvement hideout improvement object + * @returns true if complete + */ + protected hideoutImprovementIsComplete(improvement: IHideoutImprovement): boolean; + /** + * Iterate over hideout improvements not completed and check if they need to be adjusted + * @param pmcProfile Profile to adjust + */ + setHideoutImprovementsToCompleted(pmcProfile: IPmcData): void; } diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/InRaidHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/InRaidHelper.d.ts index 962df38..c69a810 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/InRaidHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/InRaidHelper.d.ts @@ -5,6 +5,7 @@ import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; +import { LocalisationService } from "../services/LocalisationService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { JsonUtil } from "../utils/JsonUtil"; import { InventoryHelper } from "./InventoryHelper"; @@ -16,8 +17,9 @@ export declare class InRaidHelper { protected databaseServer: DatabaseServer; protected inventoryHelper: InventoryHelper; protected paymentHelper: PaymentHelper; + protected localisationService: LocalisationService; protected profileFixerService: ProfileFixerService; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, profileFixerService: ProfileFixerService); + constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService); /** * Check an array of items and add an upd object to money items with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues @@ -38,10 +40,16 @@ export declare class InRaidHelper { * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data - * @param sessionID Sessino id + * @param sessionID Session id * @returns Reset profile object */ updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): IPmcData; + /** + * Take body part effects from client profile and apply to server profile + * @param saveProgressRequest post-raid request + * @param profileData player profile on server + */ + protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -58,7 +66,7 @@ export declare class InRaidHelper { * Adds SpawnedInSession property to items found in a raid * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true * @param preRaidProfile profile to update - * @param postRaidProfile profile to upate inventory contents of + * @param postRaidProfile profile to update inventory contents of * @param isPlayerScav Was this a p scav raid * @returns */ diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/InventoryHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/InventoryHelper.d.ts index 6419f93..8855d1e 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/InventoryHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/InventoryHelper.d.ts @@ -1,6 +1,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; -import { IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData"; +import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData"; +import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; @@ -43,7 +44,44 @@ export declare class InventoryHelper { protected configServer: ConfigServer; protected inventoryConfig: IInventoryConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, httpResponse: HttpResponseUtil, fenceService: FenceService, databaseServer: DatabaseServer, paymentHelper: PaymentHelper, traderAssortHelper: TraderAssortHelper, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, containerHelper: ContainerHelper, profileHelper: ProfileHelper, localisationService: LocalisationService, configServer: ConfigServer); - addItem(pmcData: IPmcData, body: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: any, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse; + /** + * BUG: Passing the same item multiple times with a count of 1 will cause multiples of that item to be added (e.g. x3 separate objects of tar cola with count of 1 = 9 tarcolas being added to inventory) + * @param pmcData Profile to add items to + * @param request request data to add items + * @param output response to send back to client + * @param sessionID Session id + * @param callback Code to execute later (function) + * @param foundInRaid Will results added to inventory be set as found in raid + * @param addUpd Additional upd properties for items being added to inventory + * @returns IItemEventRouterResponse + */ + addItem(pmcData: IPmcData, request: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: { + (): void; + }, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse; + /** + * Add ammo to ammo boxes + * @param itemToAdd Item to check is ammo box + * @param toDo + * @param output IItemEventRouterResponse object + * @param sessionID Session id + * @param pmcData Profile to add ammobox to + */ + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, toDo: string[][], sessionID: string, output: IItemEventRouterResponse): void; + /** + * + * @param assortItems Items to add to inventory + * @param requestItem Details of purchased item to add to inventory + * @param result Array split stacks are added to + */ + protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; + /** + * Remove item from player inventory + * @param pmcData Profile to remove item from + * @param itemId Items id to remove + * @param sessionID Session id + * @param output Existing IItemEventRouterResponse object to append data to, creates new one by default if not supplied + * @returns IItemEventRouterResponse + */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): Record; diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/ItemHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/ItemHelper.d.ts index fc88a46..de424d2 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/ItemHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/ItemHelper.d.ts @@ -5,12 +5,15 @@ import { IStaticAmmoDetails } from "../models/eft/common/tables/ILootBase"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocaleService } from "../services/LocaleService"; +import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { MathUtil } from "../utils/MathUtil"; import { ObjectId } from "../utils/ObjectId"; import { RandomUtil } from "../utils/RandomUtil"; +import { HandbookHelper } from "./HandbookHelper"; declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; @@ -19,22 +22,32 @@ declare class ItemHelper { protected objectId: ObjectId; protected mathUtil: MathUtil; protected databaseServer: DatabaseServer; + protected handbookHelper: HandbookHelper; + protected itemBaseClassService: ItemBaseClassService; + protected localisationService: LocalisationService; protected localeService: LocaleService; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl - * @returns boolean; true for items that may be in player posession and not quest items + * @returns boolean; true for items that may be in player possession and not quest items */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** * Check if the tpl / template Id provided is a descendent of the baseclass * * @param {string} tpl the item template id to check - * @param {string} baseclassTpl the baseclass to check for + * @param {string} baseClassTpl the baseclass to check for * @return {boolean} is the tpl a descendent? */ - isOfBaseclass(tpl: string, baseclassTpl: string): boolean; + isOfBaseclass(tpl: string, baseClassTpl: string): boolean; + /** + * Check if item has any of the supplied base classes + * @param tpl Item to check base classes of + * @param baseClassTpls base classes to check for + * @returns true if any supplied base classes match + */ + isOfBaseclasses(tpl: string, baseClassTpls: string[]): boolean; /** * Returns the item price based on the handbook or as a fallback from the prices.json if the item is not * found in the handbook. If the price can't be found at all return 0 @@ -152,7 +165,7 @@ declare class ItemHelper { */ getChildId(item: Item): string; /** - * Can the pased in item be stacked + * Can the passed in item be stacked * @param tpl item to check * @returns true if it can be stacked */ @@ -179,7 +192,7 @@ declare class ItemHelper { */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** - * Recursivly loop down through an items hierarchy to see if any of the ids match the supplied list, return true if any do + * WARNING, SLOW. Recursively loop down through an items hierarchy to see if any of the ids match the supplied list, return true if any do * @param {string} tpl * @param {Array} tplsToCheck * @returns boolean @@ -207,7 +220,15 @@ declare class ItemHelper { createRandomMagCartridges(magTemplate: ITemplateItem, parentId: string, staticAmmoDist: Record, caliber?: string): Item; protected getRandomValidCaliber(magTemplate: ITemplateItem): string; protected drawAmmoTpl(caliber: string, staticAmmoDist: Record): string; - createCartidges(parentId: string, ammoTpl: string, stackCount: number): Item; + /** + * + * @param parentId container cartridges will be placed in + * @param ammoTpl Cartridge to insert + * @param stackCount Count of cartridges inside parent + * @param location Location inside parent (e.g. 0, 1) + * @returns Item + */ + createCartridges(parentId: string, ammoTpl: string, stackCount: number, location: number): Item; /** * Get the size of a stack, return 1 if no stack object count property found * @param item Item to get stack size of diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/NotificationSendHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/NotificationSendHelper.d.ts index 014ac95..c80f22d 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/NotificationSendHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/NotificationSendHelper.d.ts @@ -6,7 +6,7 @@ export declare class NotificationSendHelper { protected notificationService: NotificationService; constructor(webSocketServer: WebSocketServer, notificationService: NotificationService); /** - * Send notification message to the appropiate channel + * Send notification message to the appropriate channel */ sendMessage(sessionID: string, notificationMessage: INotification): void; } diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/PresetHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/PresetHelper.d.ts index a469582..cea210e 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/PresetHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/PresetHelper.d.ts @@ -5,8 +5,10 @@ export declare class PresetHelper { protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; + protected defaultPresets: Record; constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; + getDefaultPresets(): Record; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): Preset; diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/ProfileHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/ProfileHelper.d.ts index 9c6560a..79652ad 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/ProfileHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/ProfileHelper.d.ts @@ -5,7 +5,6 @@ import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNic import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; -import { FenceService } from "../services/FenceService"; import { ProfileSnapshotService } from "../services/ProfileSnapshotService"; import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -20,9 +19,13 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - protected fenceService: FenceService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService); + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); resetProfileQuestCondition(sessionID: string, conditionId: string): void; + /** + * Get all profiles from server + * @returns Dictionary of profiles + */ + getProfiles(): Record; getCompleteProfile(sessionID: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen @@ -41,7 +44,7 @@ export declare class ProfileHelper { /** * Add experience to a PMC inside the players profile * @param sessionID Session id - * @param experienceToAdd Experiecne to add to PMC character + * @param experienceToAdd Experience to add to PMC character */ addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/QuestHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/QuestHelper.d.ts index edbd2e1..de7cba2 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/QuestHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/QuestHelper.d.ts @@ -1,8 +1,9 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { Quest } from "../models/eft/common/tables/IBotBase"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; -import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData"; +import { IFailQuestRequestData } from "../models/eft/quests/IFailQuestRequestData"; import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -10,6 +11,7 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "../services/LocaleService"; +import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -32,15 +34,16 @@ export declare class QuestHelper { protected dialogueHelper: DialogueHelper; protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; + protected localisationService: LocalisationService; protected traderHelper: TraderHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** * Get status of a quest by quest id * @param pmcData Profile to search * @param questID Quest id to look up - * @returns QuestStauts enum + * @returns QuestStatus enum */ getQuestStatus(pmcData: IPmcData, questID: string): QuestStatus; /** @@ -52,7 +55,7 @@ export declare class QuestHelper { doesPlayerLevelFulfilCondition(playerLevel: number, condition: AvailableForConditions): boolean; /** * Get the quests found in both arrays (inner join) - * @param before Array of qeusts #1 + * @param before Array of quests #1 * @param after Array of quests #2 * @returns Reduction of cartesian product between two quest arrays */ @@ -61,22 +64,21 @@ export declare class QuestHelper { * Increase skill points of a skill on player profile * @param sessionID Session id * @param pmcData Player profile - * @param output output object to send back to client * @param skillName Name of skill to increase skill points of * @param progressAmount Amount of skill points to add to skill */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, output: IItemEventRouterResponse, skillName: string, progressAmount: number): void; - getQuestLocale(questId: string): any; + rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; /** - * Debug Routine for showing some information on the - * quest list in question. + * Get quest name by quest id + * @param questId id to get + * @returns */ - dumpQuests(quests: any): void; + getQuestNameFromLocale(questId: string): string; /** - * Check if trader has sufficient loyalty to fullfill quest requirement + * Check if trader has sufficient loyalty to fulfill quest requirement * @param questProperties Quest props * @param profile Player profile - * @returns true if loyalty is high enough to fulfil quest requirement + * @returns true if loyalty is high enough to fulfill quest requirement */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; protected processReward(reward: Reward): Reward[]; @@ -88,12 +90,12 @@ export declare class QuestHelper { */ getQuestRewardItems(quest: IQuest, state: QuestStatus): Reward[]; /** - * Update player profile with quest status (e.g. Fail/Success) - * @param pmcData profile to add quest to - * @param newState state the new quest should be in when added - * @param acceptedQuest Details of quest being added + * Look up quest in db by accepted quest id and construct a profile-ready object ready to store in profile + * @param pmcData Player profile + * @param newState State the new quest should be in when returned + * @param acceptedQuest Details of accepted quest from client */ - addQuestToPMCData(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): void; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; /** * TODO: what is going on here * @param acceptedQuestId Quest to add to profile @@ -109,12 +111,12 @@ export declare class QuestHelper { */ failedUnlocked(failedQuestId: string, sessionID: string): IQuest[]; /** - * Adjust quest money rewards by passed in multipler + * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards - * @param multipler Value to adjust money rewards by + * @param multiplier Value to adjust money rewards by * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multipler: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization @@ -125,12 +127,6 @@ export declare class QuestHelper { * @param output ItemEvent router response */ changeItemStack(pmcData: IPmcData, itemId: string, newStackSize: number, sessionID: string, output: IItemEventRouterResponse): void; - /** - * Get List of All Quests from db - * NOT CLONED - * @returns Array of IQuest objects - */ - getQuestsFromDb(): IQuest[]; /** * Get quests, strip all requirement conditions except level * @param quests quests to process @@ -145,45 +141,62 @@ export declare class QuestHelper { getQuestWithOnlyLevelRequirementStartCondition(quest: IQuest): IQuest; /** * Fail a quest in a player profile - * @param pmcData Profile - * @param failRequest fail quest request data + * @param pmcData Player profile + * @param failRequest Fail quest request data * @param sessionID Session id * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: any, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; /** - * Get quest by id from database - * @param questId questid to look for - * @param pmcData player profile + * Get List of All Quests from db + * NOT CLONED + * @returns Array of IQuest objects + */ + getQuestsFromDb(): IQuest[]; + /** + * Get quest by id from database (repeatables are stored in profile, check there if questId not found) + * @param questId Id of quest to find + * @param pmcData Player profile * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; /** * Get the locale Id from locale db for a quest message - * @param questMessageId Quest mesage id to look up + * @param questMessageId Quest message id to look up * @returns Locale Id from locale db */ getQuestLocaleIdFromDb(questMessageId: string): string; /** - * Alter a quests state + Add a record to tis status timers object + * Alter a quests state + Add a record to its status timers object * @param pmcData Profile to update - * @param newQuestState new state the qeust should be in - * @param questId id of the quest to alter the status of + * @param newQuestState New state the quest should be in + * @param questId Id of the quest to alter the status of */ updateQuestState(pmcData: IPmcData, newQuestState: QuestStatus, questId: string): void; /** - * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks - Returns reward items player earned * @param pmcData Player profile - * @param body complete quest request - * @param state State of the quest now its complete - * @param sessionID Seession id - * @returns array of reward objects + * @param questId questId of quest to get rewards for + * @param state State of the quest to get rewards for + * @param sessionId Session id + * @param questResponse Response to send back to client + * @returns Array of reward objects */ - applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: QuestStatus, sessionID: string): Reward[]; + applyQuestReward(pmcData: IPmcData, questId: string, state: QuestStatus, sessionId: string, questResponse: IItemEventRouterResponse): Reward[]; /** - * Get the intel center bonus a player has + * WIP - Find hideout craft id and add to unlockedProductionRecipe array in player profile + * also update client response recipeUnlocked array with craft id + * @param pmcData Player profile + * @param craftUnlockReward Reward item from quest with craft unlock details + * @param questDetails Quest with craft unlock reward + * @param sessionID Session id + * @param response Response to send back to client + */ + protected findAndAddHideoutProductionIdToProfile(pmcData: IPmcData, craftUnlockReward: Reward, questDetails: IQuest, sessionID: string, response: IItemEventRouterResponse): void; + /** + * Get players intel center bonus from profile * @param pmcData player profile - * @returns bonus in percent + * @returns bonus as a percent */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** @@ -192,4 +205,10 @@ export declare class QuestHelper { * @returns 'FindItem' condition id */ getFindItemIdForQuestHandIn(itemTpl: string): string; + /** + * Add all quests to a profile with the provided statuses + * @param pmcProfile profile to update + * @param statuses statuses quests should have + */ + addAllQuestsToProfile(pmcProfile: IPmcData, statuses: QuestStatus[]): void; } diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairOfferHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairOfferHelper.d.ts index b73f786..3d0d570 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairOfferHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairOfferHelper.d.ts @@ -46,8 +46,14 @@ export declare class RagfairOfferHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); - getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Has a traders offer ran out of stock to sell to player + * @param offer Offer to check stock of + * @returns true if out of stock + */ + protected traderOutOfStock(offer: IRagfairOffer): boolean; /** * Check if trader offers' BuyRestrictionMax value has been reached * @param offer offer to check restriction properties of @@ -64,5 +70,5 @@ export declare class RagfairOfferHelper { protected getProfileOffers(sessionID: string): IRagfairOffer[]; protected deleteOfferByOfferId(sessionID: string, offerId: string): void; protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairSellHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairSellHelper.d.ts index 91b8a20..bf7aeb6 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairSellHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairSellHelper.d.ts @@ -11,12 +11,26 @@ export declare class RagfairSellHelper { protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); - calculateSellChance(baseChancePercent: number, offerPriceRub: number, playerListedPriceRub: number): number; + /** + * Get the percent chance to sell an item based on its average listed price vs player chosen listing price + * @param baseChancePercent Base chance to sell item + * @param averageOfferPriceRub Price of average offer in roubles + * @param playerListedPriceRub Price player listed item for in roubles + * @returns percent value + */ + calculateSellChance(baseChancePercent: number, averageOfferPriceRub: number, playerListedPriceRub: number): number; + /** + * Get percent chance to sell an item when price is below items average listing price + * @param playerListedPriceRub Price player listed item for in roubles + * @param averageOfferPriceRub Price of average offer in roubles + * @returns percent value + */ + protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Determine if the offer being listed will be sold * @param sellChancePercent chance item will sell * @param itemSellCount count of items to sell - * @returns Array of purchases of item(s) lsited + * @returns Array of purchases of item(s) listed */ rollForSale(sellChancePercent: number, itemSellCount: number): SellResult[]; } diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairServerHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairServerHelper.d.ts index ec388d8..bfe6cc3 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairServerHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairServerHelper.d.ts @@ -42,7 +42,7 @@ export declare class RagfairServerHelper { protected isItemBlacklisted(itemTemplateId: string): boolean; isTrader(userID: string): boolean; isPlayer(userID: string): boolean; - returnItems(sessionID: string, items: any[]): void; + returnItems(sessionID: string, items: Item[]): void; calculateDynamicStackCount(tplId: string, isWeaponPreset: boolean): number; /** * Choose a currency at random with bias diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairSortHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairSortHelper.d.ts index 4669ce6..6a06528 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairSortHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/RagfairSortHelper.d.ts @@ -7,7 +7,7 @@ export declare class RagfairSortHelper { protected localeService: LocaleService; constructor(databaseServer: DatabaseServer, localeService: LocaleService); /** - * Sort a list of ragfair offers by something (id/rating/offer name/price/expirty time) + * Sort a list of ragfair offers by something (id/rating/offer name/price/expiry time) * @param offers Offers to sort * @param type How to sort it * @param direction Ascending/descending diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/RepairHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/RepairHelper.d.ts index 5b09320..0d0257a 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/RepairHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/RepairHelper.d.ts @@ -15,7 +15,7 @@ export declare class RepairHelper { protected repairConfig: IRepairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * + * Alter an items durability after a repair by trader/repair kit * @param itemToRepair item to update durability details * @param itemToRepairDetails db details of item to repair * @param isArmor Is item being repaired a piece of armor @@ -24,7 +24,12 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegredationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegredationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; + /** + * Is the supplied tpl a weapon + * @param tpl tplId to check is a weapon + * @returns true if tpl is a weapon + */ isWeaponTemplate(tpl: string): boolean; } diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/TradeHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/TradeHelper.d.ts index 2a8f0b7..6811dd1 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/TradeHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/TradeHelper.d.ts @@ -6,8 +6,10 @@ import { Item, Upd } from "../models/eft/common/tables/IItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { FenceService } from "../services/FenceService"; import { PaymentService } from "../services/PaymentService"; @@ -20,28 +22,30 @@ export declare class TradeHelper { protected fenceService: FenceService; protected inventoryHelper: InventoryHelper; protected ragfairServer: RagfairServer; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer); + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer, configServer: ConfigServer); /** * Buy item from flea or trader - * @param pmcData + * @param pmcData Player profile * @param buyRequestData data from client - * @param sessionID - * @param foundInRaid + * @param sessionID Session id + * @param foundInRaid Should item be found in raid * @param upd optional item details used when buying from flea * @returns */ buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData - * @param body - * @param sessionID - * @returns + * @param pmcData Profile to update + * @param sellRequest request data + * @param sessionID Session id + * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, body: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased - * Show error on screen if player attepts to buy more than what the buy max allows + * Show error on screen if player attempts to buy more than what the buy max allows * @param assortBeingPurchased assort being bought * @param itemsPurchasedCount number of items being bought */ diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/TraderAssortHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/TraderAssortHelper.d.ts index 025efd6..a0294a1 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/TraderAssortHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/TraderAssortHelper.d.ts @@ -7,7 +7,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; +import { LocalisationService } from "../services/LocalisationService"; import { TraderAssortService } from "../services/TraderAssortService"; +import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; import { MathUtil } from "../utils/MathUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -27,11 +29,15 @@ export declare class TraderAssortHelper { protected ragfairAssortGenerator: RagfairAssortGenerator; protected ragfairOfferGenerator: RagfairOfferGenerator; protected traderAssortService: TraderAssortService; + protected localisationService: LocalisationService; + protected traderPurchasePersisterService: TraderPurchasePersisterService; protected traderHelper: TraderHelper; protected fenceService: FenceService; protected configServer: ConfigServer; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer); + protected mergedQuestAssorts: Record>; + protected createdMergedQuestAssorts: boolean; + constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, localisationService: LocalisationService, traderPurchasePersisterService: TraderPurchasePersisterService, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer); /** * Get a traders assorts * Can be used for returning ragfair / fence assorts @@ -41,6 +47,10 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Create a dict of all assort id = quest id mappings used to work out what items should be shown to player based on the quests they've started/completed/failed + */ + protected hydrateMergedQuestAssorts(): void; /** * Reset a traders assorts and move nextResupply value to future * Flag trader as needing a flea offer reset to be picked up by flea update() function @@ -57,7 +67,7 @@ export declare class TraderAssortHelper { * Iterate over all assorts barter_scheme values, find barters selling for money and multiply by multipler in config * @param traderAssort Assorts to multiple price of */ - protected multiplyItemPricesByConfigMultipler(traderAssort: ITraderAssort): void; + protected multiplyItemPricesByConfigMultiplier(traderAssort: ITraderAssort): void; /** * Get an array of pristine trader items prior to any alteration by player (as they were on server start) * @param traderId trader id diff --git a/KcY-SeeItemValue/itemValue/server/types/helpers/TraderHelper.d.ts b/KcY-SeeItemValue/itemValue/server/types/helpers/TraderHelper.d.ts index 0dc93e8..49aea28 100644 --- a/KcY-SeeItemValue/itemValue/server/types/helpers/TraderHelper.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/helpers/TraderHelper.d.ts @@ -8,6 +8,7 @@ import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { FenceService } from "../services/FenceService"; +import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; @@ -23,11 +24,14 @@ export declare class TraderHelper { protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; + protected localisationService: LocalisationService; protected fenceService: FenceService; protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + /** Dictionary of item tpl and the highest trader rouble price */ + protected highestTraderPriceItems: Record; + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -39,11 +43,11 @@ export declare class TraderHelper { resetTrader(sessionID: string, traderID: string): void; /** * Alter a traders unlocked status - * @param traderID Trader to alter + * @param traderId Trader to alter * @param status New status to use - * @param sessionID Session id + * @param sessionId Session id */ - setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; + setTraderUnlockedState(traderId: string, status: boolean, sessionId: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -53,22 +57,29 @@ export declare class TraderHelper { getPurchasesData(traderID: string, sessionID: string): Record; /** * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData - * @param item - * @param sellCategory + * @param pmcData Profile + * @param item Item to be checked is sellable to trader + * @param sellCategory categories trader will buy + * @param traderId Trader item is being checked can be sold to * @returns true if should NOT be sold to trader */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[]): boolean; + protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; /** - * Can this weapon be sold to a trader with its current durabiltiy level - * @param traderID - * @param item - * @returns boolean + * Check if item has durability so low it precludes it from being sold to the trader (inclusive) + * @param item Item to check durability of + * @param traderId Trader item is sold to + * @returns */ - protected isWeaponBelowTraderBuyDurability(traderID: string, item: Item): boolean; + protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; /** - * Get the price of an item and all of its attached children - * Take into account bonuses/adjsutments e.g. discounts + * Get the percentage threshold value a trader will buy armor/weapons above + * @param traderId Trader to look up + * @returns percentage + */ + protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; + /** + * Get the price of passed in item and all of its attached children (mods) + * Take into account bonuses/adjustments e.g. discounts * @param pmcData profile data * @param item item to calculate price of * @param buyPriceCoefficient @@ -85,14 +96,21 @@ export declare class TraderHelper { * @returns price as number */ protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; + /** + * Get discount modifier for desired trader + * @param trader Trader to get discount for + * @param buyPriceCoefficient + * @param fenceInfo fence info, needed if getting fence modifier value + * @returns discount modifier value + */ + protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold - * @param sessionID Session id - * @param traderId traders id + * @param sessionId Session id + * @param traderId Traders id * @param standingToAdd Standing value to add to trader */ - addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + addStandingToTrader(sessionId: string, traderId: string, standingToAdd: number): void; /** * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process @@ -113,10 +131,28 @@ export declare class TraderHelper { getTraderUpdateSeconds(traderId: string): number; /** * check if an item is allowed to be sold to a trader - * @param traderFilters array of allowed categories + * @param categoriesTraderBuys array of allowed categories * @param tplToCheck itemTpl of inventory - * @returns boolean + * @returns boolean if item can be sold to trader */ - traderFilter(traderFilters: string[], tplToCheck: string): boolean; + doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; + /** + * Store the purchase of an assort from a trader in the player profile + * @param sessionID Session id + * @param newPurchaseDetails New item assort id + count + */ + addTraderPurchasesToPlayerProfile(sessionID: string, newPurchaseDetails: { + items: { + item_id: string; + count: number; + }[]; + tid: string; + }): void; + /** + * Get the highest rouble price for an item from traders + * @param tpl Item to look up highest pride for + * @returns highest rouble cost for item + */ + getHighestTraderPriceRouble(tpl: string): number; } diff --git a/KcY-SeeItemValue/itemValue/server/types/loaders/BundleLoader.d.ts b/KcY-SeeItemValue/itemValue/server/types/loaders/BundleLoader.d.ts index 06ad698..b88723c 100644 --- a/KcY-SeeItemValue/itemValue/server/types/loaders/BundleLoader.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/loaders/BundleLoader.d.ts @@ -19,4 +19,11 @@ export declare class BundleLoader { getBundle(key: string, local: boolean): BundleInfo; addBundles(modpath: string): void; } +export interface BundleManifest { + manifest: Array; +} +export interface BundleManifestEntry { + key: string; + path: string; +} export {}; diff --git a/KcY-SeeItemValue/itemValue/server/types/loaders/ModTypeCheck.d.ts b/KcY-SeeItemValue/itemValue/server/types/loaders/ModTypeCheck.d.ts new file mode 100644 index 0000000..e907341 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/loaders/ModTypeCheck.d.ts @@ -0,0 +1,43 @@ +import { IPostAkiLoadMod } from "../models/external/IPostAkiLoadMod"; +import { IPostAkiLoadModAsync } from "../models/external/IPostAkiLoadModAsync"; +import { IPostDBLoadMod } from "../models/external/IPostDBLoadMod"; +import { IPostDBLoadModAsync } from "../models/external/IPostDBLoadModAsync"; +import { IPreAkiLoadMod } from "../models/external/IPreAkiLoadMod"; +import { IPreAkiLoadModAsync } from "../models/external/IPreAkiLoadModAsync"; +export declare class ModTypeCheck { + /** + * Use defined safe guard to check if the mod is a IPreAkiLoadMod + * @returns boolean + */ + isPreAkiLoad(mod: any): mod is IPreAkiLoadMod; + /** + * Use defined safe guard to check if the mod is a IPostAkiLoadMod + * @returns boolean + */ + isPostAkiLoad(mod: any): mod is IPostAkiLoadMod; + /** + * Use defined safe guard to check if the mod is a IPostDBLoadMod + * @returns boolean + */ + isPostDBAkiLoad(mod: any): mod is IPostDBLoadMod; + /** + * Use defined safe guard to check if the mod is a IPreAkiLoadModAsync + * @returns boolean + */ + isPreAkiLoadAsync(mod: any): mod is IPreAkiLoadModAsync; + /** + * Use defined safe guard to check if the mod is a IPostAkiLoadModAsync + * @returns boolean + */ + isPostAkiLoadAsync(mod: any): mod is IPostAkiLoadModAsync; + /** + * Use defined safe guard to check if the mod is a IPostDBLoadModAsync + * @returns boolean + */ + isPostDBAkiLoadAsync(mod: any): mod is IPostDBLoadModAsync; + /** + * Checks for mod to be compatible with 3.X+ + * @returns boolean + */ + isPostV3Compatible(mod: any): boolean; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/loaders/PostAkiModLoader.d.ts b/KcY-SeeItemValue/itemValue/server/types/loaders/PostAkiModLoader.d.ts index edc6e5d..5df8c6c 100644 --- a/KcY-SeeItemValue/itemValue/server/types/loaders/PostAkiModLoader.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/loaders/PostAkiModLoader.d.ts @@ -1,21 +1,17 @@ import { DependencyContainer } from "tsyringe"; -import { HandbookController } from "../controllers/HandbookController"; import { IModLoader } from "../models/spt/mod/IModLoader"; -import { ModCompilerService } from "../services/ModCompilerService"; import { VFS } from "../utils/VFS"; import { BundleLoader } from "./BundleLoader"; +import { ModTypeCheck } from "./ModTypeCheck"; import { PreAkiModLoader } from "./PreAkiModLoader"; export declare class PostAkiModLoader implements IModLoader { protected bundleLoader: BundleLoader; - protected handbookController: HandbookController; protected vfs: VFS; - protected modCompilerService: ModCompilerService; protected preAkiModLoader: PreAkiModLoader; - constructor(bundleLoader: BundleLoader, handbookController: HandbookController, vfs: VFS, modCompilerService: ModCompilerService, preAkiModLoader: PreAkiModLoader); - getBundles(local: boolean): string; - getBundle(key: string, local: boolean): void; + protected modTypeCheck: ModTypeCheck; + constructor(bundleLoader: BundleLoader, vfs: VFS, preAkiModLoader: PreAkiModLoader, modTypeCheck: ModTypeCheck); getModPath(mod: string): string; - load(): void; - protected executeMods(container: DependencyContainer): void; + load(): Promise; + protected executeMods(container: DependencyContainer): Promise; protected addBundles(): void; } diff --git a/KcY-SeeItemValue/itemValue/server/types/loaders/PostDBModLoader.d.ts b/KcY-SeeItemValue/itemValue/server/types/loaders/PostDBModLoader.d.ts index 5101b7b..c4cda5c 100644 --- a/KcY-SeeItemValue/itemValue/server/types/loaders/PostDBModLoader.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/loaders/PostDBModLoader.d.ts @@ -1,11 +1,13 @@ import { DependencyContainer } from "tsyringe"; import { OnLoad } from "../di/OnLoad"; +import { ModTypeCheck } from "./ModTypeCheck"; import { PreAkiModLoader } from "./PreAkiModLoader"; export declare class PostDBModLoader implements OnLoad { protected preAkiModLoader: PreAkiModLoader; - constructor(preAkiModLoader: PreAkiModLoader); - onLoad(): void; + protected modTypeCheck: ModTypeCheck; + constructor(preAkiModLoader: PreAkiModLoader, modTypeCheck: ModTypeCheck); + onLoad(): Promise; getRoute(): string; getModPath(mod: string): string; - protected executeMods(container: DependencyContainer): void; + protected executeMods(container: DependencyContainer): Promise; } diff --git a/KcY-SeeItemValue/itemValue/server/types/loaders/PreAkiModLoader.d.ts b/KcY-SeeItemValue/itemValue/server/types/loaders/PreAkiModLoader.d.ts index f486a28..1949696 100644 --- a/KcY-SeeItemValue/itemValue/server/types/loaders/PreAkiModLoader.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/loaders/PreAkiModLoader.d.ts @@ -1,9 +1,5 @@ import { DependencyContainer } from "tsyringe"; -import { IPostAkiLoadMod } from "../models/external/IPostAkiLoadMod"; -import { IPostDBLoadMod } from "../models/external/IPostDBLoadMod"; -import { IPreAkiLoadMod } from "../models/external/IPreAkiLoadMod"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; -import { ModLoader } from "../models/spt/mod/IMod"; import { IModLoader } from "../models/spt/mod/IModLoader"; import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,6 +9,7 @@ import { ModCompilerService } from "../services/ModCompilerService"; import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; import { BundleLoader } from "./BundleLoader"; +import { ModTypeCheck } from "./ModTypeCheck"; export declare class PreAkiModLoader implements IModLoader { protected logger: ILogger; protected vfs: VFS; @@ -21,21 +18,22 @@ export declare class PreAkiModLoader implements IModLoader { protected bundleLoader: BundleLoader; protected localisationService: LocalisationService; protected configServer: ConfigServer; + protected modTypeCheck: ModTypeCheck; protected static container: DependencyContainer; protected readonly basepath = "user/mods/"; - protected imported: Record; + protected readonly modOrderPath = "user/mods/order.json"; + protected order: Record; + protected imported: Record; protected akiConfig: ICoreConfig; - constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; - getBundles(local: boolean): string; - getBundle(key: string, local: boolean): void; /** * Returns a list of mods with preserved load order * @returns Array of mod names in load order */ getImportedModsNames(): string[]; + getImportedModDetails(): Record; getModPath(mod: string): string; - protected importClass(name: string, filepath: string, container: DependencyContainer): void; protected importMods(): Promise; /** * Check for duplciate mods loaded, show error if duplicate mod found @@ -60,29 +58,8 @@ export declare class PreAkiModLoader implements IModLoader { * @returns dictionary */ protected getModsPackageData(mods: string[]): Record; - /** - * Use defined safe guard to check if the mod is a IPreAkiLoadMod - * @returns boolean - */ - protected isPreAkiLoad(mod: any): mod is IPreAkiLoadMod; - /** - * Use defined safe guard to check if the mod is a IPostAkiLoadMod - * @returns boolean - */ - protected isPostAkiLoad(mod: any): mod is IPostAkiLoadMod; - /** - * Use defined safe guard to check if the mod is a IPostDBLoadMod - * @returns boolean - */ - protected isPostDBAkiLoad(mod: any): mod is IPostDBLoadMod; - /** - * Check that the mod is compatible with SPT 3.X.X - * @param mod the mod to check - * @returns boolean - */ - protected isModSpt3XXCompatible(mod: any): boolean; protected isModCombatibleWithAki(mod: IPackageJsonData): boolean; - protected executeMods(container: DependencyContainer): void; + protected executeMods(container: DependencyContainer): Promise; sortModsLoadOrder(): string[]; protected addMod(mod: string): Promise; protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; @@ -94,6 +71,6 @@ export declare class PreAkiModLoader implements IModLoader { */ protected validMod(modName: string): boolean; protected getLoadOrderRecursive(mod: string, result: Record, visited: Record): void; - protected getLoadOrder(mods: Record): Record; + protected getLoadOrder(mods: Record): Record; getContainer(): DependencyContainer; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/IGlobals.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/IGlobals.d.ts index b53f106..b5ed401 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/IGlobals.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,9 @@ export interface Config { GlobalLootChanceModifier: number; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; + TradingSetting: number; + TradingSettings: ITradingSettings; + ItemsCommonSettings: IItemsCommonSettings; LoadTimeSpeedProgress: number; BaseLoadTime: number; BaseUnloadTime: number; @@ -36,6 +39,7 @@ export interface Config { Customization: Customization; UncheckOnShot: boolean; BotsEnabled: boolean; + BufferZone: IBufferZone; ArmorMaterials: ArmorMaterials; LegsOverdamage: number; HandsOverdamage: number; @@ -55,7 +59,6 @@ export interface Config { StaminaRestoration: StaminaRestoration; StaminaDrain: StaminaDrain; RequirementReferences: RequirementReferences; - RepairKitSettings: RepairKitSettings; RestrictionsInRaid: RestrictionsInRaid[]; SkillMinEffectiveness: number; SkillFatiguePerPoint: number; @@ -82,6 +85,23 @@ export interface Config { TestValue: number; Inertia: Inertia; Ballistic: Ballistic; + RepairSettings: RepairSettings; +} +export interface IBufferZone { + CustomerAccessTime: number; + CustomerCriticalTimeStart: number; + CustomerKickNotifTime: number; +} +export interface IItemsCommonSettings { + ItemRemoveAfterInterruptionTime: number; +} +export interface ITradingSettings { + BuyoutRestrictions: IBuyoutRestrictions; +} +export interface IBuyoutRestrictions { + MinDurability: number; + MinFoodDrinkResource: number; + MinMedsResource: number; } export interface Content { ip: string; @@ -321,6 +341,8 @@ export interface Effects { Pain: Pain; PainKiller: PainKiller; SandingScreen: SandingScreen; + MildMusclePain: IMusclePainEffect; + SevereMusclePain: IMusclePainEffect; Stimulator: Stimulator; Tremor: Tremor; ChronicStaminaFatigue: ChronicStaminaFatigue; @@ -457,6 +479,12 @@ export interface PainKiller { export interface SandingScreen { Dummy: number; } +export interface IMusclePainEffect { + GymEffectivity: number; + OfflineDurationMax: number; + OfflineDurationMin: number; + TraumaChance: number; +} export interface Stimulator { BuffLoopTime: number; Buffs: Buffs; @@ -803,7 +831,7 @@ export interface SkillsSettings { HMG: any[]; Launcher: any[]; AttachedLauncher: any[]; - Melee: any[]; + Melee: IMeleeSkill; DMR: WeaponSkills; BearAssaultoperations: any[]; BearAuthority: any[]; @@ -847,10 +875,25 @@ export interface SkillsSettings { BotSound: any[]; TroubleShooting: TroubleShooting; } +export interface IMeleeSkill { + BuffSettings: IBuffSettings; +} export interface ArmorSkills { + BuffMaxCount: number; + BuffSettings: IBuffSettings; + Counters: IArmorCounters; + MoveSpeedPenaltyReductionHVestsReducePerLevel: number; + RicochetChanceHVestsCurrentDurabilityThreshold: number; + RicochetChanceHVestsEliteLevel: number; + RicochetChanceHVestsMaxDurabilityThreshold: number; + MeleeDamageLVestsReducePerLevel: number; + MoveSpeedPenaltyReductionLVestsReducePerLevel: number; WearAmountRepairLVestsReducePerLevel: number; WearChanceRepairLVestsReduceEliteLevel: number; } +export interface IArmorCounters { + armorDurability: ISkillCounter; +} export interface HideoutManagement { SkillPointsPerAreaUpgrade: number; SkillPointsPerCraft: number; @@ -907,6 +950,7 @@ export interface Endurance { MovementAction: number; SprintAction: number; GainPerFatigueStack: number; + QTELevelMultipliers: Record>; } export interface Strength { SprintActionMin: number; @@ -915,9 +959,14 @@ export interface Strength { MovementActionMax: number; PushUpMin: number; PushUpMax: number; + QTELevelMultipliers: IQTELevelMultiplier[]; FistfightAction: number; ThrowAction: number; } +export interface IQTELevelMultiplier { + Level: number; + Multiplier: number; +} export interface Vitality { DamageTakenAction: number; HealthNegativeEffect: number; @@ -950,22 +999,42 @@ export interface Search { FindAction: number; } export interface WeaponTreatment { + BuffMaxCount: number; + BuffSettings: IBuffSettings; + Counters: IWeaponTreatmentCounters; DurLossReducePerLevel: number; SkillPointsPerRepair: number; Filter: any[]; WearAmountRepairGunsReducePerLevel: number; WearChanceRepairGunsReduceEliteLevel: number; } +export interface IWeaponTreatmentCounters { + firearmsDurability: ISkillCounter; +} +export interface IBuffSettings { + CommonBuffChanceLevelBonus: number; + CommonBuffMinChanceValue: number; + CurrentDurabilityLossToRemoveBuff?: number; + MaxDurabilityLossToRemoveBuff?: number; + RareBuffChanceCoff: number; + ReceivedDurabilityMaxPercent: number; +} export interface MagDrills { RaidLoadedAmmoAction: number; RaidUnloadedAmmoAction: number; MagazineCheckAction: number; } export interface Perception { + DependentSkillRatios: ISkillRatio[]; OnlineAction: number; UniqueLoot: number; } +export interface ISkillRatio { + Ratio: number; + SkillId: string; +} export interface Intellect { + Counters: IIntellectCounters; ExamineAction: number; SkillProgress: number; RepairAction: number; @@ -973,16 +1042,52 @@ export interface Intellect { WearChanceReduceEliteLevel: number; RepairPointsCostReduction: number; } +export interface IIntellectCounters { + armorDurability: ISkillCounter; + firearmsDurability: ISkillCounter; + meleeWeaponDurability: ISkillCounter; +} +export interface ISkillCounter { + divisor: number; + points: number; +} export interface Attention { + DependentSkillRatios: ISkillRatio[]; ExamineWithInstruction: number; FindActionFalse: number; FindActionTrue: number; } export interface Charisma { + BonusSettings: IBonusSettings; + Counters: ICharismaSkillCounters; SkillProgressInt: number; SkillProgressAtn: number; SkillProgressPer: number; } +export interface ICharismaSkillCounters { + insuranceCost: ISkillCounter; + repairCost: ISkillCounter; + repeatableQuestCompleteCount: ISkillCounter; + restoredHealthCost: ISkillCounter; + scavCaseCost: ISkillCounter; +} +export interface IBonusSettings { + EliteBonusSettings: IEliteBonusSettings; + LevelBonusSettings: ILevelBonusSettings; +} +export interface IEliteBonusSettings { + FenceStandingLossDiscount: number; + RepeatableQuestExtraCount: number; + ScavCaseDiscount: number; +} +export interface ILevelBonusSettings { + HealthRestoreDiscount: number; + HealthRestoreTraderDiscount: number; + InsuranceDiscount: number; + InsuranceTraderDiscount: number; + PaidExitDiscount: number; + RepeatableQuestChangeDiscount: number; +} export interface Memory { AnySkillUp: number; SkillProgress: number; @@ -1145,11 +1250,30 @@ export interface xyz { export interface Ballistic { GlobalDamageDegradationCoefficient: number; } -export interface RepairKitSettings { +export interface RepairSettings { + ItemEnhancementSettings: IItemEnhancementSettings; + MinimumLevelToApplyBuff: number; + RepairStrategies: IRepairStrategies; armorClassDivisor: number; durabilityPointCostArmor: number; durabilityPointCostGuns: number; } +export interface IItemEnhancementSettings { + DamageReduction: IPriceModifier; + MalfunctionProtections: IPriceModifier; + WeaponSpread: IPriceModifier; +} +export interface IPriceModifier { + PriceModifier: number; +} +export interface IRepairStrategies { + Armor: IRepairStrategy; + Firearms: IRepairStrategy; +} +export interface IRepairStrategy { + BuffTypes: string[]; + Filter: string[]; +} export interface BotPreset { UseThis: boolean; Role: string; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/ILocationBase.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/ILocationBase.d.ts index 78ade9a..1c3a2fa 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/ILocationBase.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/ILocationBase.d.ts @@ -118,6 +118,7 @@ export interface BossLocationSpawn { TriggerName: string; Delay?: number; Supports?: BossSupport[]; + sptId?: string; } export interface BossSupport { BossEscortAmount: string; @@ -179,6 +180,7 @@ export interface Exit { EntryPoints: string; ExfiltrationTime: number; ExfiltrationType: string; + RequiredSlot?: string; Id: string; MaxTime: number; MinTime: number; @@ -202,6 +204,7 @@ export interface Wave { slots_min: number; time_max: number; time_min: number; + sptId?: string; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IBotBase.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IBotBase.d.ts index 1c28ae0..dd7c478 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IBotBase.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IBotBase.d.ts @@ -21,6 +21,7 @@ export interface IBotBase { Hideout: Hideout; Quests: Quest[]; TradersInfo: Record; + UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; RepeatableQuests: IPmcDataRepeatableQuest[]; Bonuses: Bonus[]; @@ -31,6 +32,9 @@ export interface IBotBase { /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IUnlockedInfo { + unlockedProductionRecipe: string[]; +} export interface Info { EntryPoint: string; Nickname: string; @@ -100,7 +104,10 @@ export interface BodyPartsHealth { } export interface BodyPartHealth { Health: CurrentMax; - Effects?: Record; + Effects?: Record; +} +export interface BodyPartEffectProperties { + Time: number; } export interface CurrentMax { Current: number; @@ -120,7 +127,6 @@ export interface FastPanel { export interface Skills { Common: Common[]; Mastering: Mastering[]; - Bonuses?: any[]; Points: number; } export interface Common { @@ -265,12 +271,24 @@ export interface InsuredItem { export interface Hideout { Production: Record; Areas: HideoutArea[]; + Improvements: Record; + sptUpdateLastRunTimestamp: number; +} +export interface IHideoutImprovement { + completed: boolean; + improveCompleteTimestamp: number; } export interface Productive { Products: Product[]; + /** Seconds passed of production */ Progress?: number; + /** Is craft in some state of being worked on by client (crafting/ready to pick up) */ inProgress?: boolean; StartTimestamp?: number; + SkipTime?: number; + /** Seconds needed to fully craft */ + ProductionTime?: number; + sptIsScavCase?: boolean; } export interface Production extends Productive { RecipeId: string; @@ -327,10 +345,12 @@ export interface Quest { statusTimers?: Record; /** SPT specific property */ completedConditions?: string[]; + availableAfter?: number; } export interface TraderInfo { loyaltyLevel: number; salesSum: number; + disabled: boolean; standing: number; nextResupply: number; unlocked: boolean; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IBotType.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IBotType.d.ts index 55b4bd9..e02d990 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IBotType.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IBotType.d.ts @@ -57,6 +57,10 @@ export interface ModsChances { mod_pistol_grip: number; mod_reciever: number; mod_scope: number; + mod_scope_000: number; + mod_scope_001: number; + mod_scope_002: number; + mod_scope_003: number; mod_sight_front: number; mod_sight_rear: number; mod_stock: number; @@ -152,4 +156,4 @@ export interface Items { SpecialLoot: string[]; TacticalVest: string[]; } -export declare type Mods = Record>; +export type Mods = Record>; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IItem.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IItem.d.ts index 2dd2c03..ce00ae9 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IItem.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IItem.d.ts @@ -7,6 +7,7 @@ export interface Item { upd?: Upd; } export interface Upd { + Buff?: Buff; OriginalStackObjectsCount?: number; Togglable?: Togglable; Map?: Map; @@ -16,6 +17,7 @@ export interface Upd { StackObjectsCount?: number; UnlimitedCount?: boolean; Repairable?: Repairable; + RecodableComponent?: RecodableComponent; FireMode?: FireMode; SpawnedInSession?: boolean; Light?: Light; @@ -31,6 +33,12 @@ export interface Upd { SideEffect?: SideEffect; RepairKit?: RepairKit; } +export interface Buff { + rarity: string; + buffType: string; + value: number; + thresholdDurability?: number; +} export interface Togglable { On: boolean; } @@ -52,6 +60,9 @@ export interface Repairable { Durability: number; MaxDurability: number; } +export interface RecodableComponent { + IsEncoded: boolean; +} export interface MedKit { HpResource: number; } @@ -98,7 +109,8 @@ export interface Location { y: number; r: string | number; isSearched?: boolean; - rotation?: string; + /** SPT property? */ + rotation?: string | boolean; } export interface SideEffect { Value: number; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IProfileTemplate.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IProfileTemplate.d.ts index fbcd81a..66ebbe8 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -19,6 +19,8 @@ export interface TemplateSide { } export interface ProfileTraderTemplate { initialLoyaltyLevel: number; + setQuestsAvailableForStart?: boolean; + setQuestsAvailableForFinish?: boolean; initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IQuest.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IQuest.d.ts index c5b1cb2..5c939e1 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IQuest.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IQuest.d.ts @@ -2,7 +2,7 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { - QuestName: string; + QuestName?: string; _id: string; canShowNotificationsInGame: boolean; conditions: Conditions; @@ -15,6 +15,7 @@ export interface IQuest { image: string; type: string; isKey: boolean; + questStatus: any; restartable: boolean; instantComplete: boolean; secretQuest: boolean; @@ -22,7 +23,7 @@ export interface IQuest { successMessageText: string; templateId: string; rewards: Rewards; - status: string; + status: string | number; KeyQuest: boolean; changeQuestMessageText: string; side: string; @@ -37,18 +38,21 @@ export interface Conditions { export interface AvailableForConditions { _parent: string; _props: AvailableForProps; - dynamicLocale: boolean; + dynamicLocale?: boolean; } export interface AvailableForProps { id: string; index: number; parentId: string; + isEncoded: boolean; dynamicLocale: boolean; value?: number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; status?: QuestStatus[]; + availableAfter?: number; + dispersion?: number; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IRepeatableQuests.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IRepeatableQuests.d.ts index e23ec73..3a33f2e 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IRepeatableQuests.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/IRepeatableQuests.d.ts @@ -25,7 +25,7 @@ export interface IPmcDataRepeatableQuest { endTime: number; changeRequirement: TChangeRequirementRecord; } -export declare type TChangeRequirementRecord = Record; +export type TChangeRequirementRecord = Record; export interface IChangeRequirement { changeCost: IChangeCost[]; changeStandingCost: number; @@ -47,6 +47,7 @@ export interface IRepeatableQuest { canShowNotificationsInGame: boolean; rewards: IRewards; conditions: IConditions; + side: string; name: string; note: string; description: string; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/ITemplateItem.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/ITemplateItem.d.ts index 0fa7e18..cbad0a6 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/ITemplateItem.d.ts @@ -29,8 +29,11 @@ export interface Props { IsUnsaleable?: boolean; IsUnbuyable?: boolean; IsUngivable?: boolean; + IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsSpecialSlotOnly?: boolean; QuestItem?: boolean; + QuestStashMaxCount?: number; LootExperience?: number; ExamineExperience?: number; HideEntrails?: boolean; @@ -156,11 +159,12 @@ export interface Props { RigLayoutName?: string; MaxDurability?: number; armorZone?: string[]; - armorClass?: any; + armorClass?: string | number; mousePenalty?: number; weaponErgonomicPenalty?: number; BluntThroughput?: number; ArmorMaterial?: string; + ArmorType?: string; weapClass?: string; weapUseType?: string; ammoCaliber?: string; @@ -365,6 +369,8 @@ export interface Props { CanBeHiddenDuringThrow?: boolean; MinTimeToContactExplode?: number; ExplosionEffectType?: string; + LinkedWeapon?: string; + UseAmmoWithoutShell?: boolean; } export interface IHealthEffect { type: string; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/ITrader.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/ITrader.d.ts index 37b2d61..1fcfbaa 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/ITrader.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/common/tables/ITrader.d.ts @@ -9,6 +9,7 @@ export interface ITrader { export interface ITraderBase { refreshTraderRagfairOffers: boolean; _id: string; + availableInRaid: boolean; avatar: string; balance_dol: number; balance_eur: number; @@ -20,6 +21,8 @@ export interface ITraderBase { discount_end: number; gridHeight: number; insurance: Insurance; + items_buy: IItemBuyData; + items_buy_prohibited: IItemBuyData; location: string; loyaltyLevels: LoyaltyLevel[]; medic: boolean; @@ -31,6 +34,10 @@ export interface ITraderBase { surname: string; unlockedByDefault: boolean; } +export interface IItemBuyData { + category: string[]; + id_list: string[]; +} export interface Insurance { availability: boolean; excluded_category: string[]; @@ -54,8 +61,9 @@ export interface Repair { currency: string; currency_coefficient: number; excluded_category: string[]; + /** Doesn't exist in client object */ excluded_id_list: any[]; - quality: string; + quality: number; } export interface ITraderAssort { nextResupply: number; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/dialog/IChatServer.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/dialog/IChatServer.d.ts new file mode 100644 index 0000000..48cacc4 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/dialog/IChatServer.d.ts @@ -0,0 +1,16 @@ +export interface IChatServer { + _id: string; + RegistrationId: number; + VersionId: string; + Ip: string; + Port: number; + DateTime: number; + Chats: IChat[]; + Regions: string[]; + /** Possibly removed */ + IsDeveloper?: boolean; +} +export interface IChat { + _id: string; + Members: number; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts index 8a29319..f8d700c 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts @@ -1,7 +1,7 @@ import { MemberCategory } from "../../enums/MemberCategory"; export interface IGetFriendListDataResponse { Friends: Friend[]; - Ignore: any[]; + Ignore: string[]; InIgnoreList: string[]; } export interface Friend { diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/game/IGameConfigResponse.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/game/IGameConfigResponse.d.ts index eb37a39..e1b7587 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/game/IGameConfigResponse.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/game/IGameConfigResponse.d.ts @@ -7,11 +7,13 @@ export interface IGameConfigResponse { activeProfileId: string; backend: Backend; utc_time: number; + /** Total in game time */ totalInGame: number; reportAvailable: boolean; twitchEventMember: boolean; } export interface Backend { + Lobby: string; Trading: string; Messaging: string; Main: string; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/game/IGetItemPricesResponse.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/game/IGetItemPricesResponse.d.ts new file mode 100644 index 0000000..ab6e818 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/game/IGetItemPricesResponse.d.ts @@ -0,0 +1,5 @@ +export interface IGetItemPricesResponse { + supplyNextTime: number; + prices: Record; + currencyCourses: Record; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/health/Effect.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/health/Effect.d.ts index 7eb3ffc..62d95a8 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/health/Effect.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/health/Effect.d.ts @@ -1,5 +1,7 @@ export declare enum Effect { FRACTURE = "Fracture", LIGHT_BLEEDING = "LightBleeding", - HEAVY_BLEEDING = "HeavyBleeding" + HEAVY_BLEEDING = "HeavyBleeding", + MILD_MUSCLE_PAIN = "MildMusclePain", + SEVERE_MUSCLE_PAIN = "SevereMusclePain" } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/health/IWorkoutData.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/health/IWorkoutData.d.ts new file mode 100644 index 0000000..ba629d2 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/health/IWorkoutData.d.ts @@ -0,0 +1,4 @@ +export interface IWorkoutData extends Record { + skills: any; + effects: any; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHandleQTEEventRequestData.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHandleQTEEventRequestData.d.ts new file mode 100644 index 0000000..5dda485 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHandleQTEEventRequestData.d.ts @@ -0,0 +1,8 @@ +export interface IHandleQTEEventRequestData { + Action: string; + /** true if QTE was successful, otherwise false */ + results: boolean[]; + /** Id of the QTE object used from db/hideout/qte.json */ + id: string; + timestamp: number; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutArea.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutArea.d.ts index d9fd2bf..fa5ca20 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutArea.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutArea.d.ts @@ -3,23 +3,55 @@ export interface IHideoutArea { type: number; enabled: boolean; needsFuel: boolean; + requirements: IAreaRequirement[]; takeFromSlotLocked: boolean; craftGivesExp: boolean; + displayLevel: boolean; + enableAreaRequirements: boolean; stages: Record; } +export interface IAreaRequirement { + areaType: number; + requiredlevel: number; + type: string; +} export interface Stage { - requirements: Requirement[]; + autoUpgrade: boolean; bonuses: StageBonus[]; - slots: number; constructionTime: number; description: string; + displayInterface: boolean; + improvements: IStageImprovement[]; + requirements: IStageRequirement[]; + slots: number; } -export interface Requirement { +export interface IStageImprovement { + id: string; + bonuses: IStageImprovementBonus[]; + improvementTime: number; + requirements: IStageImprovementRequirement[]; +} +export interface IStageImprovementBonus { + passive: boolean; + production: boolean; + type: string; + value: number; + visible: boolean; +} +export interface IStageImprovementRequirement { + count: number; + isEncoded: boolean; + isFunctional: boolean; + templateId: string; + type: string; +} +export interface IStageRequirement { areaType?: number; requiredLevel?: number; type: string; templateId?: string; count?: number; + isEncoded: false; isFunctional?: boolean; traderId?: string; loyaltyLevel?: number; diff --git a/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutContinousProductionStartRequestData.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutContinuousProductionStartRequestData.d.ts similarity index 59% rename from Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutContinousProductionStartRequestData.d.ts rename to KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutContinuousProductionStartRequestData.d.ts index dba83eb..3ef00c6 100644 --- a/Faupi-HideoutArchitect/server/types/models/eft/hideout/IHideoutContinousProductionStartRequestData.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutContinuousProductionStartRequestData.d.ts @@ -1,4 +1,4 @@ -export interface IHideoutContinousProductionStartRequestData { +export interface IHideoutContinuousProductionStartRequestData { Action: "HideoutContinuousProductionStart"; recipeId: string; timestamp: number; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts new file mode 100644 index 0000000..7e927bf --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts @@ -0,0 +1,13 @@ +export interface IHideoutImproveAreaRequestData { + Action: "HideoutImproveArea"; + /** Hideout area id from areas.json */ + id: string; + areaType: number; + items: HideoutItem[]; + timestamp: number; +} +export interface HideoutItem { + /** Hideout inventory id that was used by improvement action */ + id: string; + count: number; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutProduction.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutProduction.d.ts index ce878be..2367e08 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IHideoutProduction.d.ts @@ -3,8 +3,10 @@ export interface IHideoutProduction { areaType: number; requirements: Requirement[]; productionTime: number; - boosters: any; endProduct: string; + isEncoded: boolean; + locked: boolean; + needFuelForAllProductionTime: boolean; continuous: boolean; count: number; productionLimitCount: number; @@ -12,6 +14,7 @@ export interface IHideoutProduction { export interface Requirement { templateId?: string; count?: number; + isEncoded?: boolean; isFunctional?: boolean; type: string; areaType?: number; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IQteData.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IQteData.d.ts new file mode 100644 index 0000000..f842b84 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IQteData.d.ts @@ -0,0 +1,38 @@ +export interface IQteData { + Id: string; + Type: string; + Area: string; + AreaLevel: number; + QuickTimeEvents: IQuickTimeEvent[]; + Requirements: IQteRequirement[]; + Results: Record; +} +export interface IQuickTimeEvent { + Type: string; + Position: number; + StartDelay: number; + EndDelay: number; + Speed: number; + SuccessRange: string; + Key: string; +} +export interface IQteRequirement { + type: string; +} +export interface IQteResult { + Energy: number; + Hydration: number; + RewardsRange: IQteEffect[]; +} +export interface IQteEffect { + Type: string; + SkillId: string; + levelMultipliers: ISkillLevelMultiplier[]; + Time: number; + Weight: number; + Result: string; +} +export interface ISkillLevelMultiplier { + level: number; + multiplier: number; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IRecordShootingRangePoints.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IRecordShootingRangePoints.d.ts new file mode 100644 index 0000000..5bfd2fd --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/hideout/IRecordShootingRangePoints.d.ts @@ -0,0 +1,4 @@ +export interface IRecordShootingRangePoints { + Action: "RecordShootingRangePoints"; + points: number; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts index bf209c6..4579fdb 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts @@ -1 +1 @@ -export declare type IGetInsuranceCostResponseData = Record>; +export type IGetInsuranceCostResponseData = Record>; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/inventory/IAddItemRequestData.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/inventory/IAddItemRequestData.d.ts index 53db97a..61516d6 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/inventory/IAddItemRequestData.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/inventory/IAddItemRequestData.d.ts @@ -1,4 +1,9 @@ export interface IAddItemRequestData { tid: string; - items: any[]; + items: AddItem[]; +} +export interface AddItem { + count: number; + isPreset?: boolean; + item_id: string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/inventory/IAddItemTempObject.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/inventory/IAddItemTempObject.d.ts new file mode 100644 index 0000000..62d4b64 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/inventory/IAddItemTempObject.d.ts @@ -0,0 +1,7 @@ +import { Item, Location } from "../common/tables/IItem"; +export interface IAddItemTempObject { + itemRef: Item; + count: number; + isPreset: boolean; + location?: Location; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index b45e459..6d7c190 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -16,7 +16,7 @@ export interface ToLocation { export interface Container { id: string; container: string; - location: Location | number; + location?: Location | number; } export interface Location { x: number; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index 60ab284..dbf6330 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,4 +1,5 @@ -import { Skills } from "../common/tables/IBotBase"; +import { QuestStatus } from "../../../models/enums/QuestStatus"; +import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -7,7 +8,7 @@ export interface IItemEventRouterBase { warnings: Warning[]; profileChanges: TProfileChanges | ""; } -export declare type TProfileChanges = Record; +export type TProfileChanges = Record; export interface Warning { index: number; errmsg: string; @@ -21,10 +22,23 @@ export interface ProfileChange { ragFairOffers: IRagfairOffer[]; builds: BuildChange[]; items: ItemChanges; - production: Record; + production: Record; + /** Hideout area improvement id */ + improvements: Record; skills: Skills; - traderRelations: Record; + health: Health; + traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; + recipeUnlocked: Record; + questsStatus: QuestStatusChange[]; +} +export interface QuestStatusChange { + qid: string; + startTime: number; + status: QuestStatus; + statusTimers: Record; + completedConditions: string[]; + availableAfter: number; } export interface BuildChange { id: string; @@ -37,13 +51,9 @@ export interface ItemChanges { change: Product[]; del: Product[]; } -export interface Production { - Progress: number; - StartTimestamp: number; - ProductionTime: number; - inProgress: boolean; - RecipeId: string; - Products: Product[]; +export interface Improvement { + completed: boolean; + improveCompleteTimestamp: number; } export interface Product { _id: string; @@ -59,10 +69,3 @@ export interface ItemChangeLocation { r: number; isSearched?: boolean; } -export interface TraderRelations { - salesSum?: number; - standing?: number; - loyalty?: number; - unlocked?: boolean; - disabled?: boolean; -} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/launcher/IRemoveProfileData.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/launcher/IRemoveProfileData.d.ts index d31c9ac..4cc5618 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/launcher/IRemoveProfileData.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/launcher/IRemoveProfileData.d.ts @@ -1,2 +1,2 @@ import { ILoginRequestData } from "./ILoginRequestData"; -export declare type IRemoveProfileData = ILoginRequestData; +export type IRemoveProfileData = ILoginRequestData; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts new file mode 100644 index 0000000..cbcc2f6 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts @@ -0,0 +1,30 @@ +export interface IGetRaidConfigurationRequestData { + timeVariant: string; + raidMode: string; + metabolismDisabled: boolean; + playersSpawnPlace: string; + timeAndWeatherSettings: TimeAndWeatherSettings; + botSettings: BotSettings; + wavesSettings: WavesSettings; + location: string; +} +export interface TimeAndWeatherSettings { + isRandomTime: boolean; + isRandomWeather: boolean; + cloudinessType: string; + rainType: string; + windType: string; + fogType: string; + timeFlowType: string; + hourOfDay: number; +} +export interface BotSettings { + isScavWars: boolean; + botAmount: string; +} +export interface WavesSettings { + botAmount: string; + botDifficulty: string; + isBosses: boolean; + isTaggedAndCursed: boolean; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/match/IJoinMatchResult.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/match/IJoinMatchResult.d.ts index df695f4..81c9055 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/match/IJoinMatchResult.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/match/IJoinMatchResult.d.ts @@ -6,6 +6,8 @@ export interface IJoinMatchResult { port: number; version: string; location: string; - gamemode: string; + raidMode: string; + mode: string; shortid: string; + additional_info: any[]; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/match/IStartOffineRaidRequestData.d.ts deleted file mode 100644 index 1983728..0000000 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { BotAmount } from "../../enums/BotAmount"; -import { BotDifficulty } from "../../enums/BotDifficulty"; -export interface IStartOfflineRaidRequestData { - locationName: string; - /** Current time, not in-game time */ - startTime: number; - /** CURR = am, past = pm */ - dateTime: "CURR" | "PAST"; - gameSettings: GameSettings; -} -export interface GameSettings { - timeAndWeatherSettings: TimeAndWeatherSettings; - botsSettings: BotsSettings; - wavesSettings: WavesSettings; -} -export interface TimeAndWeatherSettings { - isRandomTime: boolean; - isRandomWeather: boolean; -} -export interface BotsSettings { - isEnabled: boolean; - isScavWars: boolean; - botAmount: BotAmount; -} -export interface WavesSettings { - botDifficulty: BotDifficulty; - isBosses: boolean; - isTaggedAndCursed: boolean; - wavesBotAmount: BotAmount; -} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/profile/GetProfileStatusResponseData.d.ts index cb7368c..1228c2e 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -6,7 +6,13 @@ export interface ProfileData { profileid: string; profileToken: string; status: string; - sid: string; ip: string; port: number; + sid: string; + version?: string; + location?: string; + raidMode?: string; + mode?: string; + shortId?: string; + additional_info?: any[]; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/profile/IAkiProfile.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/profile/IAkiProfile.d.ts index cf28c12..2cea0c8 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/profile/IAkiProfile.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/profile/IAkiProfile.d.ts @@ -11,6 +11,12 @@ export interface IAkiProfile { vitality: Vitality; inraid: Inraid; insurance: Insurance[]; + /** Assort purchases made by player since last trader refresh */ + traderPurchases?: Record>; +} +export declare class TraderPurchaseData { + count: number; + purchaseTimestamp: number; } export interface Info { id: string; @@ -93,6 +99,13 @@ export interface DateTime { } export interface Aki { version: string; + mods?: ModDetails[]; +} +export interface ModDetails { + name: string; + version: string; + author: string; + dateAdded: number; } export interface Vitality { health: Health; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/quests/IFailQuestRequestData.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/quests/IFailQuestRequestData.d.ts new file mode 100644 index 0000000..5881d91 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/quests/IFailQuestRequestData.d.ts @@ -0,0 +1,5 @@ +export interface IFailQuestRequestData { + Action: "QuestComplete"; + qid: string; + removeExcessItems: boolean; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/ragfair/IRagfairOffer.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/ragfair/IRagfairOffer.d.ts index 792ec7d..6b28718 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/ragfair/IRagfairOffer.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/ragfair/IRagfairOffer.d.ts @@ -23,6 +23,7 @@ export interface IRagfairOffer { summaryCost: number; user: IRagfairOfferUser; notAvailable: boolean; + /** TODO - implement this value - not currently used */ CurrentItemCount: number; priority: boolean; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/eft/trade/IProcessSellTradeRequestData.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/eft/trade/IProcessSellTradeRequestData.d.ts index f1d555f..dee0cd5 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/eft/trade/IProcessSellTradeRequestData.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/eft/trade/IProcessSellTradeRequestData.d.ts @@ -3,6 +3,7 @@ export interface IProcessSellTradeRequestData extends IProcessBaseTradeRequestDa Action: "sell_to_trader"; type: string; tid: string; + price: number; items: Item[]; } export interface Item { diff --git a/KcY-SeeItemValue/itemValue/server/types/models/enums/BaseClasses.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/enums/BaseClasses.d.ts index 4eb6f7e..c6e880a 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/enums/BaseClasses.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/enums/BaseClasses.d.ts @@ -1,13 +1,17 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", + UBGL = "55818b014bdc2ddc698b456b", ARMOR = "5448e54d4bdc2dcc718b4568", ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", HEADWEAR = "5a341c4086f77401f2541505", FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", + COMPOUND = "566162e44bdc2d3f298b4573", VISORS = "5448e5724bdc2ddf718b4568", FOOD = "5448e8d04bdc2ddf718b4569", + GAS_BLOCK = "56ea9461d2720b67698b456f", + RAIL_COVER = "55818b1d4bdc2d5b648b4572", DRINK = "5448e8d64bdc2dce718b4568", BARTER_ITEM = "5448eb774bdc2d0a728b4567", INFO = "5448ecbe4bdc2d60728b4568", @@ -27,6 +31,7 @@ export declare enum BaseClasses { MUZZLE = "5448fe394bdc2d0d028b456c", SIGHTS = "5448fe7a4bdc2d6f028b456b", MEDS = "543be5664bdc2dd4348b4569", + MAP = "567849dd4bdc2d150f8b456e", MONEY = "543be5dd4bdc2deb348b4569", NIGHTVISION = "5a2c3a9486f774688b05e574", KEY = "543be5e94bdc2df1348b4568", @@ -36,6 +41,7 @@ export declare enum BaseClasses { THROW_WEAPON = "543be6564bdc2df4348b4568", FOOD_DRINK = "543be6674bdc2df1348b4569", PISTOL = "5447b5cf4bdc2d65278b4567", + REVOLVER = "617f1ef5e8b54b0998387733", SMG = "5447b5e04bdc2d62278b4567", ASSAULT_RIFLE = "5447b5f14bdc2d61278b4567", ASSAULT_CARBINE = "5447b5fc4bdc2d87278b4567", @@ -73,9 +79,10 @@ export declare enum BaseClasses { TACTICAL_COMBO = "55818b164bdc2ddc698b456c", FLASHLIGHT = "55818b084bdc2d5b648b4571", MAGAZINE = "5448bc234bdc2d3c308b4569", - LIGHT_LASER = "55818b0e4bdc2dde698b456e", + LIGHT_LASER_DESIGNATOR = "55818b0e4bdc2dde698b456e", FLASH_HIDER = "550aa4bf4bdc2dd6348b456b", COLLIMATOR = "55818ad54bdc2ddc698b4569", + IRON_SIGHT = "55818ac54bdc2d5b648b456e", COMPACT_COLLIMATOR = "55818acf4bdc2dde698b456b", COMPENSATOR = "550aa4af4bdc2dd4348b456e", OPTIC_SCOPE = "55818ae44bdc2dde698b456c", diff --git a/KcY-SeeItemValue/itemValue/server/types/models/enums/ELocationName.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/enums/ELocationName.d.ts index 7ae7caa..c52ae87 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/enums/ELocationName.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/enums/ELocationName.d.ts @@ -8,5 +8,6 @@ export declare enum ELocationName { LIGHTHOUSE = "Lighthouse", LABORATORY = "laboratory", RESERVE = "RezervBase", + STREETS = "TarkovStreets", ANY = "any" } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/enums/ExitStatis.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/enums/ExitStatis.d.ts new file mode 100644 index 0000000..78d9733 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/models/enums/ExitStatis.d.ts @@ -0,0 +1,7 @@ +export declare enum ExitStatus { + SURVIVED = 0, + KILLED = 1, + LEFT = 2, + RUNNER = 3, + MISSINGINACTION = 4 +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/enums/HideoutAreas.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/enums/HideoutAreas.d.ts index b44a20a..c8313d9 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/enums/HideoutAreas.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/enums/HideoutAreas.d.ts @@ -21,5 +21,7 @@ export declare enum HideoutAreas { SOLAR_POWER = 18, BOOZE_GENERATOR = 19, BITCOIN_FARM = 20, - CHRISTMAS_TREE = 21 + CHRISTMAS_TREE = 21, + EMERGENCY_WALL = 22, + GYM = 23 } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/enums/HideoutEventActions.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/enums/HideoutEventActions.d.ts index e441477..aa04131 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/enums/HideoutEventActions.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/enums/HideoutEventActions.d.ts @@ -7,5 +7,7 @@ export declare enum HideoutEventActions { HIDEOUT_SINGLE_PRODUCTION_START = "HideoutSingleProductionStart", HIDEOUT_SCAV_CASE_PRODUCTION_START = "HideoutScavCaseProductionStart", HIDEOUT_CONTINUOUS_PRODUCTION_START = "HideoutContinuousProductionStart", - HIDEOUT_TAKE_PRODUCTION = "HideoutTakeProduction" + HIDEOUT_TAKE_PRODUCTION = "HideoutTakeProduction", + HIDEOUT_RECORD_SHOOTING_RANGE_POINTS = "RecordShootingRangePoints", + HIDEOUT_IMPROVE_AREA = "HideoutImproveArea" } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/enums/ItemEventActions.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/enums/ItemEventActions.d.ts index 0e65453..94061f8 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/enums/ItemEventActions.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/enums/ItemEventActions.d.ts @@ -15,5 +15,6 @@ export declare enum ItemEventActions { CREATE_MAP_MARKER = "CreateMapMarker", DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", - OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer" + OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/enums/QuestRewardType.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/enums/QuestRewardType.d.ts index 16f7e39..ff8c5f4 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/enums/QuestRewardType.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/enums/QuestRewardType.d.ts @@ -4,5 +4,6 @@ export declare enum QuestRewardType { TRADER_STANDING = "TraderStanding", TRADER_UNLOCK = "TraderUnlock", ITEM = "Item", - ASSORTMENT_UNLOCK = "AssortmentUnlock" + ASSORTMENT_UNLOCK = "AssortmentUnlock", + PRODUCTIONS_SCHEME = "ProductionScheme" } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/enums/QuestStatus.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/enums/QuestStatus.d.ts index ba65933..e706c05 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/enums/QuestStatus.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/enums/QuestStatus.d.ts @@ -7,5 +7,6 @@ export declare enum QuestStatus { Fail = 5, FailRestartable = 6, MarkedAsFailed = 7, - Expired = 8 + Expired = 8, + AvailableAfter = 9 } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/enums/Traders.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/enums/Traders.d.ts index 163cd71..ffea725 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/enums/Traders.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/enums/Traders.d.ts @@ -6,5 +6,6 @@ export declare enum Traders { PEACEKEEPER = "5935c25fb3acc3127c3d8cd9", MECHANIC = "5a7c2eca46aef81a7ca2145d", RAGMAN = "5ac3b934156ae10c4430e83c", - JAEGER = "5c0647fdd443bc2504c2d371" + JAEGER = "5c0647fdd443bc2504c2d371", + LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57" } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/external/HttpFramework.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/external/HttpFramework.d.ts index 3b4a56a..64a37d6 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/external/HttpFramework.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/external/HttpFramework.d.ts @@ -1,6 +1,6 @@ /// import { IncomingMessage, ServerResponse } from "http"; -export declare type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void; +export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void; /** * Associates handlers, HTTP methods and a base url to a listener using a proxy * @param basePath The base path diff --git a/KcY-SeeItemValue/itemValue/server/types/models/external/IPostAkiLoadModAsync.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/external/IPostAkiLoadModAsync.d.ts new file mode 100644 index 0000000..073ce6e --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/models/external/IPostAkiLoadModAsync.d.ts @@ -0,0 +1,4 @@ +import { DependencyContainer } from "./tsyringe"; +export interface IPostAkiLoadModAsync { + postAkiLoadAsync(container: DependencyContainer): Promise; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/external/IPostDBLoadModAsync.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/external/IPostDBLoadModAsync.d.ts new file mode 100644 index 0000000..b23825a --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/models/external/IPostDBLoadModAsync.d.ts @@ -0,0 +1,4 @@ +import { DependencyContainer } from "./tsyringe"; +export interface IPostDBLoadModAsync { + postDBLoadAsync(container: DependencyContainer): Promise; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/external/IPreAkiLoadModAsync.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/external/IPreAkiLoadModAsync.d.ts new file mode 100644 index 0000000..1249ff1 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/models/external/IPreAkiLoadModAsync.d.ts @@ -0,0 +1,4 @@ +import { DependencyContainer } from "./tsyringe"; +export interface IPreAkiLoadModAsync { + preAkiLoadAsync(container: DependencyContainer): Promise; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/bots/BotGenerationDetails.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/bots/BotGenerationDetails.d.ts index 256de03..26571a2 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/bots/BotGenerationDetails.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/bots/BotGenerationDetails.d.ts @@ -3,6 +3,8 @@ export interface BotGenerationDetails { isPmc: boolean; /** assault/pmcBot etc */ role: string; + /** Side of bot */ + side: string; /** Active players current level */ playerLevel: number; /** Delta of highest level of bot */ diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/bots/GenerateWeaponResult.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/bots/GenerateWeaponResult.d.ts index f099752..56fa481 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/bots/GenerateWeaponResult.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/bots/GenerateWeaponResult.d.ts @@ -3,7 +3,8 @@ import { Item } from "../../eft/common/tables/IItem"; import { ITemplateItem } from "../../eft/common/tables/ITemplateItem"; export declare class GenerateWeaponResult { weapon: Item[]; - chosenAmmo: string; + chosenAmmoTpl: string; + chosenUbglAmmoTpl: string; weaponMods: Mods; weaponTemplate: ITemplateItem; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/callbacks/IDataCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/callbacks/IDataCallbacks.d.ts index a098560..b4f4f8c 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/callbacks/IDataCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/callbacks/IDataCallbacks.d.ts @@ -6,7 +6,6 @@ import { IHideoutProduction } from "../../eft/hideout/IHideoutProduction"; import { IHideoutScavCase } from "../../eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "../../eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { ILanguageBase } from "../server/ILocaleBase"; import { ISettingsBase } from "../server/ISettingsBase"; export interface IDataCallbacks { getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; @@ -20,7 +19,7 @@ export interface IDataCallbacks { getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/callbacks/IHideoutCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/callbacks/IHideoutCallbacks.d.ts index e9badb6..ad2af48 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/callbacks/IHideoutCallbacks.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/callbacks/IHideoutCallbacks.d.ts @@ -6,7 +6,7 @@ import { IHideoutPutItemInRequestData } from "../../eft/hideout/IHideoutPutItemI import { IHideoutTakeItemOutRequestData } from "../../eft/hideout/IHideoutTakeItemOutRequestData"; import { IHideoutToggleAreaRequestData } from "../../eft/hideout/IHideoutToggleAreaRequestData"; import { IHideoutSingleProductionStartRequestData } from "../../eft/hideout/IHideoutSingleProductionStartRequestData"; -import { IHideoutContinousProductionStartRequestData } from "../../eft/hideout/IHideoutContinousProductionStartRequestData"; +import { IHideoutContinuousProductionStartRequestData } from "../../eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutTakeProductionRequestData } from "../../eft/hideout/IHideoutTakeProductionRequestData"; import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; export interface IHideoutCallbacks { @@ -17,7 +17,7 @@ export interface IHideoutCallbacks { toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse; scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse; - continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; update(timeSinceLastRun: number): boolean; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/callbacks/IMatchCallbacks.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/callbacks/IMatchCallbacks.d.ts deleted file mode 100644 index fcbf173..0000000 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/callbacks/IMatchCallbacks.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { IStartOfflineRaidRequestData } from "../../eft/match/IStartOffineRaidRequestData"; -import { IEndOfflineRaidRequestData } from "../../eft/match/IEndOfflineRaidRequestData"; -import { INullResponseData } from "../../eft/httpResponse/INullResponseData"; -import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { IPmcData } from "../../eft/common/IPmcData"; -export interface IMatchCallbacks { - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; - exitToMenu(url: string, info: any, sessionID: string): INullResponseData; - startGroupSearch(url: string, info: any, sessionID: string): INullResponseData; - stopGroupSearch(url: string, info: any, sessionID: string): INullResponseData; - sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; - getProfile(url: string, info: any, sessionID: string): IGetBodyResponseData; - serverAvailable(url: string, info: any, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; - joinMatch(url: string, info: any, sessionID: string): IGetBodyResponseData; - getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; - getGroupStatus(url: string, info: any, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; - deleteGroup(url: string, info: any, sessionID: string): INullResponseData; - startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; - endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; -} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IAirdropConfig.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IAirdropConfig.d.ts index 53df991..627b603 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IAirdropConfig.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IAirdropConfig.d.ts @@ -6,6 +6,8 @@ export interface IAirdropConfig extends IBaseConfig { planeMinFlyHeight: number; planeMaxFlyHeight: number; planeVolume: number; + planeSpeed: number; + crateFallSpeed: number; airdropMinStartTimeSeconds: number; airdropMaxStartTimeSeconds: number; loot: AirdropLoot; @@ -17,6 +19,7 @@ export interface AirdropChancePercent { shoreline: number; interchange: number; reserve: number; + tarkovStreets: number; } export interface AirdropLoot { presetCount: MinMax; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IBotConfig.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IBotConfig.d.ts index 83897db..fcbc179 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IBotConfig.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IBotConfig.d.ts @@ -25,6 +25,7 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; /** Batch generation size when type not available in cache */ @@ -66,8 +67,10 @@ export interface LootNvalue { } export interface EquipmentFilters { weaponModLimits: ModLimits; + weaponSightWhitelist: Record; faceShieldIsActiveChancePercent?: number; lightLaserIsActiveChancePercent?: number; + nvgIsActiveChancePercent?: number; randomisation: RandomisationDetails[]; blacklist: EquipmentFilterDetails[]; whitelist: EquipmentFilterDetails[]; @@ -82,6 +85,7 @@ export interface ModLimits { } export interface RandomisationDetails { levelRange: MinMax; + generation?: Record; randomisedWeaponModSlots?: string[]; randomisedArmorSlots?: string[]; /** Equipment chances */ diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IBotDurability.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IBotDurability.d.ts index 38a47cc..a4ff53c 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IBotDurability.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IBotDurability.d.ts @@ -14,19 +14,9 @@ export interface IBotDurability { } /** Durability values to be used when a more specific bot type cant be found */ export interface DefaultDurability { - armor: DefaultArmor; + armor: ArmorDurability; weapon: WeaponDurability; } -export interface DefaultArmor { - maxDelta: number; - minDelta: number; -} -export interface WeaponDurability { - lowestMax: number; - highestMax: number; - maxDelta: number; - minDelta: number; -} export interface PmcDurability { armor: PmcDurabilityArmor; weapon: WeaponDurability; @@ -44,4 +34,12 @@ export interface BotDurability { export interface ArmorDurability { maxDelta: number; minDelta: number; + minLimitPercent: number; +} +export interface WeaponDurability { + lowestMax: number; + highestMax: number; + maxDelta: number; + minDelta: number; + minLimitPercent: number; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ICoreConfig.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ICoreConfig.d.ts index cfcaf61..b2819a4 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ICoreConfig.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ICoreConfig.d.ts @@ -4,4 +4,5 @@ export interface ICoreConfig extends IBaseConfig { akiVersion: string; projectName: string; compatibleTarkovVersion: string; + commit: string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IHideoutConfig.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IHideoutConfig.d.ts index f232052..0785f1e 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IHideoutConfig.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IHideoutConfig.d.ts @@ -3,9 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - generatorSpeedWithoutFuel: number; - generatorFuelFlowRate: number; - airFilterUnitFlowRate: number; - /** SEE HIDEOUTHELPER BEFORE CHANGING CONFIG */ - gpuBoostRate: number; + hideoutWallAppearTimeSeconds: number; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IInsuranceConfig.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IInsuranceConfig.d.ts index b27e753..fd498bc 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IInsuranceConfig.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IInsuranceConfig.d.ts @@ -5,5 +5,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnChancePercent: Record; blacklistedEquipment: string[]; slotIdsWithChanceOfNotReturning: string[]; + returnTimeOverrideSeconds: number; runIntervalSeconds: number; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ILocationConfig.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ILocationConfig.d.ts index 0551d57..f808ad8 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ILocationConfig.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ILocationConfig.d.ts @@ -1,8 +1,21 @@ +import { BossLocationSpawn, Wave } from "../../../models/eft/common/ILocationBase"; import { IBaseConfig } from "./IBaseConfig"; export interface ILocationConfig extends IBaseConfig { kind: "aki-location"; + fixEmptyBotWaves: boolean; + fixRoguesTakingAllSpawnsOnLighthouse: boolean; + lighthouseRogueSpawnTimeSeconds: number; looseLootMultiplier: LootMultiplier; staticLootMultiplier: LootMultiplier; + customWaves: CustomWaves; + /** Open zones to add to map */ + openZones: Record; + /** Key = map id, value = item tpls that should only have one forced loot spawn position */ + forcedLootSingleSpawnById: Record; +} +export interface CustomWaves { + boss: Record; + normal: Record; } export interface LootMultiplier { bigmap: number; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IPlayerScavConfig.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IPlayerScavConfig.d.ts index 5ac3966..3a65e83 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IPlayerScavConfig.d.ts @@ -9,6 +9,7 @@ export interface KarmaLevel { modifiers: Modifiers; itemLimits: ItemLimits; equipmentBlacklist: Record; + labsAccessCardChancePercent: number; } export interface Modifiers { equipment: Record; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IQuestConfig.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IQuestConfig.d.ts index 45c9aae..9adfaba 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IQuestConfig.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IQuestConfig.d.ts @@ -3,12 +3,24 @@ import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { kind: "aki-quest"; redeemTime: number; + questTemplateIds: IPlayerTypeQuestIds; repeatableQuests: IRepeatableQuestConfig[]; + locationIdMap: Record; bearOnlyQuests: string[]; usecOnlyQuests: string[]; } +export interface IPlayerTypeQuestIds { + pmc: IQuestTypeIds; + scav: IQuestTypeIds; +} +export interface IQuestTypeIds { + Elimination: string; + Completion: string; + Exploration: string; +} export interface IRepeatableQuestConfig { name: string; + side: string; types: string[]; resetTime: number; numQuests: number; @@ -16,11 +28,12 @@ export interface IRepeatableQuestConfig { rewardScaling: IRewardScaling; locations: Record; traderWhitelist: ITraderWhitelist[]; - questConfig: IQuestConfig; + questConfig: IRepeatableQuestTypesConfig; /** Item base types to block when generating rewards */ rewardBaseTypeBlacklist: string[]; /** Item tplIds to ignore when generating rewards */ rewardBlacklist: string[]; + rewardAmmoStackMinSize: number; } export interface IRewardScaling { levels: number[]; @@ -34,7 +47,7 @@ export interface ITraderWhitelist { traderId: string; questTypes: string[]; } -export interface IQuestConfig { +export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; Elimination: IElimination; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IRagfairConfig.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IRagfairConfig.d.ts index 6786417..3fa04de 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IRagfairConfig.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IRagfairConfig.d.ts @@ -16,7 +16,7 @@ export interface Sell { } export interface Chance { base: number; - overprices: number; + overpriced: number; underpriced: number; } export interface Time { @@ -29,6 +29,7 @@ export interface Reputation { loss: number; } export interface Dynamic { + purchasesAreFoundInRaid: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; @@ -43,9 +44,10 @@ export interface Dynamic { rating: MinMax; currencies: Record; showAsSingleStack: string[]; + removeSeasonalItemsWhenNotInEvent: boolean; blacklist: Blacklist; } -export declare class Barter { +export interface Barter { enable: boolean; chancePercent: number; itemCountMin: number; @@ -54,7 +56,7 @@ export declare class Barter { minRoubleCostToBecomeBarter: number; itemTypeBlacklist: string[]; } -export declare class OfferAdjustment { +export interface OfferAdjustment { maxPriceDifferenceBelowHandbookPercent: number; handbookPriceMultipier: number; priceThreshholdRub: number; diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IRepairConfig.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IRepairConfig.d.ts index 23e6838..b6db332 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IRepairConfig.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/IRepairConfig.d.ts @@ -1,7 +1,25 @@ +import { MinMax } from "../../../models/common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; export interface IRepairConfig extends IBaseConfig { kind: "aki-repair"; priceMultiplier: number; applyRandomizeDurabilityLoss: boolean; weaponSkillRepairGain: number; + armorKitSkillPointGainPerRepairPointMultiplier: number; + repairKit: RepairKit; +} +export interface RepairKit { + armor: BonusSettings; + weapon: BonusSettings; +} +export interface BonusSettings { + rarityWeight: Record; + bonusTypeWeight: Record; + common: Record; + rare: Record; +} +export interface BonusValues { + valuesMinMax: MinMax; + /** What dura is buff active between (min max of current max) */ + activeDurabilityPercentMinMax: MinMax; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ISeasonalEventConfig.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ISeasonalEventConfig.d.ts index e410925..cedf9a9 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ISeasonalEventConfig.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ISeasonalEventConfig.d.ts @@ -5,6 +5,7 @@ export interface ISeasonalEventConfig extends IBaseConfig { /** event / botType / equipSlot / itemid */ eventGear: Record>>>; events: ISeasonalEvent[]; + gifterSettings: GifterSetting[]; } export interface ISeasonalEvent { name: string; @@ -13,3 +14,8 @@ export interface ISeasonalEvent { endDay: number; endMonth: number; } +export interface GifterSetting { + map: string; + zones: string; + spawnChance: number; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ITraderConfig.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ITraderConfig.d.ts index 8342c99..56c7d35 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ITraderConfig.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/config/ITraderConfig.d.ts @@ -1,10 +1,13 @@ +import { MinMax } from "../../../models/common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; + /** What % of max durability an item needs to sell to a trader*/ + durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; - minDurabilityForSale: number; + persistPurchaseDataInProfile: boolean; fence: FenceConfig; } export interface UpdateTime { @@ -12,13 +15,21 @@ export interface UpdateTime { seconds: number; } export interface FenceConfig { + discountOptions: DiscountOptions; partialRefreshTimeSeconds: number; partialRefreshChangePercent: number; assortSize: number; maxPresetsPercent: number; - presetPriceMult: number; itemPriceMult: number; - regenerateAssortsOnRefresh: boolean; + presetPriceMult: number; + armorMaxDurabilityPercentMinMax: MinMax; + presetMaxDurabilityPercentMinMax: MinMax; itemTypeLimits: Record; + regenerateAssortsOnRefresh: boolean; blacklist: string[]; } +export interface DiscountOptions { + assortSize: number; + itemPriceMult: number; + presetPriceMult: number; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/mod/IMod.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/mod/IMod.d.ts deleted file mode 100644 index e6eec79..0000000 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/mod/IMod.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export declare namespace ModLoader { - interface IMod { - name: string; - version: string; - main?: string; - author?: string; - license: string; - dependencies?: Record; - } -} diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/mod/IModLoader.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/mod/IModLoader.d.ts index 40a5e19..9a71f61 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/mod/IModLoader.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/mod/IModLoader.d.ts @@ -1,7 +1,5 @@ import { DependencyContainer } from "tsyringe"; export interface IModLoader { load(container: DependencyContainer): void; - getBundles(local: boolean): string; - getBundle(key: string, local: boolean): void; getModPath(mod: string): string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/mod/IPackageJsonData.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/mod/IPackageJsonData.d.ts index 99e4ef9..06f7454 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/mod/IPackageJsonData.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/mod/IPackageJsonData.d.ts @@ -1,6 +1,6 @@ export interface IPackageJsonData { incompatibilities?: string[]; - dependencies?: string[]; + dependencies?: Record; modDependencies?: Record; name: string; author: string; @@ -8,5 +8,6 @@ export interface IPackageJsonData { akiVersion: string; licence: string; main: string; + isBundleMod: boolean; contributors: string[]; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/server/IDatabaseTables.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/server/IDatabaseTables.d.ts index 9978459..582d9e2 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/server/IDatabaseTables.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/server/IDatabaseTables.d.ts @@ -1,3 +1,4 @@ +import { IQteData } from "../../../models/eft/hideout/IQteData"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -30,6 +31,7 @@ export interface IDatabaseTables { production: IHideoutProduction[]; scavcase: IHideoutScavCase[]; settings: IHideoutSettingsBase; + qte: IQteData[]; }; locales?: ILocaleBase; locations?: ILocations; @@ -38,10 +40,8 @@ export interface IDatabaseTables { templates?: { character: string[]; items: Record; - quests: IQuest[]; + quests: Record; repeatableQuests: IRepeatableQuestDatabase; - /** DEPRECATED - Items file found in the client, massivly out of date compared to templates.items, try not to use this, remove ASAP*/ - clientItems: Record; handbook: IHandbookBase; customization: Record; /** The profile templates listed in the launcher on profile creation, split by account type (e.g. Standard) then side (e.g. bear/usec) */ diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/server/ILocaleBase.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/server/ILocaleBase.d.ts index 6e20b89..3cdaf6f 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/server/ILocaleBase.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/server/ILocaleBase.d.ts @@ -1,49 +1,5 @@ export interface ILocaleBase { - global: Record; + global: Record>; menu: Record; - languages: ILanguageBase[]; -} -export interface ILocaleGlobalBase { - interface: Record; - enum: any[]; - mail: Record; - quest: Record; - preset: Record; - handbook: Record; - season: Record; - customization: Record; - repeatableQuest: Record; - templates: Record; - locations: Record; - banners: Record; - trading: Record; -} -export interface ILocaleQuest { - name: string; - description: string; - note: string; - failMessageText: string; - startedMessageText: string; - successMessageText: string; - conditions: Record; - location: string; -} -export interface ILocalePreset { - Name: string; -} -export interface ILocaleProps { - Name: string; - ShortName: string; - Description: string; -} -export interface ILocaleTradingProps { - FullName: string; - FirstName: string; - Nickname: string; - Location: string; - Description: string; -} -export interface ILanguageBase { - ShortName: string; - Name: string; + languages: Record; } diff --git a/KcY-SeeItemValue/itemValue/server/types/models/spt/server/ISettingsBase.d.ts b/KcY-SeeItemValue/itemValue/server/types/models/spt/server/ISettingsBase.d.ts index c067cda..2870cfb 100644 --- a/KcY-SeeItemValue/itemValue/server/types/models/spt/server/ISettingsBase.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/models/spt/server/ISettingsBase.d.ts @@ -10,7 +10,9 @@ export interface Config { FirstCycleDelaySeconds: number; FramerateLimit: FramerateLimit; GroupStatusInterval: number; + GroupStatusButtonInterval: number; KeepAliveInterval: number; + LobbyKeepAliveInterval: number; Mark502and504AsNonImportant: boolean; MemoryManagementSettings: MemoryManagementSettings; NVidiaHighlights: boolean; @@ -18,7 +20,10 @@ export interface Config { PingServerResultSendInterval: number; PingServersInterval: number; ReleaseProfiler: ReleaseProfiler; + RequestConfirmationTimeouts: number[]; + RequestsMadeThroughLobby: string[]; SecondCycleDelaySeconds: number; + ShouldEstablishLobbyConnection: boolean; TurnOffLogging: boolean; WeaponOverlapDistanceCulling: number; WebDiagnosticsEnabled: boolean; diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/EventOutputHolder.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/EventOutputHolder.d.ts index 7a2387b..9a34219 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/EventOutputHolder.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/EventOutputHolder.d.ts @@ -1,11 +1,41 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IPmcData } from "../models/eft/common/IPmcData"; +import { IHideoutImprovement, Productive } from "../models/eft/common/tables/IBotBase"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { JsonUtil } from "../utils/JsonUtil"; +import { TimeUtil } from "../utils/TimeUtil"; export declare class EventOutputHolder { protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; - constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected timeUtil: TimeUtil; + /** What has client been informed of this game session */ + protected clientActiveSessionStorage: Record; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper, timeUtil: TimeUtil); protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; + /** + * Reset the response object to a default state + * Occurs prior to event being handled by server + * @param sessionID Players id + */ resetOutput(sessionID: string): void; + /** + * Update output object with most recent values from player profile + * @param sessionId Session id + */ + updateOutputProperties(sessionId: string): void; + /** + * Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true + * @param pmcData Player profile + * @returns dictionary of hideout improvements + */ + protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; + /** + * Return productions from player profile except those completed crafts the client has already seen + * @param pmcData Player profile + * @returns dictionary of hideout productions + */ + protected getProductionsFromProfileAndFlagComplete(productions: Record): Record; } diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/ItemEventRouter.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/ItemEventRouter.d.ts index e80d16c..9c7f70e 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/ItemEventRouter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/ItemEventRouter.d.ts @@ -1,14 +1,22 @@ -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 { ProfileHelper } from "../helpers/ProfileHelper"; +import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; +import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; +import { LocalisationService } from "../services/LocalisationService"; import { EventOutputHolder } from "./EventOutputHolder"; export declare class ItemEventRouter { protected logger: ILogger; protected profileHelper: ProfileHelper; protected itemEventRouters: ItemEventRouterDefinition[]; + protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; - constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder); + constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], localisationService: LocalisationService, eventOutputHolder: EventOutputHolder); + /** + * + * @param info Event request + * @param sessionID Session id + * @returns Item response + */ handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; } diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/CustomizationItemEventRouter.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/CustomizationItemEventRouter.d.ts index e78445e..32519b1 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/CustomizationItemEventRouter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/CustomizationItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { CustomizationCallbacks } from "../../callbacks/CustomizationCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class CustomizationItemEventRouter extends ItemEventRouterDefinition { protected customizationCallbacks: CustomizationCallbacks; constructor(customizationCallbacks: CustomizationCallbacks); diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/HealthItemEventRouter.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/HealthItemEventRouter.d.ts index 99847c6..2b2b91d 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/HealthItemEventRouter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/HealthItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { HealthCallbacks } from "../../callbacks/HealthCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class HealthItemEventRouter extends ItemEventRouterDefinition { protected healthCallbacks: HealthCallbacks; constructor(healthCallbacks: HealthCallbacks); diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/InsuranceItemEventRouter.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/InsuranceItemEventRouter.d.ts index a922cc0..3b6ae8c 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/InsuranceItemEventRouter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/InsuranceItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { InsuranceCallbacks } from "../../callbacks/InsuranceCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class InsuranceItemEventRouter extends ItemEventRouterDefinition { protected insuranceCallbacks: InsuranceCallbacks; constructor(insuranceCallbacks: InsuranceCallbacks); diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/InventoryItemEventRouter.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/InventoryItemEventRouter.d.ts index 953d322..d6a6ae5 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/InventoryItemEventRouter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/InventoryItemEventRouter.d.ts @@ -1,10 +1,12 @@ +import { HideoutCallbacks } from "../../callbacks/HideoutCallbacks"; import { InventoryCallbacks } from "../../callbacks/InventoryCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; import { IPmcData } from "../../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryItemEventRouter extends ItemEventRouterDefinition { protected inventoryCallbacks: InventoryCallbacks; - constructor(inventoryCallbacks: InventoryCallbacks); + protected hideoutCallbacks: HideoutCallbacks; + constructor(inventoryCallbacks: InventoryCallbacks, hideoutCallbacks: HideoutCallbacks); getHandledRoutes(): HandledRoute[]; handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse; } diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/NoteItemEventRouter.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/NoteItemEventRouter.d.ts index 59bf598..71ed5d4 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/NoteItemEventRouter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/NoteItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { NoteCallbacks } from "../../callbacks/NoteCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class NoteItemEventRouter extends ItemEventRouterDefinition { protected noteCallbacks: NoteCallbacks; constructor(noteCallbacks: NoteCallbacks); diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/PresetBuildItemEventRouter.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/PresetBuildItemEventRouter.d.ts index 277db44..f2a7bf3 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/PresetBuildItemEventRouter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/PresetBuildItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { PresetBuildCallbacks } from "../../callbacks/PresetBuildCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class PresetBuildItemEventRouter extends ItemEventRouterDefinition { protected presetBuildCallbacks: PresetBuildCallbacks; constructor(presetBuildCallbacks: PresetBuildCallbacks); diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/RagfairItemEventRouter.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/RagfairItemEventRouter.d.ts index 9216cc5..986d9e7 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/RagfairItemEventRouter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/RagfairItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { RagfairCallbacks } from "../../callbacks/RagfairCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class RagfairItemEventRouter extends ItemEventRouterDefinition { protected ragfairCallbacks: RagfairCallbacks; constructor(ragfairCallbacks: RagfairCallbacks); diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/RepairItemEventRouter.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/RepairItemEventRouter.d.ts index 5196ba9..1c2768c 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/RepairItemEventRouter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/RepairItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { RepairCallbacks } from "../../callbacks/RepairCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class RepairItemEventRouter extends ItemEventRouterDefinition { protected repairCallbacks: RepairCallbacks; constructor(repairCallbacks: RepairCallbacks); diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/TradeItemEventRouter.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/TradeItemEventRouter.d.ts index a43bb0a..5d84559 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/TradeItemEventRouter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/TradeItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { TradeCallbacks } from "../../callbacks/TradeCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class TradeItemEventRouter extends ItemEventRouterDefinition { protected tradeCallbacks: TradeCallbacks; constructor(tradeCallbacks: TradeCallbacks); diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/WishlistItemEventRouter.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/WishlistItemEventRouter.d.ts index 38497fb..9e3c2a0 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/item_events/WishlistItemEventRouter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/item_events/WishlistItemEventRouter.d.ts @@ -1,7 +1,7 @@ -import { IPmcData } from "../../models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; import { WishlistCallbacks } from "../../callbacks/WishlistCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; +import { IPmcData } from "../../models/eft/common/IPmcData"; +import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class WishlistItemEventRouter extends ItemEventRouterDefinition { protected wishlistCallbacks: WishlistCallbacks; constructor(wishlistCallbacks: WishlistCallbacks); diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/save_load/HealthSaveLoadRouter.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/save_load/HealthSaveLoadRouter.d.ts index 114f5b2..26cb07a 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/save_load/HealthSaveLoadRouter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/save_load/HealthSaveLoadRouter.d.ts @@ -1,5 +1,5 @@ -import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; import { HandledRoute, SaveLoadRouter } from "../../di/Router"; +import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; export declare class HealthSaveLoadRouter extends SaveLoadRouter { constructor(); getHandledRoutes(): HandledRoute[]; diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/save_load/InraidSaveLoadRouter.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/save_load/InraidSaveLoadRouter.d.ts index 4c00b40..40f388e 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/save_load/InraidSaveLoadRouter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/save_load/InraidSaveLoadRouter.d.ts @@ -1,5 +1,5 @@ -import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; import { HandledRoute, SaveLoadRouter } from "../../di/Router"; +import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; export declare class InraidSaveLoadRouter extends SaveLoadRouter { constructor(); getHandledRoutes(): HandledRoute[]; diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/save_load/InsuranceSaveLoadRouter.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/save_load/InsuranceSaveLoadRouter.d.ts index 30ce98e..22d645e 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/save_load/InsuranceSaveLoadRouter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/save_load/InsuranceSaveLoadRouter.d.ts @@ -1,5 +1,5 @@ -import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; import { HandledRoute, SaveLoadRouter } from "../../di/Router"; +import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; export declare class InsuranceSaveLoadRouter extends SaveLoadRouter { constructor(); getHandledRoutes(): HandledRoute[]; diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/save_load/ProfileSaveLoadRouter.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/save_load/ProfileSaveLoadRouter.d.ts index 16c7619..f60af15 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/save_load/ProfileSaveLoadRouter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/save_load/ProfileSaveLoadRouter.d.ts @@ -1,5 +1,5 @@ -import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; import { HandledRoute, SaveLoadRouter } from "../../di/Router"; +import { IAkiProfile } from "../../models/eft/profile/IAkiProfile"; export declare class ProfileSaveLoadRouter extends SaveLoadRouter { constructor(); getHandledRoutes(): HandledRoute[]; diff --git a/KcY-SeeItemValue/itemValue/server/types/routers/serializers/ImageSerializer.d.ts b/KcY-SeeItemValue/itemValue/server/types/routers/serializers/ImageSerializer.d.ts index 7f15bcf..5de48ff 100644 --- a/KcY-SeeItemValue/itemValue/server/types/routers/serializers/ImageSerializer.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/routers/serializers/ImageSerializer.d.ts @@ -1,7 +1,7 @@ /// +import { IncomingMessage, ServerResponse } from "http"; import { Serializer } from "../../di/Serializer"; import { ImageRouter } from "../ImageRouter"; -import { IncomingMessage, ServerResponse } from "http"; export declare class ImageSerializer extends Serializer { protected imageRouter: ImageRouter; constructor(imageRouter: ImageRouter); diff --git a/KcY-SeeItemValue/itemValue/server/types/servers/RagfairServer.d.ts b/KcY-SeeItemValue/itemValue/server/types/servers/RagfairServer.d.ts index c93864b..f49654a 100644 --- a/KcY-SeeItemValue/itemValue/server/types/servers/RagfairServer.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/servers/RagfairServer.d.ts @@ -4,6 +4,7 @@ import { TraderHelper } from "../helpers/TraderHelper"; import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { LocalisationService } from "../services/LocalisationService"; import { RagfairCategoriesService } from "../services/RagfairCategoriesService"; import { RagfairOfferService } from "../services/RagfairOfferService"; import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService"; @@ -14,13 +15,14 @@ export declare class RagfairServer { protected ragfairOfferService: RagfairOfferService; protected ragfairCategoriesService: RagfairCategoriesService; protected ragfairRequiredItemsService: RagfairRequiredItemsService; + protected localisationService: LocalisationService; protected traderHelper: TraderHelper; protected traderAssortHelper: TraderAssortHelper; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, traderHelper: TraderHelper, traderAssortHelper: TraderAssortHelper, configServer: ConfigServer); - load(): void; - update(): void; + constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, localisationService: LocalisationService, traderHelper: TraderHelper, traderAssortHelper: TraderAssortHelper, configServer: ConfigServer); + load(): Promise; + update(): Promise; /** * Get traders who need to be periodically refreshed * @returns string array of traders diff --git a/KcY-SeeItemValue/itemValue/server/types/servers/SaveServer.d.ts b/KcY-SeeItemValue/itemValue/server/types/servers/SaveServer.d.ts index 4dca514..402befc 100644 --- a/KcY-SeeItemValue/itemValue/server/types/servers/SaveServer.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/servers/SaveServer.d.ts @@ -14,17 +14,71 @@ export declare class SaveServer { protected logger: ILogger; protected profileFilepath: string; protected profiles: {}; - protected onSave: {}; + protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + /** + * Add callback to occur prior to saving profile changes + * @param id Id for save callback + * @param callback Callback to execute prior to running SaveServer.saveProfile() + */ + addBeforeSaveCallback(id: string, callback: (profile: Partial) => Partial): void; + /** + * Remove a callback from being executed prior to saving profile in SaveServer.saveProfile() + * @param id Id of callback to remove + */ + removeBeforeSaveCallback(id: string): void; + /** + * Load all profiles in /user/profiles folder into memory (this.profiles) + */ load(): void; + /** + * Save changes for each profile from memory into user/profiles json + */ save(): void; + /** + * Get a player profile from memory + * @param sessionId Session id + * @returns IAkiProfile + */ getProfile(sessionId: string): IAkiProfile; + /** + * Get all profiles from memory + * @returns Dictionary of IAkiProfile + */ getProfiles(): Record; + /** + * Delete a profile by id + * @param sessionID Id of profile to remove + * @returns true when deleted, false when profile not found + */ deleteProfileById(sessionID: string): boolean; + /** + * Create a new profile in memory with empty pmc/scav objects + * @param profileInfo Basic profile data + */ createProfile(profileInfo: Info): void; + /** + * Add full profile in memory by key (info.id) + * @param profileDetails Profile to save + */ addProfile(profileDetails: IAkiProfile): void; + /** + * Look up profile json in user/profiles by id and store in memory + * Execute saveLoadRouters callbacks after being loaded into memory + * @param sessionID Id of profile to store in memory + */ loadProfile(sessionID: string): void; + /** + * Save changes from in-memory profile to user/profiles json + * Execute onBeforeSaveCallbacks callbacks prior to being saved to json + * @param sessionID profile id (user/profiles/id.json) + */ saveProfile(sessionID: string): void; + /** + * Remove a physical profile json from user/profiles + * @param sessionID Profile id to remove + * @returns true if file no longer exists + */ removeProfile(sessionID: string): boolean; } diff --git a/KcY-SeeItemValue/itemValue/server/types/servers/http/AkiHttpListener.d.ts b/KcY-SeeItemValue/itemValue/server/types/servers/http/AkiHttpListener.d.ts index acf92aa..d02861e 100644 --- a/KcY-SeeItemValue/itemValue/server/types/servers/http/AkiHttpListener.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/servers/http/AkiHttpListener.d.ts @@ -13,16 +13,18 @@ export declare class AkiHttpListener implements IHttpListener { protected httpRouter: HttpRouter; protected serializers: Serializer[]; protected logger: ILogger; + protected requestsLogger: ILogger; protected jsonUtil: JsonUtil; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; protected httpBufferHandler: HttpBufferHandler; constructor(httpRouter: HttpRouter, // TODO: delay required - serializers: Serializer[], logger: ILogger, jsonUtil: JsonUtil, httpResponse: HttpResponseUtil, localisationService: LocalisationService, httpBufferHandler: HttpBufferHandler); + serializers: Serializer[], logger: ILogger, requestsLogger: ILogger, jsonUtil: JsonUtil, httpResponse: HttpResponseUtil, localisationService: LocalisationService, httpBufferHandler: HttpBufferHandler); canHandle(_: string, req: IncomingMessage): boolean; handle(sessionId: string, req: IncomingMessage, resp: ServerResponse): void; sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void; getResponse(sessionID: string, req: IncomingMessage, body: Buffer): string; - protected getBodyInfo(body: Buffer): string; - sendZlibJson(resp: ServerResponse, output: any, sessionID: string): void; + protected getBodyInfo(body: Buffer): any; + sendJson(resp: ServerResponse, output: string, sessionID: string): void; + sendZlibJson(resp: ServerResponse, output: string, sessionID: string): void; } diff --git a/KcY-SeeItemValue/itemValue/server/types/services/BotEquipmentFilterService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/BotEquipmentFilterService.d.ts index 43e64b0..089cfb5 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/BotEquipmentFilterService.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,6 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; +import { MinMax } from "../models/common/MinMax"; +import { EquipmentChances, Generation, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -24,6 +25,24 @@ export declare class BotEquipmentFilterService { * @param baseValues Values to update */ protected adjustChances(equipmentChanges: Record, baseValues: EquipmentChances | ModsChances): void; + /** + * Iterate over the Generation changes and alter data in baseValues.Generation + * @param generationChanges Changes to apply + * @param baseBotGeneration dictionary to update + */ + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + /** + * Get equipment settings for bot + * @param botEquipmentRole equipment role to return + * @returns EquipmentFilters object + */ + getBotEquipmentSettings(botEquipmentRole: string): EquipmentFilters; + /** + * Get weapon sight whitelist for a specific bot type + * @param botEquipmentRole equipment role of bot to look up + * @returns Dictionary of weapon type and their whitelisted scope types + */ + getBotWeaponSightWhitelist(botEquipmentRole: string): Record; /** * Get an object that contains equipment and cartridge blacklists for a specified bot type * @param botRole Role of the bot we want the blacklist for @@ -39,14 +58,14 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retreive clothing weighting adjustments from bot.json config + * Retrieve clothing weighting adjustments from bot.json config * @param botRole Bot type to get adjustments for * @param playerLevel level of player * @returns Weighting adjustments for bots clothing */ protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; /** - * Retreive item weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config * @param botRole Bot type to get adjustments for * @param playerLevel level of player * @returns Weighting adjustments for bot items @@ -54,7 +73,7 @@ export declare class BotEquipmentFilterService { protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json - * Prioritises whitelist first, if one is found blacklist is ignored + * Prioritizes whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update * @param blacklist equipment blacklist * @returns Filtered bot file @@ -62,10 +81,10 @@ export declare class BotEquipmentFilterService { protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** * Filter bot cartridges based on blacklist and whitelist from config/bot.json - * Prioritises whitelist first, if one is found blacklist is ignored + * Prioritizes whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update * @param blacklist equipment on this list should be excluded from the bot - * @param whitelist equipment on this list should be used exclusivly + * @param whitelist equipment on this list should be used exclusively * @returns Filtered bot file */ protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; diff --git a/KcY-SeeItemValue/itemValue/server/types/services/BotEquipmentModPoolService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/BotEquipmentModPoolService.d.ts new file mode 100644 index 0000000..adf59ff --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/services/BotEquipmentModPoolService.d.ts @@ -0,0 +1,65 @@ +import { ItemHelper } from "../helpers/ItemHelper"; +import { Mods } from "../models/eft/common/tables/IBotType"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { VFS } from "../utils/VFS"; +/** Store a mapping between weapons, their slots and the items that fit those slots */ +export declare class BotEquipmentModPoolService { + protected logger: ILogger; + protected vfs: VFS; + protected itemHelper: ItemHelper; + protected databaseServer: DatabaseServer; + protected configServer: ConfigServer; + protected botConfig: IBotConfig; + protected weaponModPool: Mods; + protected gearModPool: Mods; + protected weaponPoolGenerated: boolean; + protected armorPoolGenerated: boolean; + constructor(logger: ILogger, vfs: VFS, itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer); + /** + * Store dictionary of mods for each item passed in + * @param items items to find related mods and store in modPool + */ + protected generatePool(items: ITemplateItem[], poolType: string): void; + /** + * Empty the mod pool + */ + resetPool(): void; + /** + * Get array of compatible mods for an items mod slot (generate pool if it doesnt exist already) + * @param itemTpl item to look up + * @param slotName slot to get compatible mods for + * @returns tpls that fit the slot + */ + getCompatibleModsForWeaponSlot(itemTpl: string, slotName: string): string[]; + /** + * Get array of compatible mods for an items mod slot (generate pool if it doesnt exist already) + * @param itemTpl item to look up + * @param slotName slot to get compatible mods for + * @returns tpls that fit the slot + */ + getCompatibleModsFoGearSlot(itemTpl: string, slotName: string): string[]; + /** + * Get mods for a piece of gear by its tpl + * @param itemTpl items tpl to look up mods for + * @returns Dictionary of mods (keys are mod slot names) with array of compatible mod tpls as value + */ + getModsForGearSlot(itemTpl: string): Record; + /** + * Get mods for a weapon by its tpl + * @param itemTpl Weapons tpl to look up mods for + * @returns Dictionary of mods (keys are mod slot names) with array of compatible mod tpls as value + */ + getModsForWeaponSlot(itemTpl: string): Record; + /** + * Create weapon mod pool and set generated flag to true + */ + protected generateWeaponPool(): void; + /** + * Create gear mod pool and set generated flag to true + */ + protected generateGearPool(): void; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/services/BotGenerationCacheService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/BotGenerationCacheService.d.ts index 0be0576..a491b03 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/BotGenerationCacheService.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/BotGenerationCacheService.d.ts @@ -3,32 +3,34 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { ILogger } from "../models/spt/utils/ILogger"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { LocalisationService } from "./LocalisationService"; export declare class BotGenerationCacheService { protected logger: ILogger; protected randomUtil: RandomUtil; protected jsonUtil: JsonUtil; + protected localisationService: LocalisationService; protected botHelper: BotHelper; protected storedBots: Map; - constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, botHelper: BotHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, localisationService: LocalisationService, botHelper: BotHelper); /** * Store array of bots in cache, shuffle results before storage * @param botsToStore Bots we want to store in the cache */ - storeBots(botsToStore: IBotBase[]): void; + storeBots(key: string, botsToStore: IBotBase[]): void; /** * Find and return a bot based on its role * Remove bot from internal array so it can't be retreived again - * @param role role to retreive (assault/bossTagilla etc) + * @param key role to retreive (assault/bossTagilla etc) * @returns IBotBase object */ - getBot(role: string): IBotBase; + getBot(key: string): IBotBase; /** * Remove all cached bot profiles */ clearStoredBots(): void; /** - * Does cache have bots - * @returns true if empty + * Does cache have a bot with requested key + * @returns false if empty */ - cacheHasBotOfRole(role: string): boolean; + cacheHasBotOfRole(key: string): boolean; } diff --git a/KcY-SeeItemValue/itemValue/server/types/services/BotLootCacheService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/BotLootCacheService.d.ts index 00ffb9c..dab7c6d 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/BotLootCacheService.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/BotLootCacheService.d.ts @@ -5,15 +5,17 @@ import { BotLootCache, LootCacheType } from "../models/spt/bots/BotLootCache"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { JsonUtil } from "../utils/JsonUtil"; +import { LocalisationService } from "./LocalisationService"; import { RagfairPriceService } from "./RagfairPriceService"; export declare class BotLootCacheService { protected logger: ILogger; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected pmcLootGenerator: PMCLootGenerator; + protected localisationService: LocalisationService; protected ragfairPriceService: RagfairPriceService; protected lootCache: Record; - constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, ragfairPriceService: RagfairPriceService); + constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService); /** * Remove all cached bot loot data */ diff --git a/KcY-SeeItemValue/itemValue/server/types/services/BotWeaponModLimitService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/BotWeaponModLimitService.d.ts new file mode 100644 index 0000000..f8ebc2f --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/services/BotWeaponModLimitService.d.ts @@ -0,0 +1,54 @@ +import { ItemHelper } from "../helpers/ItemHelper"; +import { Item } from "../models/eft/common/tables/IItem"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +export declare class BotModLimits { + scope: ItemCount; + scopeMax: number; + scopeBaseTypes: string[]; + flashlightLaser: ItemCount; + flashlightLaserMax: number; + flashlgihtLaserBaseTypes: string[]; +} +export declare class ItemCount { + count: number; +} +export declare class BotWeaponModLimitService { + protected logger: ILogger; + protected configServer: ConfigServer; + protected itemHelper: ItemHelper; + protected botConfig: IBotConfig; + constructor(logger: ILogger, configServer: ConfigServer, itemHelper: ItemHelper); + /** + * Initalise mod limits to be used when generating a weapon + * @param botRole "assault", "bossTagilla" or "pmc" + * @returns BotModLimits object + */ + getWeaponModLimits(botRole: string): BotModLimits; + /** + * Check if weapon mod item is on limited list + has surpassed the limit set for it + * Exception: Always allow ncstar backup mount + * Exception: Always allow scopes with a scope for a parent + * Exception: Always disallow mounts that hold only scopes once scope limit reached + * Exception: Always disallow mounts that hold only flashlights once flashlight limit reached + * @param botRole role the bot has e.g. assault + * @param modTemplate mods template data + * @param modLimits limits set for weapon being generated for this bot + * @param modsParent The parent of the mod to be checked + * @returns true if over item limit + */ + weaponModHasReachedLimit(botRole: string, modTemplate: ITemplateItem, modLimits: BotModLimits, modsParent: ITemplateItem, weapon: Item[]): boolean; + /** + * Check if the specific item type on the weapon has reached the set limit + * @param modTpl log mod tpl if over type limit + * @param currentCount current number of this item on gun + * @param maxLimit mod limit allowed + * @param botRole role of bot we're checking weapon of + * @returns true if limit reached + */ + protected weaponModLimitReached(modTpl: string, currentCount: { + count: number; + }, maxLimit: number, botRole: string): boolean; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/services/CustomLocationWaveService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/CustomLocationWaveService.d.ts new file mode 100644 index 0000000..7d14f07 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/services/CustomLocationWaveService.d.ts @@ -0,0 +1,42 @@ +import { BossLocationSpawn, Wave } from "../models/eft/common/ILocationBase"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; +export declare class CustomLocationWaveService { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; + protected configServer: ConfigServer; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + /** + * Add a boss wave to a map + * @param locationId e.g. factory4_day, bigmap + * @param waveToAdd Boss wave to add to map + */ + addBossWaveToMap(locationId: string, waveToAdd: BossLocationSpawn): void; + /** + * Add a normal bot wave to a map + * @param locationId e.g. factory4_day, bigmap + * @param waveToAdd Wave to add to map + */ + addNormalWaveToMap(locationId: string, waveToAdd: Wave): void; + /** + * Clear all custom boss waves from a map + * @param locationId e.g. factory4_day, bigmap + */ + clearBossWavesForMap(locationId: string): void; + /** + * Clear all custom normal waves from a map + * @param locationId e.g. factory4_day, bigmap + */ + clearNormalWavesForMap(locationId: string): void; + /** + * Add custom boss and normal waves to maps found in config/location.json to db + */ + applyWaveChangesToAllMaps(): void; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/services/FenceService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/FenceService.d.ts index bdcdeb2..d143380 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/FenceService.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/FenceService.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; -import { FenceLevel } from "../models/eft/common/IGlobals"; +import { FenceLevel, Preset } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; @@ -15,6 +15,7 @@ import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { ItemFilterService } from "./ItemFilterService"; +import { LocalisationService } from "./LocalisationService"; /** * Handle actions surrounding Fence * e.g. generating or refreshing assorts / get next refresh time @@ -30,12 +31,25 @@ export declare class FenceService { protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; protected itemFilterService: ItemFilterService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; + /** Main assorts you see at all rep levels */ protected fenceAssort: ITraderAssort; + /** Assorts shown on a separte tab when you max out fence rep */ + protected fenceDiscountAssort: ITraderAssort; protected traderConfig: ITraderConfig; protected nextMiniRefreshTimestamp: number; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, configServer: ConfigServer); - protected setFenceAssort(fenceAssort: ITraderAssort): void; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Replace main fence assort with new assort + * @param assort New assorts to replace old with + */ + protected setFenceAssort(assort: ITraderAssort): void; + /** + * Replace high rep level fence assort with new assort + * @param assort New assorts to replace old with + */ + protected setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -44,12 +58,27 @@ export declare class FenceService { */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; /** - * Adjust assorts price by a modifier - * @param item - * @param assort - * @param modifier + * Adjust all items contained inside an assort by a multiplier + * @param assort Assort that contains items with prices to adjust + * @param itemMultipler multipler to use on items + * @param presetMultiplier preset multipler to use on presets */ - protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; + protected adjustAssortItemPrices(assort: ITraderAssort, itemMultipler: number, presetMultiplier: number): void; + /** + * Merge two trader assort files together + * @param firstAssort assort 1# + * @param secondAssort assort #2 + * @returns merged assort + */ + protected mergeAssorts(firstAssort: ITraderAssort, secondAssort: ITraderAssort): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item assort item details + * @param assort assort to be modified + * @param modifier value to multiply item price by + * @param presetModifier value to multiply preset price by + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number, presetModifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -78,7 +107,7 @@ export declare class FenceService { /** * Choose an item (not mod) at random and remove from assorts */ - protected removeRandomItemFromAssorts(): void; + protected removeRandomItemFromAssorts(assort: ITraderAssort): void; /** * Get an integer rounded count of items to replace based on percentrage from traderConfig value * @param totalItemCount total item count @@ -91,20 +120,32 @@ export declare class FenceService { */ getOfferCount(): number; /** - * Create a trader assort for fence + * Create trader assorts for fence and store in fenceService cache */ - generateFenceAssortCache(): void; + generateFenceAssorts(): void; /** * Create skeleton to hold assort items * @returns ITraderAssort object */ protected createBaseTraderAssortItem(): ITraderAssort; /** - * Hydrate result parameter object with generated assorts + * Hydrate assorts parameter object with generated assorts * @param assortCount Number of assorts to generate - * @param assorts object to add assorts to + * @param assorts object to add created assorts to */ - protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + protected createAssorts(assortCount: number, assorts: ITraderAssort, loyaltyLevel: number): void; + protected addItemAssorts(assortCount: number, fenceAssortIds: string[], assorts: ITraderAssort, fenceAssort: ITraderAssort, itemTypeCounts: Record, loyaltyLevel: number): void; + /** + * Add preset weapons to fence presets + * @param assortCount how many assorts to add to assorts + * @param defaultWeaponPresets a dictionary of default weapon presets + * @param assorts object to add presets to + * @param loyaltyLevel loyalty level to requre item at + */ + protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/KcY-SeeItemValue/itemValue/server/types/services/InsuranceService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/InsuranceService.d.ts index 6be8a2f..886a298 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/InsuranceService.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/InsuranceService.d.ts @@ -1,4 +1,6 @@ +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; +import { HandbookHelper } from "../helpers/HandbookHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -12,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; +import { LocalisationService } from "./LocalisationService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -21,14 +24,16 @@ export declare class InsuranceService { protected saveServer: SaveServer; protected traderHelper: TraderHelper; protected dialogueHelper: DialogueHelper; + protected handbookHelper: HandbookHelper; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; insuranceTraderArrayExists(sessionId: string, traderId: string): boolean; getInsurance(sessionId: string): Record; - getInsuranceItems(sessionId: string, traderId: string): any[]; + getInsuranceItems(sessionId: string, traderId: string): Item[]; resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; @@ -45,6 +50,13 @@ export declare class InsuranceService { * @param mapId Id of the map player died/exited that caused the insurance to be issued on */ sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; + /** + * Get a timestamp of what insurance items should be sent to player based on the type of trader used to insure + * @param pmcData Player profile + * @param trader Trader used to insure items + * @returns Timestamp to return items to player in seconds + */ + protected getInsuranceReturnTimestamp(pmcData: IPmcData, trader: ITraderBase): number; /** * Store lost gear post-raid inside profile * @param pmcData player profile to store gear in diff --git a/KcY-SeeItemValue/itemValue/server/types/services/ItemBaseClassService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/ItemBaseClassService.d.ts new file mode 100644 index 0000000..d7bc4bc --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/services/ItemBaseClassService.d.ts @@ -0,0 +1,39 @@ +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +/** + * Cache the baseids for each item in the tiems db inside a dictionary + */ +export declare class ItemBaseClassService { + protected logger: ILogger; + protected localisationService: LocalisationService; + protected databaseServer: DatabaseServer; + protected itemBaseClassesCache: Record; + protected cacheGenerated: boolean; + constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); + /** + * Create cache and store inside ItemBaseClassService + */ + hydrateItemBaseClassCache(): void; + /** + * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary + * @param itemIdToUpdate item tpl to store base ids against in dictionary + * @param item item being checked + * @param allDbItems all items in db + */ + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + /** + * Does item tpl inherit from the requested base class + * @param itemTpl item to check base classes of + * @param baseClass base class to check for + * @returns true if item inherits from base class passed in + */ + itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Get base classes item inherits from + * @param itemTpl item to get base classes for + * @returns array of base classes + */ + getItemBaseClasses(itemTpl: string): string[]; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/services/LocaleService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/LocaleService.d.ts index 8275b75..09c658b 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/LocaleService.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/LocaleService.d.ts @@ -1,5 +1,4 @@ import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; -import { ILocaleGlobalBase } from "../models/spt/server/ILocaleBase"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -14,9 +13,9 @@ export declare class LocaleService { constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the eft globals db file based on the configured locale in config/locale.json, if not found, fall back to 'en' - * @returns ILocaleGlobalBase + * @returns dictionary */ - getLocaleDb(): ILocaleGlobalBase; + getLocaleDb(): Record; /** * Gets the game locale key from the locale.json file, * if value is 'system' get system locale diff --git a/KcY-SeeItemValue/itemValue/server/types/services/OpenZoneService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/OpenZoneService.d.ts new file mode 100644 index 0000000..8e70b94 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/services/OpenZoneService.d.ts @@ -0,0 +1,28 @@ +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; +import { LocalisationService } from "./LocalisationService"; +/** Service for adding new zones to a maps OpenZones property */ +export declare class OpenZoneService { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected configServer: ConfigServer; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Add open zone to specified map + * @param locationId map location (e.g. factory4_day) + * @param zoneToAdd zone to add + */ + addZoneToMap(locationId: string, zoneToAdd: string): void; + /** + * Add open zones to all maps found in config/location.json to db + */ + applyZoneChangesToAllMaps(): void; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/services/PaymentService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/PaymentService.d.ts index c9ce95a..ac131ea 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/PaymentService.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/PaymentService.d.ts @@ -25,12 +25,12 @@ export declare class PaymentService { constructor(logger: ILogger, httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, localisationService: LocalisationService, paymentHelper: PaymentHelper); /** * Take money and insert items into return to server request - * @param {Object} pmcData - * @param {Object} body + * @param {IPmcData} pmcData Player profile + * @param {IProcessBuyTradeRequestData} request * @param {string} sessionID * @returns Object */ - payMoney(pmcData: IPmcData, body: IProcessBuyTradeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse; + payMoney(pmcData: IPmcData, request: IProcessBuyTradeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Receive money back after selling * @param {IPmcData} pmcData @@ -60,9 +60,17 @@ export declare class PaymentService { /** * Prioritise player stash first over player inventory * Post-raid healing would often take money out of the players pockets/secure container - * @param a Firsat money stack item + * @param a First money stack item * @param b Second money stack item - * @returns sorted item + * @param inventoryItems players inventory items + * @returns sort order */ - protected moneySort(a: Item, b: Item): number; + protected prioritiseStashSort(a: Item, b: Item, inventoryItems: Item[]): number; + /** + * Recursivly check items parents to see if it is inside the players inventory, not stash + * @param itemId item id to check + * @param inventoryItems player inventory + * @returns true if its in inventory + */ + protected isInInventory(itemId: string, inventoryItems: Item[]): boolean; } diff --git a/KcY-SeeItemValue/itemValue/server/types/services/PlayerService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/PlayerService.d.ts index 2f364d5..1195b93 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/PlayerService.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/PlayerService.d.ts @@ -1,5 +1,4 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { IPlayerIncrementSkillLevelRequestData } from "../models/eft/player/IPlayerIncrementSkillLevelRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "./LocalisationService"; @@ -11,11 +10,10 @@ export declare class PlayerService { /** * increases the profile skill and updates any output * @param {Object} pmcData - * @param {Object} output * @param {String} skillName * @param {Number} amount */ - incrementSkillLevel(pmcData: IPmcData, output: IPlayerIncrementSkillLevelRequestData, skillName: string, amount: number): void; + incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number): void; /** * @param {Object} pmcData * @returns number diff --git a/KcY-SeeItemValue/itemValue/server/types/services/ProfileFixerService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/ProfileFixerService.d.ts index 86a6af8..8d23ebc 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/ProfileFixerService.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/ProfileFixerService.d.ts @@ -7,6 +7,7 @@ import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { HideoutAreas } from "../models/enums/HideoutAreas"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { TimeUtil } from "../utils/TimeUtil"; import { Watermark } from "../utils/Watermark"; import { LocalisationService } from "./LocalisationService"; export declare class ProfileFixerService { @@ -14,8 +15,9 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected localisationService: LocalisationService; + protected timeUtil: TimeUtil; protected databaseServer: DatabaseServer; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -32,6 +34,8 @@ export declare class ProfileFixerService { * @param pmcProfile profile to remove old counters from */ removeDanglingConditionCounters(pmcProfile: IPmcData): void; + addLighthouseKeeperIfMissing(pmcProfile: IPmcData): void; + protected addUnlockedInfoObjectIfMissing(pmcProfile: IPmcData): void; protected removeDanglingBackendCounters(pmcProfile: IPmcData): void; protected getActiveRepeatableQuests(repeatableQuests: IPmcDataRepeatableQuest[]): IRepeatableQuest[]; protected fixNullTraderSalesSums(pmcProfile: IPmcData): void; @@ -45,6 +49,11 @@ export declare class ProfileFixerService { protected updateProfileQuestDataValues(pmcProfile: IPmcData): void; protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void; protected addMissingWorkbenchWeaponSkills(pmcProfile: IPmcData): void; + /** + * Some profiles have hideout maxed and therefore no improvements + * @param pmcProfile Profile to add improvement data to + */ + protected addMissingWallImprovements(pmcProfile: IPmcData): void; /** * A new property was added to slot items "locationIndex", if this is missing, the hideout slot item must be removed * @param pmcProfile Profile to find and remove slots from @@ -85,4 +94,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(pmcProfile: IPmcData): void; + /** + * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 + * @param pmcProfile profile to update + */ + addMissingUpgradesPropertyToHideout(pmcProfile: IPmcData): void; + /** + * Iterate over associated profile template and check all hideout areas exist, add if not + * @param fullProfile Profile to update + */ + addMissingHideoutAreasToProfile(fullProfile: IAkiProfile): void; + /** + * These used to be used for storing scav case rewards, rewards are now generated on pickup + * @param pmcProfile Profile to update + */ + removeLegacyScavCaseProductionCrafts(pmcProfile: IPmcData): void; } diff --git a/KcY-SeeItemValue/itemValue/server/types/services/RagfairLinkedItemService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/RagfairLinkedItemService.d.ts index 6c34ee0..51511f9 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/RagfairLinkedItemService.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/RagfairLinkedItemService.d.ts @@ -1,10 +1,21 @@ -import { DatabaseServer } from "../servers/DatabaseServer"; +import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { DatabaseServer } from "../servers/DatabaseServer"; export declare class RagfairLinkedItemService { protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected linkedItemsCache: Record>; - constructor(databaseServer: DatabaseServer); + constructor(databaseServer: DatabaseServer, itemHelper: ItemHelper); getLinkedItems(linkedSearchId: string): Iterable; + /** + * Create Dictionary of every item and the items associated with it + */ protected buildLinkedItemTable(): void; + /** + * Add ammo to revolvers linked item dictionary + * @param cylinder Revolvers cylinder + * @param applyLinkedItems + */ + protected addRevolverCylinderAmmoToLinkedItems(cylinder: ITemplateItem, applyLinkedItems: (items: string[]) => void): void; protected getFilters(item: ITemplateItem, slot: string): string[]; } diff --git a/KcY-SeeItemValue/itemValue/server/types/services/RagfairOfferService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/RagfairOfferService.d.ts index 86c1e52..fc08d39 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/RagfairOfferService.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/RagfairOfferService.d.ts @@ -10,6 +10,7 @@ import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { RagfairOfferHolder } from "../utils/RagfairOfferHolder"; import { TimeUtil } from "../utils/TimeUtil"; import { LocalisationService } from "./LocalisationService"; import { RagfairCategoriesService } from "./RagfairCategoriesService"; @@ -26,10 +27,9 @@ export declare class RagfairOfferService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected playerOffersLoaded: boolean; - protected expiredOffers: Item[]; - /** offerId, offer */ - protected offers: Record; + protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; + protected ragfairOfferHandler: RagfairOfferHolder; constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers @@ -45,7 +45,7 @@ export declare class RagfairOfferService { * Get an array of expired items not yet processed into new offers * @returns items that need to be turned into offers */ - getExpiredOffers(): Item[]; + getExpiredOfferItems(): Item[]; resetExpiredOffers(): void; /** * Does the offer exist on the ragfair @@ -53,8 +53,17 @@ export declare class RagfairOfferService { * @returns offer exists - true */ doesOfferExist(offerId: string): boolean; + /** + * Remove an offer from ragfair by offer id + * @param offerId Offer id to remove + */ removeOfferById(offerId: string): void; - removeOfferStack(offerID: string, amount: number): void; + /** + * Reduce size of an offer stack by specified amount + * @param offerId Offer to adjust stack size of + * @param amount How much to deduct from offers stack size + */ + removeOfferStack(offerId: string, amount: number): void; removeAllOffersByTrader(traderId: string): void; /** * Do the trader offers on flea need to be refreshed @@ -65,11 +74,9 @@ export declare class RagfairOfferService { addPlayerOffers(): void; expireStaleOffers(): void; /** - * Get an array of stale offers that are still shown to player - * @returns IRagfairOffer array + * Remove stale offer from flea + * @param staleOffer Stale offer to process */ - protected getStaleOffers(): IRagfairOffer[]; - protected isStale(offer: IRagfairOffer, time: number): boolean; protected processStaleOffer(staleOffer: IRagfairOffer): void; protected returnPlayerOffer(offer: IRagfairOffer): IItemEventRouterResponse; } diff --git a/KcY-SeeItemValue/itemValue/server/types/services/RagfairPriceService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/RagfairPriceService.d.ts index 4ac7794..8b68bc4 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/RagfairPriceService.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/RagfairPriceService.d.ts @@ -1,6 +1,8 @@ +import { OnLoad } from "../di/OnLoad"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; @@ -10,29 +12,38 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { RandomUtil } from "../utils/RandomUtil"; -import { OnLoad } from "../di/OnLoad"; +/** + * Stores flea prices for items as well as methods to interact with them + */ export declare class RagfairPriceService implements OnLoad { protected handbookHelper: HandbookHelper; protected databaseServer: DatabaseServer; protected logger: ILogger; protected itemHelper: ItemHelper; protected presetHelper: PresetHelper; + protected traderHelper: TraderHelper; 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; + constructor(handbookHelper: HandbookHelper, databaseServer: DatabaseServer, logger: ILogger, itemHelper: ItemHelper, presetHelper: PresetHelper, traderHelper: TraderHelper, randomUtil: RandomUtil, configServer: ConfigServer); + /** + * Generate static (handbook) and dynamic (prices.json) flea prices, store inside class as dictionaries + */ + onLoad(): Promise; getRoute(): string; /** * Iterate over all items of type "Item" in db and get template price, store in cache */ generateStaticPrices(): void; + /** + * Create a dictionary and store prices from prices.json in it + */ protected generateDynamicPrices(): void; /** - * Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value. + * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 * @param tplId Item tpl id to get price for * @returns price in roubles @@ -51,7 +62,12 @@ export declare class RagfairPriceService implements OnLoad { * @returns price in roubles */ getStaticPriceForItem(itemTpl: string): number; + /** + * Get prices for all items on flea, priorities dynamic prices from prices.json, use handbook prices if missing + * @returns Dictionary of item tpls and rouble cost + */ getAllFleaPrices(): Record; + getAllStaticPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a @@ -59,7 +75,18 @@ export declare class RagfairPriceService implements OnLoad { * @returns different in percent */ protected getPriceDifference(a: number, b: number): number; + /** + * Get the rouble price for an assorts barter scheme + * @param barterScheme + * @returns Rouble price + */ getBarterPrice(barterScheme: IBarterScheme[]): number; + /** + * Generate a currency cost for an item and its mods + * @param items Item with mods to get price for + * @param desiredCurrency Currency price desired in + * @returns cost of item in desired currency + */ 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 @@ -83,11 +110,20 @@ export declare class RagfairPriceService implements OnLoad { * @returns */ protected getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Get the highest price for an item that is stored in handbook or trader assorts + * @param itemTpl Item to get highest price of + * @returns rouble cost + */ + protected getHighestHandbookOrTraderPriceAsRouble(itemTpl: string): number; /** * Attempt to get the default preset for a weapon, failing that get the first preset in the array * (assumes default = has encyclopedia entry) * @param presets weapon presets to choose from * @returns Default preset object */ - protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; + protected getWeaponPreset(presets: Preset[], weapon: Item): { + isDefault: boolean; + preset: Preset; + }; } diff --git a/KcY-SeeItemValue/itemValue/server/types/services/RagfairRequiredItemsService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/RagfairRequiredItemsService.d.ts index b05fc65..95c3ddb 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/RagfairRequiredItemsService.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/RagfairRequiredItemsService.d.ts @@ -7,6 +7,6 @@ export declare class RagfairRequiredItemsService { protected ragfairOfferService: RagfairOfferService; protected requiredItemsCache: {}; constructor(logger: ILogger, paymentHelper: PaymentHelper, ragfairOfferService: RagfairOfferService); - getRequiredItems(searchId: string): any; + getRequiredItemsById(searchId: string): any; buildRequiredItemTable(): void; } diff --git a/KcY-SeeItemValue/itemValue/server/types/services/RepairService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/RepairService.d.ts index d3f1b35..a3c6c7a 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/RepairService.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/RepairService.d.ts @@ -1,27 +1,33 @@ +import { ItemHelper } from "../helpers/ItemHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { RepairHelper } from "../helpers/RepairHelper"; import { TraderHelper } from "../helpers/TraderHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; -import { IRepairConfig } from "../models/spt/config/IRepairConfig"; +import { BonusSettings, IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; + protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected paymentService: PaymentService; protected repairHelper: RepairHelper; protected configServer: ConfigServer; - repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + protected repairConfig: IRepairConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -46,9 +52,8 @@ export declare class RepairService { * @param sessionId Session id * @param repairDetails details of item repaired, cost/item * @param pmcData Profile to add points to - * @param output IItemEventRouterResponse */ - addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData, output: IItemEventRouterResponse): void; + addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; /** * * @param sessionId Session id @@ -59,15 +64,65 @@ export declare class RepairService { * @returns Details of repair, item/price */ repairItemByKit(sessionId: string, pmcData: IPmcData, repairKits: RepairKitsInfo[], itemToRepairId: string, output: IItemEventRouterResponse): RepairDetails; + /** + * Calculate value repairkit points need to be divided by to get the durability points to be added to an item + * @param itemToRepairDetails Item to repair details + * @param isArmor Is the item being repaired armor + * @param pmcData Player profile + * @returns Number to divide kit points by + */ + protected getKitDivisor(itemToRepairDetails: ITemplateItem, isArmor: boolean, pmcData: IPmcData): number; + /** + * Get the bonus multiplier for a skill from a player profile + * @param skillBonusName Name of bonus to get multipler of + * @param pmcData Player profile to look in for skill + * @returns Multiplier value + */ + protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db * @param repairKitInInventory Repair kit to update */ protected addMaxResourceToKitIfMissing(repairKitDetails: ITemplateItem, repairKitInInventory: Item): void; + /** + * Chance to apply buff to an item (Armor/weapon) if repaired by armor kit + * @param repairDetails Repair details of item + * @param pmcData Player profile + */ + addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Add buff to item + * @param itemConfig weapon/armor config + * @param repairDetails Details for item to repair + */ + protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + /** + * Check if item should be buffed by checking the item type and relevant player skill level + * @param repairDetails Item that was repaired + * @param itemTpl tpl of item to be buffed + * @param pmcData Player profile + * @returns True if item should have buff applied + */ + protected shouldBuffItem(repairDetails: RepairDetails, pmcData: IPmcData): boolean; + /** + * Based on item, what underlying skill does this item use for buff settings + * @param itemTemplate Item to check for skill + * @returns Skill name + */ + protected getItemSkillType(itemTemplate: ITemplateItem): string; + /** + * Ensure multiplier is between 1 and 0.01 + * @param receiveDurabilityMaxPercent Max durabiltiy percent + * @param receiveDurabilityPercent current durability percent + * @returns durability multipler value + */ + protected getDurabilityMultiplier(receiveDurabilityMaxPercent: number, receiveDurabilityPercent: number): number; } export declare class RepairDetails { repairCost?: number; repairedItem: Item; repairedItemIsArmor: boolean; + repairAmount: number; + repairedByKit: boolean; } diff --git a/KcY-SeeItemValue/itemValue/server/types/services/SeasonalEventService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/SeasonalEventService.d.ts new file mode 100644 index 0000000..7474018 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/services/SeasonalEventService.d.ts @@ -0,0 +1,114 @@ +import { BotHelper } from "../helpers/BotHelper"; +import { Config } from "../models/eft/common/IGlobals"; +import { Inventory } from "../models/eft/common/tables/IBotType"; +import { ISeasonalEvent, ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; +import { LocalisationService } from "./LocalisationService"; +export declare class SeasonalEventService { + protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected localisationService: LocalisationService; + protected botHelper: BotHelper; + protected configServer: ConfigServer; + protected seasonalEventConfig: ISeasonalEventConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); + protected get events(): Record; + protected get christmasEventItems(): string[]; + protected get halloweenEventItems(): string[]; + /** + * Get an array of christmas items found in bots inventories as loot + * @returns array + */ + getChristmasEventItems(): string[]; + /** + * Get an array of halloween items found in bots inventories as loot + * @returns array + */ + getHalloweenEventItems(): string[]; + itemIsChristmasRelated(itemTpl: string): boolean; + itemIsHalloweenRelated(itemTpl: string): boolean; + /** + * Check if item id exists in christmas or halloween event arrays + * @param itemTpl item tpl to check for + * @returns + */ + itemIsSeasonalRelated(itemTpl: string): boolean; + /** + * Get an array of items that appear during a seasonal event + * returns multiple seasonal event items if they are both active + * @returns array of tpl strings + */ + getAllSeasonalEventItems(): string[]; + /** + * Get an array of seasonal items that should be blocked as seasonal is not active + * @returns Array of tpl strings + */ + getSeasonalEventItemsToBlock(): string[]; + /** + * Is a seasonal event currently active + * @returns true if event is active + */ + seasonalEventEnabled(): boolean; + /** + * is christmas event active + * @returns true if active + */ + christmasEventEnabled(): boolean; + /** + * is christmas event active + * @returns true if active + */ + halloweenEventEnabled(): boolean; + /** + * Is detection of seasonal events enabled (halloween / christmas) + * @returns true if seasonal events should be checked for + */ + isAutomaticEventDetectionEnabled(): boolean; + /** + * Get a dictionary of gear changes to apply to bots for a specific event e.g. Christmas/Halloween + * @param eventName Name of event to get gear changes for + * @returns bots with equipment changes + */ + protected getEventBotGear(eventName: string): Record>>; + /** + * Get the dates each seasonal event starts and ends at + * @returns Record with event name + start/end date + */ + getEventDetails(): ISeasonalEvent[]; + /** + * Check if current date falls inside any of the seasons events pased in, if so, handle them + */ + checkForAndEnableSeasonalEvents(): void; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in SeasonalEventService) + * @param nodeInventory Bots inventory to iterate over + * @param botRole the role of the bot being processed + */ + removeChristmasItemsFromBotInventory(nodeInventory: Inventory, botRole: string): void; + /** + * Make adjusted to server code based on the name of the event passed in + * @param globalConfig globals.json + * @param eventName Name of the event to enable. e.g. Christmas + */ + protected updateGlobalEvents(globalConfig: Config, eventName: string): void; + /** + * Add lootble items from backpack into patrol.ITEMS_TO_DROP difficulty property + */ + protected addLootItemsToGifterDropItemsList(): void; + /** + * Read in data from seasonalEvents.json and add found equipment items to bots + * @param eventName Name of the event to read equipment in from config + */ + protected addEventGearToBots(eventName: string): void; + protected addPumpkinsToScavBackpacks(): void; + /** + * Set Khorovod(dancing tree) chance to 100% on all maps that support it + */ + protected enableDancingTree(): void; + /** + * Add santa to maps + */ + protected addGifterBotToMaps(): void; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/services/TraderPurchasePersisterService.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/TraderPurchasePersisterService.d.ts new file mode 100644 index 0000000..7e7c88f --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/services/TraderPurchasePersisterService.d.ts @@ -0,0 +1,34 @@ +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { TraderPurchaseData } from "../models/eft/profile/IAkiProfile"; +import { ITraderConfig } from "../models/spt/config/ITraderConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +import { TimeUtil } from "../utils/TimeUtil"; +/** + * Help with storing limited item purchases from traders in profile to persist them over server restarts + */ +export declare class TraderPurchasePersisterService { + protected logger: ILogger; + protected timeUtil: TimeUtil; + protected profileHelper: ProfileHelper; + protected configServer: ConfigServer; + protected traderConfig: ITraderConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, profileHelper: ProfileHelper, configServer: ConfigServer); + /** + * Get the purchases made from a trader for this profile before the last trader reset + * @param sessionId Session id + * @param traderId Trader to loop up purchases for + * @returns Dict of assort id and count purchased + */ + getProfileTraderPurchases(sessionId: string, traderId: string): Record; + /** + * Remove all trader purchase records from all profiles that exist + * @param traderId Traders id + */ + resetTraderPurchasesStoredInProfile(traderId: string): void; + /** + * Iterate over all server profiles and remove specific trader purchase data that has passed the trader refesh time + * @param traderId Trader id + */ + removeStalePurchasesFromProfiles(traderId: string): void; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/services/mod/onLoad/OnLoadMod.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/mod/onLoad/OnLoadMod.d.ts index 53fb062..a4b58b5 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/mod/onLoad/OnLoadMod.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/mod/onLoad/OnLoadMod.d.ts @@ -1,8 +1,8 @@ import { OnLoad } from "../../../di/OnLoad"; -export declare class OnLoadMod extends OnLoad { +export declare class OnLoadMod implements OnLoad { private onLoadOverride; private getRouteOverride; constructor(onLoadOverride: () => void, getRouteOverride: () => string); - onLoad(): void; + onLoad(): Promise; getRoute(): string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/services/mod/onUpdate/OnUpdateMod.d.ts b/KcY-SeeItemValue/itemValue/server/types/services/mod/onUpdate/OnUpdateMod.d.ts index ee89043..8dfe6dd 100644 --- a/KcY-SeeItemValue/itemValue/server/types/services/mod/onUpdate/OnUpdateMod.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/services/mod/onUpdate/OnUpdateMod.d.ts @@ -1,8 +1,8 @@ import { OnUpdate } from "../../../di/OnUpdate"; -export declare class OnUpdateMod extends OnUpdate { +export declare class OnUpdateMod implements OnUpdate { private onUpdateOverride; private getRouteOverride; constructor(onUpdateOverride: (timeSinceLastRun: number) => boolean, getRouteOverride: () => string); - onUpdate(timeSinceLastRun: number): boolean; + onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/App.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/App.d.ts index cc8a5af..b947c83 100644 --- a/KcY-SeeItemValue/itemValue/server/types/utils/App.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/utils/App.d.ts @@ -11,7 +11,7 @@ export declare class App { protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); - load(): void; - protected update(onUpdateComponents: OnUpdate[]): void; + load(): Promise; + protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; } diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/DatabaseImporter.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/DatabaseImporter.d.ts index 31670ae..c09d63a 100644 --- a/KcY-SeeItemValue/itemValue/server/types/utils/DatabaseImporter.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/utils/DatabaseImporter.d.ts @@ -1,26 +1,35 @@ import { OnLoad } from "../di/OnLoad"; -import { IDatabaseTables } from "../models/spt/server/IDatabaseTables"; import { ILogger } from "../models/spt/utils/ILogger"; import { ImageRouter } from "../routers/ImageRouter"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; +import { EncodingUtil } from "./EncodingUtil"; +import { HashUtil } from "./HashUtil"; +import { ImporterUtil } from "./ImporterUtil"; import { JsonUtil } from "./JsonUtil"; import { VFS } from "./VFS"; -export declare class DatabaseImporter extends OnLoad { +export declare class DatabaseImporter implements OnLoad { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected imageRouter: ImageRouter; - constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, localisationService: LocalisationService, databaseServer: DatabaseServer, imageRouter: ImageRouter); - onLoad(): void; + protected encodingUtil: EncodingUtil; + protected hashUtil: HashUtil; + protected importerUtil: ImporterUtil; + private hashedFile; + private valid; + private filepath; + constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, localisationService: LocalisationService, databaseServer: DatabaseServer, imageRouter: ImageRouter, encodingUtil: EncodingUtil, hashUtil: HashUtil, importerUtil: ImporterUtil); + onLoad(): Promise; /** * Read all json files in database folder and map into a json object * @param filepath path to database folder */ - protected hydrateDatabase(filepath: string): void; + protected hydrateDatabase(filepath: string): Promise; + private onReadValidate; getRoute(): string; - loadRecursive(filepath: string): IDatabaseTables; + private validateFile; loadImages(filepath: string): void; } diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/EncodingUtil.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/EncodingUtil.d.ts new file mode 100644 index 0000000..dabb97a --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/utils/EncodingUtil.d.ts @@ -0,0 +1,15 @@ +export declare class EncodingUtil { + encode(value: string, encode: EncodeType): string; + decode(value: string, encode: EncodeType): string; + fromBase64(value: string): string; + toBase64(value: string): string; + fromHex(value: string): string; + toHex(value: string): string; +} +export declare enum EncodeType { + BASE64 = "base64", + HEX = "hex", + ASCII = "ascii", + BINARY = "binary", + UTF8 = "utf8" +} diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/ImporterUtil.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/ImporterUtil.d.ts new file mode 100644 index 0000000..75aaf54 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/utils/ImporterUtil.d.ts @@ -0,0 +1,21 @@ +import { JsonUtil } from "./JsonUtil"; +import { VFS } from "./VFS"; +export declare class ImporterUtil { + protected vfs: VFS; + protected jsonUtil: JsonUtil; + constructor(vfs: VFS, jsonUtil: JsonUtil); + /** + * Load files into js objects recursively (asynchronous) + * @param filepath Path to folder with files + * @returns Promise return T type associated with this class + */ + loadRecursiveAsync(filepath: string, onReadCallback?: (fileWithPath: string, data: string) => void, onObjectDeserialized?: (fileWithPath: string, object: any) => void): Promise; + /** + * Load files into js objects recursively (synchronous) + * @param filepath Path to folder with files + * @returns + */ + loadRecursive(filepath: string, onReadCallback?: (fileWithPath: string, data: string) => void, onObjectDeserialized?: (fileWithPath: string, object: any) => void): T; + loadAsync(filepath: string, strippablePath?: string, onReadCallback?: (fileWithPath: string, data: string) => void, onObjectDeserialized?: (fileWithPath: string, object: any) => void): Promise; + protected placeObject(fileDeserialized: any, strippedFilePath: string, result: T, strippablePath: string): void; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/JsonUtil.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/JsonUtil.d.ts index 71e95f6..229dc26 100644 --- a/KcY-SeeItemValue/itemValue/server/types/utils/JsonUtil.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/utils/JsonUtil.d.ts @@ -6,6 +6,7 @@ export declare class JsonUtil { protected hashUtil: HashUtil; protected logger: ILogger; protected fileHashes: any; + protected jsonCacheExists: boolean; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string @@ -13,13 +14,14 @@ export declare class JsonUtil { * @param prettify Should output be prettified? * @returns string */ - serialize(data: any, prettify?: boolean): string; + serialize(data: T, prettify?: boolean): string; /** * From string to object * @param jsonString json string to turn into object * @returns object */ - deserialize(jsonString: string): any; - deserializeWithCacheCheck(jsonString: string, filePath: string): string; + deserialize(jsonString: string, filename?: string): T; + deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + deserializeWithCacheCheck(jsonString: string, filePath: string): T; clone(data: T): T; } diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/RagfairOfferHolder.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/RagfairOfferHolder.d.ts new file mode 100644 index 0000000..46d9e23 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/utils/RagfairOfferHolder.d.ts @@ -0,0 +1,24 @@ +import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; +export declare class RagfairOfferHolder { + private offersById; + private offersByTemplate; + private offersByTrader; + constructor(); + getOfferById(id: string): IRagfairOffer; + getOffersByTemplate(templateId: string): Array; + getOffersByTrader(traderId: string): Array; + getOffers(): Array; + addOffers(offers: Array): void; + addOffer(offer: IRagfairOffer): void; + removeOffer(offer: IRagfairOffer): void; + removeOffers(offers: Array): void; + removeOfferByTrader(traderId: string): void; + /** + * Get an array of stale offers that are still shown to player + * @returns IRagfairOffer array + */ + getStaleOffers(time: number): Array; + private addOfferByTemplates; + private addOfferByTrader; + protected isStale(offer: IRagfairOffer, time: number): boolean; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/RandomUtil.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/RandomUtil.d.ts index aa556e3..fc0b05d 100644 --- a/KcY-SeeItemValue/itemValue/server/types/utils/RandomUtil.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/utils/RandomUtil.d.ts @@ -110,6 +110,7 @@ export declare class RandomUtil { getIntEx(max: number): number; getFloat(min: number, max: number): number; getBool(): boolean; + getPercentOfValue(percent: number, number: number, toFixed?: number): number; /** * Check if number passes a check out of 100 * @param chancePercent value check needs to be above diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/UUidGenerator.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/UUidGenerator.d.ts index 000b719..ed1ffa6 100644 --- a/KcY-SeeItemValue/itemValue/server/types/utils/UUidGenerator.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/utils/UUidGenerator.d.ts @@ -1,4 +1,4 @@ import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator"; export declare class UUidGenerator implements IUUidGenerator { - generate: () => string; + generate(): string; } diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/VFS.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/VFS.d.ts index e5eaf02..267b10f 100644 --- a/KcY-SeeItemValue/itemValue/server/types/utils/VFS.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/utils/VFS.d.ts @@ -1,7 +1,7 @@ /// /// -import "reflect-metadata"; import fs from "fs"; +import "reflect-metadata"; import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue"; import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator"; export declare class VFS { @@ -32,8 +32,9 @@ export declare class VFS { createDirAsync(filepath: string): Promise; copyDir(filepath: string, target: string, fileExtensions?: string | string[]): void; copyDirAsync(filepath: string, target: string, fileExtensions: string | string[]): Promise; - readFile(filepath: string): any; - readFileAsync(filepath: string): Promise; + readFile(...args: Parameters): string; + readFileAsync(path: fs.PathLike): Promise; + private isBuffer; writeFile(filepath: any, data?: string, append?: boolean, atomic?: boolean): void; writeFileAsync(filepath: any, data?: string, append?: boolean, atomic?: boolean): Promise; getFiles(filepath: string): string[]; diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/Watermark.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/Watermark.d.ts index e02eba2..f870cf1 100644 --- a/KcY-SeeItemValue/itemValue/server/types/utils/Watermark.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/utils/Watermark.d.ts @@ -30,7 +30,11 @@ export declare class Watermark { * @returns string */ getVersionTag(withEftVersion?: boolean): string; - getVersionLabel(): string; + /** + * Get text shown in game on screen, can't be translated as it breaks bsgs client when certian characters are used + * @returns string + */ + getInGameVersionLabel(): string; /** Set window title */ setTitle(): void; /** Reset console cursor to top */ diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/collections/queue/Queue.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/collections/queue/Queue.d.ts new file mode 100644 index 0000000..645d462 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/utils/collections/queue/Queue.d.ts @@ -0,0 +1,12 @@ +export declare class Queue { + private elements; + private head; + private tail; + constructor(); + enqueue(element: T): void; + enqueueAll(elements: T[]): void; + dequeue(): T; + peek(): T; + getLength(): number; + isEmpty(): boolean; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/decorators/Singleton.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/decorators/Singleton.d.ts deleted file mode 100644 index 7e89026..0000000 --- a/KcY-SeeItemValue/itemValue/server/types/utils/decorators/Singleton.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type constructor from "./constructor"; -import { InjectionToken } from "tsyringe"; -declare function singleton(token?: InjectionToken): (target: constructor) => void; -export default singleton; diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/decorators/constructor.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/decorators/constructor.d.ts deleted file mode 100644 index 416f354..0000000 --- a/KcY-SeeItemValue/itemValue/server/types/utils/decorators/constructor.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare type constructor = { - new (...args: any[]): T; -}; -export default constructor; diff --git a/Faupi-MunitionsExpert/server/types/utils/Logger.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/logging/AbstractWinstonLogger.d.ts similarity index 70% rename from Faupi-MunitionsExpert/server/types/utils/Logger.d.ts rename to KcY-SeeItemValue/itemValue/server/types/utils/logging/AbstractWinstonLogger.d.ts index 1088701..1ae1100 100644 --- a/Faupi-MunitionsExpert/server/types/utils/Logger.d.ts +++ b/KcY-SeeItemValue/itemValue/server/types/utils/logging/AbstractWinstonLogger.d.ts @@ -1,19 +1,17 @@ /// import fs from "fs"; import winston from "winston"; -import { Daum } from "../models/eft/itemEvent/IItemEventRouterRequest"; -import { LogBackgroundColor } from "../models/spt/logging/LogBackgroundColor"; -import { LogTextColor } from "../models/spt/logging/LogTextColor"; -import { SptLogger } from "../models/spt/logging/SptLogger"; -import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue"; -import { ILogger } from "../models/spt/utils/ILogger"; -import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator"; -export declare class WinstonLogger implements ILogger { +import { Daum } from "../../models/eft/itemEvent/IItemEventRouterRequest"; +import { LogBackgroundColor } from "../../models/spt/logging/LogBackgroundColor"; +import { LogTextColor } from "../../models/spt/logging/LogTextColor"; +import { SptLogger } from "../../models/spt/logging/SptLogger"; +import { IAsyncQueue } from "../../models/spt/utils/IAsyncQueue"; +import { ILogger } from "../../models/spt/utils/ILogger"; +import { IUUidGenerator } from "../../models/spt/utils/IUuidGenerator"; +export declare abstract class AbstractWinstonLogger implements ILogger { protected asyncQueue: IAsyncQueue; protected uuidGenerator: IUUidGenerator; protected showDebugInConsole: boolean; - protected folderPath: string; - protected file: string; protected filePath: string; protected logLevels: { levels: { @@ -47,6 +45,13 @@ export declare class WinstonLogger implements ILogger { protected logger: winston.Logger & SptLogger; protected writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator); + protected abstract isLogToFile(): boolean; + protected abstract isLogToConsole(): boolean; + protected abstract isLogExceptions(): boolean; + protected abstract getFilePath(): string; + protected abstract getFileName(): string; + protected getLogMaxSize(): string; + protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; log(data: string | Error | Record, color: string, backgroundColor?: string): Promise; error(data: string | Record): Promise; diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/logging/WinstonMainLogger.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/logging/WinstonMainLogger.d.ts new file mode 100644 index 0000000..3c67902 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/utils/logging/WinstonMainLogger.d.ts @@ -0,0 +1,13 @@ +import { IAsyncQueue } from "../../models/spt/utils/IAsyncQueue"; +import { IUUidGenerator } from "../../models/spt/utils/IUuidGenerator"; +import { AbstractWinstonLogger } from "./AbstractWinstonLogger"; +export declare class WinstonMainLogger extends AbstractWinstonLogger { + protected asyncQueue: IAsyncQueue; + protected uuidGenerator: IUUidGenerator; + constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator); + protected isLogExceptions(): boolean; + protected isLogToFile(): boolean; + protected isLogToConsole(): boolean; + protected getFilePath(): string; + protected getFileName(): string; +} diff --git a/KcY-SeeItemValue/itemValue/server/types/utils/logging/WinstonRequestLogger.d.ts b/KcY-SeeItemValue/itemValue/server/types/utils/logging/WinstonRequestLogger.d.ts new file mode 100644 index 0000000..1475e43 --- /dev/null +++ b/KcY-SeeItemValue/itemValue/server/types/utils/logging/WinstonRequestLogger.d.ts @@ -0,0 +1,14 @@ +import { IAsyncQueue } from "../../models/spt/utils/IAsyncQueue"; +import { IUUidGenerator } from "../../models/spt/utils/IUuidGenerator"; +import { AbstractWinstonLogger } from "./AbstractWinstonLogger"; +export declare class WinstonRequestLogger extends AbstractWinstonLogger { + protected asyncQueue: IAsyncQueue; + protected uuidGenerator: IUUidGenerator; + constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator); + protected isLogExceptions(): boolean; + protected isLogToFile(): boolean; + protected isLogToConsole(): boolean; + protected getFilePath(): string; + protected getFileName(): string; + protected getLogMaxSize(): string; +} diff --git a/Shared/AKI/Aki.Build.dll b/Shared/AKI/Aki.Build.dll index 4ca7da5..6a13b4e 100644 Binary files a/Shared/AKI/Aki.Build.dll and b/Shared/AKI/Aki.Build.dll differ diff --git a/Shared/AKI/Aki.Common.dll b/Shared/AKI/Aki.Common.dll index 809b55e..323306d 100644 Binary files a/Shared/AKI/Aki.Common.dll and b/Shared/AKI/Aki.Common.dll differ diff --git a/Shared/AKI/Aki.Reflection.dll b/Shared/AKI/Aki.Reflection.dll index 0cc7b51..6c66482 100644 Binary files a/Shared/AKI/Aki.Reflection.dll and b/Shared/AKI/Aki.Reflection.dll differ diff --git a/Shared/BepInEx/BepInEx.dll b/Shared/BepInEx/BepInEx.dll index 8aedff0..2fb6c0d 100644 Binary files a/Shared/BepInEx/BepInEx.dll and b/Shared/BepInEx/BepInEx.dll differ diff --git a/Shared/EFT/Accessibility.dll b/Shared/EFT/Accessibility.dll index 43b0fd5..fea493a 100644 Binary files a/Shared/EFT/Accessibility.dll and b/Shared/EFT/Accessibility.dll differ diff --git a/Shared/EFT/Aki.Build.dll b/Shared/EFT/Aki.Build.dll new file mode 100644 index 0000000..0edabf8 Binary files /dev/null and b/Shared/EFT/Aki.Build.dll differ diff --git a/Shared/EFT/Aki.Common.dll b/Shared/EFT/Aki.Common.dll new file mode 100644 index 0000000..47c000c Binary files /dev/null and b/Shared/EFT/Aki.Common.dll differ diff --git a/Shared/EFT/Aki.Reflection.dll b/Shared/EFT/Aki.Reflection.dll new file mode 100644 index 0000000..80041e8 Binary files /dev/null and b/Shared/EFT/Aki.Reflection.dll differ diff --git a/Shared/EFT/AmplifyMotion.dll b/Shared/EFT/AmplifyMotion.dll index 21176f2..e7b2138 100644 Binary files a/Shared/EFT/AmplifyMotion.dll and b/Shared/EFT/AmplifyMotion.dll differ diff --git a/Shared/EFT/AnimationSystem.Recording.dll b/Shared/EFT/AnimationSystem.Recording.dll index 01a9a48..2000411 100644 Binary files a/Shared/EFT/AnimationSystem.Recording.dll and b/Shared/EFT/AnimationSystem.Recording.dll differ diff --git a/Shared/EFT/AnimationSystem.Types.dll b/Shared/EFT/AnimationSystem.Types.dll index 646cbb2..e73e085 100644 Binary files a/Shared/EFT/AnimationSystem.Types.dll and b/Shared/EFT/AnimationSystem.Types.dll differ diff --git a/Shared/EFT/Assembly-CSharp-firstpass.dll b/Shared/EFT/Assembly-CSharp-firstpass.dll index c456d57..061a9af 100644 Binary files a/Shared/EFT/Assembly-CSharp-firstpass.dll and b/Shared/EFT/Assembly-CSharp-firstpass.dll differ diff --git a/Shared/EFT/Assembly-CSharp.dll b/Shared/EFT/Assembly-CSharp.dll index 32bd76a..43873ee 100644 Binary files a/Shared/EFT/Assembly-CSharp.dll and b/Shared/EFT/Assembly-CSharp.dll differ diff --git a/Shared/EFT/Autodesk.Fbx.dll b/Shared/EFT/Autodesk.Fbx.dll index e141c3b..98299ef 100644 Binary files a/Shared/EFT/Autodesk.Fbx.dll and b/Shared/EFT/Autodesk.Fbx.dll differ diff --git a/Shared/EFT/Cinemachine.dll b/Shared/EFT/Cinemachine.dll index 529bdc7..a03509e 100644 Binary files a/Shared/EFT/Cinemachine.dll and b/Shared/EFT/Cinemachine.dll differ diff --git a/Shared/EFT/Coffee.SoftMaskForUGUI.dll b/Shared/EFT/Coffee.SoftMaskForUGUI.dll new file mode 100644 index 0000000..cbe3707 Binary files /dev/null and b/Shared/EFT/Coffee.SoftMaskForUGUI.dll differ diff --git a/Shared/EFT/Comfort.Unity.dll b/Shared/EFT/Comfort.Unity.dll index fd44ed3..566b31a 100644 Binary files a/Shared/EFT/Comfort.Unity.dll and b/Shared/EFT/Comfort.Unity.dll differ diff --git a/Shared/EFT/Comfort.dll b/Shared/EFT/Comfort.dll index 897408b..30d959d 100644 Binary files a/Shared/EFT/Comfort.dll and b/Shared/EFT/Comfort.dll differ diff --git a/Shared/EFT/CommonExtensions.dll b/Shared/EFT/CommonExtensions.dll index 7020f72..1f7cb77 100644 Binary files a/Shared/EFT/CommonExtensions.dll and b/Shared/EFT/CommonExtensions.dll differ diff --git a/Shared/EFT/DOTween.Modules.dll b/Shared/EFT/DOTween.Modules.dll index f461f22..f953eb8 100644 Binary files a/Shared/EFT/DOTween.Modules.dll and b/Shared/EFT/DOTween.Modules.dll differ diff --git a/Shared/EFT/DOTween.dll b/Shared/EFT/DOTween.dll index e3b2454..ee6ae9d 100644 Binary files a/Shared/EFT/DOTween.dll and b/Shared/EFT/DOTween.dll differ diff --git a/Shared/EFT/DissonanceVoip.dll b/Shared/EFT/DissonanceVoip.dll index 19dcd73..ff12efc 100644 Binary files a/Shared/EFT/DissonanceVoip.dll and b/Shared/EFT/DissonanceVoip.dll differ diff --git a/Shared/EFT/FbxBuildTestAssets.dll b/Shared/EFT/FbxBuildTestAssets.dll index ca7999b..b66475b 100644 Binary files a/Shared/EFT/FbxBuildTestAssets.dll and b/Shared/EFT/FbxBuildTestAssets.dll differ diff --git a/Shared/EFT/FilesChecker.dll b/Shared/EFT/FilesChecker.dll index 901f342..12421a4 100644 Binary files a/Shared/EFT/FilesChecker.dll and b/Shared/EFT/FilesChecker.dll differ diff --git a/Shared/EFT/ILInjectedProfiler.dll b/Shared/EFT/ILInjectedProfiler.dll new file mode 100644 index 0000000..68f2e9a Binary files /dev/null and b/Shared/EFT/ILInjectedProfiler.dll differ diff --git a/Shared/EFT/ItemComponent.Types.dll b/Shared/EFT/ItemComponent.Types.dll index 19ebb82..e122af4 100644 Binary files a/Shared/EFT/ItemComponent.Types.dll and b/Shared/EFT/ItemComponent.Types.dll differ diff --git a/Shared/EFT/ItemTemplate.Types.dll b/Shared/EFT/ItemTemplate.Types.dll index 54d021b..f88510f 100644 Binary files a/Shared/EFT/ItemTemplate.Types.dll and b/Shared/EFT/ItemTemplate.Types.dll differ diff --git a/Shared/EFT/JBooth.MicroSplat.Core.dll b/Shared/EFT/JBooth.MicroSplat.Core.dll index 23111d3..111b57d 100644 Binary files a/Shared/EFT/JBooth.MicroSplat.Core.dll and b/Shared/EFT/JBooth.MicroSplat.Core.dll differ diff --git a/Shared/EFT/LibraryLoaderUtility.dll b/Shared/EFT/LibraryLoaderUtility.dll index 3feaf0a..e738dd6 100644 Binary files a/Shared/EFT/LibraryLoaderUtility.dll and b/Shared/EFT/LibraryLoaderUtility.dll differ diff --git a/Shared/EFT/NLog.dll b/Shared/EFT/NLog.dll index 809f8a5..0a21365 100644 Binary files a/Shared/EFT/NLog.dll and b/Shared/EFT/NLog.dll differ diff --git a/Shared/EFT/Newtonsoft.Json.UnityConverters.dll b/Shared/EFT/Newtonsoft.Json.UnityConverters.dll index c40f063..7605019 100644 Binary files a/Shared/EFT/Newtonsoft.Json.UnityConverters.dll and b/Shared/EFT/Newtonsoft.Json.UnityConverters.dll differ diff --git a/Shared/EFT/Newtonsoft.Json.dll b/Shared/EFT/Newtonsoft.Json.dll index 963a4f0..44d2676 100644 Binary files a/Shared/EFT/Newtonsoft.Json.dll and b/Shared/EFT/Newtonsoft.Json.dll differ diff --git a/Shared/EFT/Novell.Directory.Ldap.dll b/Shared/EFT/Novell.Directory.Ldap.dll index 1cfe4b7..ceec6a3 100644 Binary files a/Shared/EFT/Novell.Directory.Ldap.dll and b/Shared/EFT/Novell.Directory.Ldap.dll differ diff --git a/Shared/EFT/Oculus.AudioManager.dll b/Shared/EFT/Oculus.AudioManager.dll new file mode 100644 index 0000000..a41fc90 Binary files /dev/null and b/Shared/EFT/Oculus.AudioManager.dll differ diff --git a/Shared/EFT/Oculus.Spatializer.dll b/Shared/EFT/Oculus.Spatializer.dll new file mode 100644 index 0000000..6f8d04c Binary files /dev/null and b/Shared/EFT/Oculus.Spatializer.dll differ diff --git a/Shared/EFT/Sirenix.OdinInspector.Attributes.dll b/Shared/EFT/Sirenix.OdinInspector.Attributes.dll index 3d0778e..7c47e59 100644 Binary files a/Shared/EFT/Sirenix.OdinInspector.Attributes.dll and b/Shared/EFT/Sirenix.OdinInspector.Attributes.dll differ diff --git a/Shared/EFT/Sirenix.OdinInspector.CompatibilityLayer.dll b/Shared/EFT/Sirenix.OdinInspector.CompatibilityLayer.dll index 006bd29..39c3d67 100644 Binary files a/Shared/EFT/Sirenix.OdinInspector.CompatibilityLayer.dll and b/Shared/EFT/Sirenix.OdinInspector.CompatibilityLayer.dll differ diff --git a/Shared/EFT/Sirenix.Serialization.Config.dll b/Shared/EFT/Sirenix.Serialization.Config.dll index 07058ad..8eeee09 100644 Binary files a/Shared/EFT/Sirenix.Serialization.Config.dll and b/Shared/EFT/Sirenix.Serialization.Config.dll differ diff --git a/Shared/EFT/Sirenix.Serialization.dll b/Shared/EFT/Sirenix.Serialization.dll index d8b80a0..084af9e 100644 Binary files a/Shared/EFT/Sirenix.Serialization.dll and b/Shared/EFT/Sirenix.Serialization.dll differ diff --git a/Shared/EFT/Sirenix.Utilities.dll b/Shared/EFT/Sirenix.Utilities.dll index 0ad4f8b..e5125cc 100644 Binary files a/Shared/EFT/Sirenix.Utilities.dll and b/Shared/EFT/Sirenix.Utilities.dll differ diff --git a/Shared/EFT/SteamAudio.dll b/Shared/EFT/SteamAudio.dll index 8f8e068..62aa61b 100644 Binary files a/Shared/EFT/SteamAudio.dll and b/Shared/EFT/SteamAudio.dll differ diff --git a/Shared/EFT/Unity.Burst.Cecil.Mdb.dll b/Shared/EFT/Unity.Burst.Cecil.Mdb.dll new file mode 100644 index 0000000..c91fb2c Binary files /dev/null and b/Shared/EFT/Unity.Burst.Cecil.Mdb.dll differ diff --git a/Shared/EFT/Unity.Burst.Cecil.Pdb.dll b/Shared/EFT/Unity.Burst.Cecil.Pdb.dll new file mode 100644 index 0000000..62c2093 Binary files /dev/null and b/Shared/EFT/Unity.Burst.Cecil.Pdb.dll differ diff --git a/Shared/EFT/Unity.Burst.Cecil.Rocks.dll b/Shared/EFT/Unity.Burst.Cecil.Rocks.dll new file mode 100644 index 0000000..ceda0a0 Binary files /dev/null and b/Shared/EFT/Unity.Burst.Cecil.Rocks.dll differ diff --git a/Shared/EFT/Unity.Burst.Cecil.dll b/Shared/EFT/Unity.Burst.Cecil.dll new file mode 100644 index 0000000..91aba2d Binary files /dev/null and b/Shared/EFT/Unity.Burst.Cecil.dll differ diff --git a/Shared/EFT/Unity.Burst.Unsafe.dll b/Shared/EFT/Unity.Burst.Unsafe.dll new file mode 100644 index 0000000..ac36cfa Binary files /dev/null and b/Shared/EFT/Unity.Burst.Unsafe.dll differ diff --git a/Shared/EFT/Unity.Burst.dll b/Shared/EFT/Unity.Burst.dll new file mode 100644 index 0000000..0bbc1a2 Binary files /dev/null and b/Shared/EFT/Unity.Burst.dll differ diff --git a/Shared/EFT/Unity.Formats.Fbx.Runtime.dll b/Shared/EFT/Unity.Formats.Fbx.Runtime.dll index 7abf0bb..d359d18 100644 Binary files a/Shared/EFT/Unity.Formats.Fbx.Runtime.dll and b/Shared/EFT/Unity.Formats.Fbx.Runtime.dll differ diff --git a/Shared/EFT/Unity.Mathematics.dll b/Shared/EFT/Unity.Mathematics.dll new file mode 100644 index 0000000..4206e74 Binary files /dev/null and b/Shared/EFT/Unity.Mathematics.dll differ diff --git a/Shared/EFT/Unity.MemoryProfiler.dll b/Shared/EFT/Unity.MemoryProfiler.dll index 755680b..639f5c8 100644 Binary files a/Shared/EFT/Unity.MemoryProfiler.dll and b/Shared/EFT/Unity.MemoryProfiler.dll differ diff --git a/Shared/EFT/Unity.PlayableGraphVisualizer.dll b/Shared/EFT/Unity.PlayableGraphVisualizer.dll index 5659647..78f6b41 100644 Binary files a/Shared/EFT/Unity.PlayableGraphVisualizer.dll and b/Shared/EFT/Unity.PlayableGraphVisualizer.dll differ diff --git a/Shared/EFT/Unity.Postprocessing.Runtime.dll b/Shared/EFT/Unity.Postprocessing.Runtime.dll index 2db02eb..3b21b38 100644 Binary files a/Shared/EFT/Unity.Postprocessing.Runtime.dll and b/Shared/EFT/Unity.Postprocessing.Runtime.dll differ diff --git a/Shared/EFT/Unity.ProBuilder.Csg.dll b/Shared/EFT/Unity.ProBuilder.Csg.dll index 5cf855c..9dcca8a 100644 Binary files a/Shared/EFT/Unity.ProBuilder.Csg.dll and b/Shared/EFT/Unity.ProBuilder.Csg.dll differ diff --git a/Shared/EFT/Unity.ProBuilder.KdTree.dll b/Shared/EFT/Unity.ProBuilder.KdTree.dll index 5b6e5f7..2d4e07c 100644 Binary files a/Shared/EFT/Unity.ProBuilder.KdTree.dll and b/Shared/EFT/Unity.ProBuilder.KdTree.dll differ diff --git a/Shared/EFT/Unity.ProBuilder.Poly2Tri.dll b/Shared/EFT/Unity.ProBuilder.Poly2Tri.dll index 8575e99..e625b01 100644 Binary files a/Shared/EFT/Unity.ProBuilder.Poly2Tri.dll and b/Shared/EFT/Unity.ProBuilder.Poly2Tri.dll differ diff --git a/Shared/EFT/Unity.ProBuilder.Stl.dll b/Shared/EFT/Unity.ProBuilder.Stl.dll index 261126e..0e4ed84 100644 Binary files a/Shared/EFT/Unity.ProBuilder.Stl.dll and b/Shared/EFT/Unity.ProBuilder.Stl.dll differ diff --git a/Shared/EFT/Unity.ProBuilder.dll b/Shared/EFT/Unity.ProBuilder.dll index 58e4402..1fe2761 100644 Binary files a/Shared/EFT/Unity.ProBuilder.dll and b/Shared/EFT/Unity.ProBuilder.dll differ diff --git a/Shared/EFT/Unity.Recorder.Base.dll b/Shared/EFT/Unity.Recorder.Base.dll index d75a0d0..e02acda 100644 Binary files a/Shared/EFT/Unity.Recorder.Base.dll and b/Shared/EFT/Unity.Recorder.Base.dll differ diff --git a/Shared/EFT/Unity.Recorder.dll b/Shared/EFT/Unity.Recorder.dll index ca4eed8..16806be 100644 Binary files a/Shared/EFT/Unity.Recorder.dll and b/Shared/EFT/Unity.Recorder.dll differ diff --git a/Shared/EFT/Unity.ScriptableBuildPipeline.dll b/Shared/EFT/Unity.ScriptableBuildPipeline.dll index bb636b7..d1a44c0 100644 Binary files a/Shared/EFT/Unity.ScriptableBuildPipeline.dll and b/Shared/EFT/Unity.ScriptableBuildPipeline.dll differ diff --git a/Shared/EFT/Unity.TextMeshPro.dll b/Shared/EFT/Unity.TextMeshPro.dll index fadbc3a..820beed 100644 Binary files a/Shared/EFT/Unity.TextMeshPro.dll and b/Shared/EFT/Unity.TextMeshPro.dll differ diff --git a/Shared/EFT/Unity.Timeline.dll b/Shared/EFT/Unity.Timeline.dll index 81720f8..e7b4247 100644 Binary files a/Shared/EFT/Unity.Timeline.dll and b/Shared/EFT/Unity.Timeline.dll differ diff --git a/Shared/EFT/UnityEngine.UI.dll b/Shared/EFT/UnityEngine.UI.dll index 2280728..9ced750 100644 Binary files a/Shared/EFT/UnityEngine.UI.dll and b/Shared/EFT/UnityEngine.UI.dll differ diff --git a/Shared/EFT/bsg.componentace.compression.libs.zlib.dll b/Shared/EFT/bsg.componentace.compression.libs.zlib.dll index 3312c4a..e5fb0c8 100644 Binary files a/Shared/EFT/bsg.componentace.compression.libs.zlib.dll and b/Shared/EFT/bsg.componentace.compression.libs.zlib.dll differ diff --git a/Shared/EFT/bsg.console.core.dll b/Shared/EFT/bsg.console.core.dll index 7a5c31f..46496cf 100644 Binary files a/Shared/EFT/bsg.console.core.dll and b/Shared/EFT/bsg.console.core.dll differ diff --git a/Shared/EFT/bsg.microsoft.extensions.objectpool.dll b/Shared/EFT/bsg.microsoft.extensions.objectpool.dll index 1e3f1f5..abfc21b 100644 Binary files a/Shared/EFT/bsg.microsoft.extensions.objectpool.dll and b/Shared/EFT/bsg.microsoft.extensions.objectpool.dll differ diff --git a/Shared/EFT/bsg.system.buffers.dll b/Shared/EFT/bsg.system.buffers.dll index fc3f1bf..523db23 100644 Binary files a/Shared/EFT/bsg.system.buffers.dll and b/Shared/EFT/bsg.system.buffers.dll differ diff --git a/Shared/EFT/com.nvidia.reflex.Runtime.dll b/Shared/EFT/com.nvidia.reflex.Runtime.dll index 9466a19..f424efb 100644 Binary files a/Shared/EFT/com.nvidia.reflex.Runtime.dll and b/Shared/EFT/com.nvidia.reflex.Runtime.dll differ diff --git a/Shared/EFT/com.unity.multiplayer-hlapi.Runtime.dll b/Shared/EFT/com.unity.multiplayer-hlapi.Runtime.dll index 57c8c71..bb36011 100644 Binary files a/Shared/EFT/com.unity.multiplayer-hlapi.Runtime.dll and b/Shared/EFT/com.unity.multiplayer-hlapi.Runtime.dll differ diff --git a/Shared/EFT/mscorlib.dll b/Shared/EFT/mscorlib.dll index f0b1031..f0e8b91 100644 Binary files a/Shared/EFT/mscorlib.dll and b/Shared/EFT/mscorlib.dll differ diff --git a/Shared/EFT/netstandard.dll b/Shared/EFT/netstandard.dll index 70c67ec..ecc4473 100644 Binary files a/Shared/EFT/netstandard.dll and b/Shared/EFT/netstandard.dll differ diff --git a/Shared/EFT/uLipSync.Runtime.dll b/Shared/EFT/uLipSync.Runtime.dll new file mode 100644 index 0000000..c7ea9a4 Binary files /dev/null and b/Shared/EFT/uLipSync.Runtime.dll differ diff --git a/Shared/EFT/websocket-sharp.dll b/Shared/EFT/websocket-sharp.dll new file mode 100644 index 0000000..10e4b69 Binary files /dev/null and b/Shared/EFT/websocket-sharp.dll differ