Update types
This commit is contained in:
parent
562a74abb4
commit
ceb6691223
2
types/ErrorHandler.d.ts
vendored
2
types/ErrorHandler.d.ts
vendored
@ -2,5 +2,5 @@ export declare class ErrorHandler {
|
|||||||
private logger;
|
private logger;
|
||||||
private readLine;
|
private readLine;
|
||||||
constructor();
|
constructor();
|
||||||
handleCriticalError(err: any): void;
|
handleCriticalError(err: Error): void;
|
||||||
}
|
}
|
||||||
|
2
types/Program.d.ts
vendored
2
types/Program.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
export declare class Program {
|
export declare class Program {
|
||||||
private errorHandler;
|
private errorHandler;
|
||||||
constructor();
|
constructor();
|
||||||
start(): void;
|
start(): Promise<void>;
|
||||||
}
|
}
|
||||||
|
21
types/callbacks/AchievementCallbacks.d.ts
vendored
Normal file
21
types/callbacks/AchievementCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { AchievementController } from "@spt-aki/controllers/AchievementController";
|
||||||
|
import { ProfileController } from "@spt-aki/controllers/ProfileController";
|
||||||
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
|
import { ICompletedAchievementsResponse } from "@spt-aki/models/eft/profile/ICompletedAchievementsResponse";
|
||||||
|
import { IGetAchievementsResponse } from "@spt-aki/models/eft/profile/IGetAchievementsResponse";
|
||||||
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
export declare class AchievementCallbacks {
|
||||||
|
protected achievementController: AchievementController;
|
||||||
|
protected profileController: ProfileController;
|
||||||
|
protected httpResponse: HttpResponseUtil;
|
||||||
|
constructor(achievementController: AchievementController, profileController: ProfileController, httpResponse: HttpResponseUtil);
|
||||||
|
/**
|
||||||
|
* Handle client/achievement/list
|
||||||
|
*/
|
||||||
|
getAchievements(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetAchievementsResponse>;
|
||||||
|
/**
|
||||||
|
* Handle client/achievement/statistic
|
||||||
|
*/
|
||||||
|
statistic(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICompletedAchievementsResponse>;
|
||||||
|
}
|
13
types/callbacks/BotCallbacks.d.ts
vendored
13
types/callbacks/BotCallbacks.d.ts
vendored
@ -1,15 +1,16 @@
|
|||||||
import { BotController } from "../controllers/BotController";
|
import { BotController } from "@spt-aki/controllers/BotController";
|
||||||
import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData";
|
import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IBotBase } from "../models/eft/common/tables/IBotBase";
|
import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
export declare class BotCallbacks {
|
export declare class BotCallbacks {
|
||||||
protected botController: BotController;
|
protected botController: BotController;
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
constructor(botController: BotController, httpResponse: HttpResponseUtil);
|
constructor(botController: BotController, httpResponse: HttpResponseUtil);
|
||||||
/**
|
/**
|
||||||
* Handle singleplayer/settings/bot/limit
|
* Handle singleplayer/settings/bot/limit
|
||||||
|
* Is called by client to define each bot roles wave limit
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
getBotLimit(url: string, info: IEmptyRequestData, sessionID: string): string;
|
getBotLimit(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
|
34
types/callbacks/BuildsCallbacks.d.ts
vendored
Normal file
34
types/callbacks/BuildsCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import { BuildController } from "@spt-aki/controllers/BuildController";
|
||||||
|
import { ISetMagazineRequest } from "@spt-aki/models/eft/builds/ISetMagazineRequest";
|
||||||
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
|
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
|
||||||
|
import { IPresetBuildActionRequestData } from "@spt-aki/models/eft/presetBuild/IPresetBuildActionRequestData";
|
||||||
|
import { IRemoveBuildRequestData } from "@spt-aki/models/eft/presetBuild/IRemoveBuildRequestData";
|
||||||
|
import { IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
export declare class BuildsCallbacks {
|
||||||
|
protected httpResponse: HttpResponseUtil;
|
||||||
|
protected buildController: BuildController;
|
||||||
|
constructor(httpResponse: HttpResponseUtil, buildController: BuildController);
|
||||||
|
/**
|
||||||
|
* Handle client/builds/list
|
||||||
|
*/
|
||||||
|
getBuilds(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IUserBuilds>;
|
||||||
|
/**
|
||||||
|
* Handle client/builds/magazine/save
|
||||||
|
*/
|
||||||
|
createMagazineTemplate(url: string, request: ISetMagazineRequest, sessionID: string): INullResponseData;
|
||||||
|
/**
|
||||||
|
* Handle client/builds/weapon/save
|
||||||
|
*/
|
||||||
|
setWeapon(url: string, info: IPresetBuildActionRequestData, sessionID: string): INullResponseData;
|
||||||
|
/**
|
||||||
|
* Handle client/builds/equipment/save
|
||||||
|
*/
|
||||||
|
setEquipment(url: string, info: IPresetBuildActionRequestData, sessionID: string): INullResponseData;
|
||||||
|
/**
|
||||||
|
* Handle client/builds/delete
|
||||||
|
*/
|
||||||
|
deleteBuild(url: string, info: IRemoveBuildRequestData, sessionID: string): INullResponseData;
|
||||||
|
}
|
17
types/callbacks/BundleCallbacks.d.ts
vendored
17
types/callbacks/BundleCallbacks.d.ts
vendored
@ -1,9 +1,9 @@
|
|||||||
import { BundleLoader } from "../loaders/BundleLoader";
|
import { BundleLoader } from "@spt-aki/loaders/BundleLoader";
|
||||||
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
|
import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { HttpFileUtil } from "../utils/HttpFileUtil";
|
import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
export declare class BundleCallbacks {
|
export declare class BundleCallbacks {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
@ -12,7 +12,10 @@ export declare class BundleCallbacks {
|
|||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected httpConfig: IHttpConfig;
|
protected httpConfig: IHttpConfig;
|
||||||
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer);
|
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer);
|
||||||
sendBundle(sessionID: string, req: any, resp: any, body: any): any;
|
sendBundle(sessionID: string, req: any, resp: any, body: any): void;
|
||||||
|
/**
|
||||||
|
* Handle singleplayer/bundles
|
||||||
|
*/
|
||||||
getBundles(url: string, info: any, sessionID: string): string;
|
getBundles(url: string, info: any, sessionID: string): string;
|
||||||
getBundle(url: string, info: any, sessionID: string): string;
|
getBundle(url: string, info: any, sessionID: string): string;
|
||||||
}
|
}
|
||||||
|
14
types/callbacks/ClientLogCallbacks.d.ts
vendored
Normal file
14
types/callbacks/ClientLogCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { ClientLogController } from "@spt-aki/controllers/ClientLogController";
|
||||||
|
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
|
||||||
|
import { IClientLogRequest } from "@spt-aki/models/spt/logging/IClientLogRequest";
|
||||||
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
/** Handle client logging related events */
|
||||||
|
export declare class ClientLogCallbacks {
|
||||||
|
protected httpResponse: HttpResponseUtil;
|
||||||
|
protected clientLogController: ClientLogController;
|
||||||
|
constructor(httpResponse: HttpResponseUtil, clientLogController: ClientLogController);
|
||||||
|
/**
|
||||||
|
* Handle /singleplayer/log
|
||||||
|
*/
|
||||||
|
clientLog(url: string, info: IClientLogRequest, sessionID: string): INullResponseData;
|
||||||
|
}
|
34
types/callbacks/CustomizationCallbacks.d.ts
vendored
34
types/callbacks/CustomizationCallbacks.d.ts
vendored
@ -1,29 +1,35 @@
|
|||||||
import { CustomizationController } from "../controllers/CustomizationController";
|
import { CustomizationController } from "@spt-aki/controllers/CustomizationController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { ISuit } from "../models/eft/common/tables/ITrader";
|
import { ISuit } from "@spt-aki/models/eft/common/tables/ITrader";
|
||||||
import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothingRequestData";
|
import { IBuyClothingRequestData } from "@spt-aki/models/eft/customization/IBuyClothingRequestData";
|
||||||
import { IGetSuitsResponse } from "../models/eft/customization/IGetSuitsResponse";
|
import { IGetSuitsResponse } from "@spt-aki/models/eft/customization/IGetSuitsResponse";
|
||||||
import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData";
|
import { IWearClothingRequestData } from "@spt-aki/models/eft/customization/IWearClothingRequestData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
export declare class CustomizationCallbacks {
|
export declare class CustomizationCallbacks {
|
||||||
protected customizationController: CustomizationController;
|
protected customizationController: CustomizationController;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
constructor(customizationController: CustomizationController, saveServer: SaveServer, httpResponse: HttpResponseUtil);
|
constructor(customizationController: CustomizationController, saveServer: SaveServer, httpResponse: HttpResponseUtil);
|
||||||
/**
|
/**
|
||||||
* Handles client/trading/customization/storage
|
* Handle client/trading/customization/storage
|
||||||
* @returns
|
* @returns IGetSuitsResponse
|
||||||
*/
|
*/
|
||||||
getSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetSuitsResponse>;
|
getSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetSuitsResponse>;
|
||||||
/**
|
/**
|
||||||
* Handles client/trading/customization
|
* Handle client/trading/customization
|
||||||
* @returns ISuit[]
|
* @returns ISuit[]
|
||||||
*/
|
*/
|
||||||
getTraderSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISuit[]>;
|
getTraderSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISuit[]>;
|
||||||
|
/**
|
||||||
|
* Handle CustomizationWear event
|
||||||
|
*/
|
||||||
wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle CustomizationBuy event
|
||||||
|
*/
|
||||||
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
57
types/callbacks/DataCallbacks.d.ts
vendored
57
types/callbacks/DataCallbacks.d.ts
vendored
@ -1,19 +1,18 @@
|
|||||||
import { HideoutController } from "../controllers/HideoutController";
|
import { HideoutController } from "@spt-aki/controllers/HideoutController";
|
||||||
import { RagfairController } from "../controllers/RagfairController";
|
import { RagfairController } from "@spt-aki/controllers/RagfairController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IGlobals } from "../models/eft/common/IGlobals";
|
import { IGlobals } from "@spt-aki/models/eft/common/IGlobals";
|
||||||
import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem";
|
import { ICustomizationItem } from "@spt-aki/models/eft/common/tables/ICustomizationItem";
|
||||||
import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase";
|
import { IHandbookBase } from "@spt-aki/models/eft/common/tables/IHandbookBase";
|
||||||
import { IQuest } from "../models/eft/common/tables/IQuest";
|
import { IGetItemPricesResponse } from "@spt-aki/models/eft/game/IGetItemPricesResponse";
|
||||||
import { IGetItemPricesResponse } from "../models/eft/game/IGetItemPricesResponse";
|
import { IHideoutArea } from "@spt-aki/models/eft/hideout/IHideoutArea";
|
||||||
import { IHideoutArea } from "../models/eft/hideout/IHideoutArea";
|
import { IHideoutProduction } from "@spt-aki/models/eft/hideout/IHideoutProduction";
|
||||||
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
|
import { IHideoutScavCase } from "@spt-aki/models/eft/hideout/IHideoutScavCase";
|
||||||
import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase";
|
import { IHideoutSettingsBase } from "@spt-aki/models/eft/hideout/IHideoutSettingsBase";
|
||||||
import { IHideoutSettingsBase } from "../models/eft/hideout/IHideoutSettingsBase";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { ISettingsBase } from "@spt-aki/models/spt/server/ISettingsBase";
|
||||||
import { ISettingsBase } from "../models/spt/server/ISettingsBase";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
|
||||||
/**
|
/**
|
||||||
* Handle client requests
|
* Handle client requests
|
||||||
*/
|
*/
|
||||||
@ -24,42 +23,54 @@ export declare class DataCallbacks {
|
|||||||
protected hideoutController: HideoutController;
|
protected hideoutController: HideoutController;
|
||||||
constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController);
|
constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController);
|
||||||
/**
|
/**
|
||||||
* Handles client/settings
|
* Handle client/settings
|
||||||
* @returns ISettingsBase
|
* @returns ISettingsBase
|
||||||
*/
|
*/
|
||||||
getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISettingsBase>;
|
getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISettingsBase>;
|
||||||
/**
|
/**
|
||||||
* Handles client/globals
|
* Handle client/globals
|
||||||
* @returns IGlobals
|
* @returns IGlobals
|
||||||
*/
|
*/
|
||||||
getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGlobals>;
|
getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGlobals>;
|
||||||
/**
|
/**
|
||||||
* Handles client/items
|
* Handle client/items
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string;
|
getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
/**
|
/**
|
||||||
* Handles client/handbook/templates
|
* Handle client/handbook/templates
|
||||||
* @returns IHandbookBase
|
* @returns IHandbookBase
|
||||||
*/
|
*/
|
||||||
getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHandbookBase>;
|
getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHandbookBase>;
|
||||||
/**
|
/**
|
||||||
* Handles client/customization
|
* Handle client/customization
|
||||||
* @returns Record<string, ICustomizationItem
|
* @returns Record<string, ICustomizationItem
|
||||||
*/
|
*/
|
||||||
getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, ICustomizationItem>>;
|
getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, ICustomizationItem>>;
|
||||||
/**
|
/**
|
||||||
* Handles client/account/customization
|
* Handle client/account/customization
|
||||||
* @returns string[]
|
* @returns string[]
|
||||||
*/
|
*/
|
||||||
getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string[]>;
|
getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string[]>;
|
||||||
getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IQuest[]>;
|
/**
|
||||||
|
* Handle client/hideout/settings
|
||||||
|
* @returns IHideoutSettingsBase
|
||||||
|
*/
|
||||||
getHideoutSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutSettingsBase>;
|
getHideoutSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutSettingsBase>;
|
||||||
getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutArea[]>;
|
getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutArea[]>;
|
||||||
gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutProduction[]>;
|
gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutProduction[]>;
|
||||||
getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutScavCase[]>;
|
getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutScavCase[]>;
|
||||||
|
/**
|
||||||
|
* Handle client/languages
|
||||||
|
*/
|
||||||
getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, string>>;
|
getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, string>>;
|
||||||
|
/**
|
||||||
|
* Handle client/menu/locale
|
||||||
|
*/
|
||||||
getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
||||||
|
/**
|
||||||
|
* Handle client/locale
|
||||||
|
*/
|
||||||
getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string;
|
getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
/**
|
/**
|
||||||
* Handle client/hideout/qte/list
|
* Handle client/hideout/qte/list
|
||||||
|
98
types/callbacks/DialogueCallbacks.d.ts
vendored
98
types/callbacks/DialogueCallbacks.d.ts
vendored
@ -1,26 +1,31 @@
|
|||||||
import { DialogueController } from "../controllers/DialogueController";
|
import { DialogueController } from "@spt-aki/controllers/DialogueController";
|
||||||
import { OnUpdate } from "../di/OnUpdate";
|
import { OnUpdate } from "@spt-aki/di/OnUpdate";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IChatServer } from "../models/eft/dialog/IChatServer";
|
import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData";
|
||||||
import { IFriendRequestData } from "../models/eft/dialog/IFriendRequestData";
|
import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer";
|
||||||
import { IGetAllAttachmentsRequestData } from "../models/eft/dialog/IGetAllAttachmentsRequestData";
|
import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest";
|
||||||
import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse";
|
import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest";
|
||||||
import { IGetChatServerListRequestData } from "../models/eft/dialog/IGetChatServerListRequestData";
|
import { IFriendRequestData } from "@spt-aki/models/eft/dialog/IFriendRequestData";
|
||||||
import { IGetFriendListDataResponse } from "../models/eft/dialog/IGetFriendListDataResponse";
|
import { IFriendRequestSendResponse } from "@spt-aki/models/eft/dialog/IFriendRequestSendResponse";
|
||||||
import { IGetMailDialogInfoRequestData } from "../models/eft/dialog/IGetMailDialogInfoRequestData";
|
import { IGetAllAttachmentsRequestData } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsRequestData";
|
||||||
import { IGetMailDialogListRequestData } from "../models/eft/dialog/IGetMailDialogListRequestData";
|
import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse";
|
||||||
import { IGetMailDialogViewRequestData } from "../models/eft/dialog/IGetMailDialogViewRequestData";
|
import { IGetChatServerListRequestData } from "@spt-aki/models/eft/dialog/IGetChatServerListRequestData";
|
||||||
import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDialogViewResponseData";
|
import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse";
|
||||||
import { IPinDialogRequestData } from "../models/eft/dialog/IPinDialogRequestData";
|
import { IGetMailDialogInfoRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogInfoRequestData";
|
||||||
import { IRemoveDialogRequestData } from "../models/eft/dialog/IRemoveDialogRequestData";
|
import { IGetMailDialogListRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogListRequestData";
|
||||||
import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest";
|
import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData";
|
||||||
import { ISetDialogReadRequestData } from "../models/eft/dialog/ISetDialogReadRequestData";
|
import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewResponseData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IPinDialogRequestData } from "@spt-aki/models/eft/dialog/IPinDialogRequestData";
|
||||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
import { IRemoveDialogRequestData } from "@spt-aki/models/eft/dialog/IRemoveDialogRequestData";
|
||||||
import { DialogueInfo } from "../models/eft/profile/IAkiProfile";
|
import { IRemoveMailMessageRequest } from "@spt-aki/models/eft/dialog/IRemoveMailMessageRequest";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { ISetDialogReadRequestData } from "@spt-aki/models/eft/dialog/ISetDialogReadRequestData";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
|
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
|
||||||
|
import { DialogueInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
export declare class DialogueCallbacks implements OnUpdate {
|
export declare class DialogueCallbacks implements OnUpdate {
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
@ -28,31 +33,66 @@ export declare class DialogueCallbacks implements OnUpdate {
|
|||||||
protected dialogueController: DialogueController;
|
protected dialogueController: DialogueController;
|
||||||
constructor(hashUtil: HashUtil, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, dialogueController: DialogueController);
|
constructor(hashUtil: HashUtil, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, dialogueController: DialogueController);
|
||||||
/**
|
/**
|
||||||
* Handles client/friend/list
|
* Handle client/friend/list
|
||||||
* @returns IGetFriendListDataResponse
|
* @returns IGetFriendListDataResponse
|
||||||
*/
|
*/
|
||||||
getFriendList(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetFriendListDataResponse>;
|
getFriendList(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetFriendListDataResponse>;
|
||||||
/**
|
/**
|
||||||
* Handles client/chatServer/list
|
* Handle client/chatServer/list
|
||||||
* @returns
|
* @returns IChatServer[]
|
||||||
*/
|
*/
|
||||||
getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData<IChatServer[]>;
|
getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData<IChatServer[]>;
|
||||||
|
/** Handle client/mail/dialog/list */
|
||||||
getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo[]>;
|
getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo[]>;
|
||||||
|
/** Handle client/mail/dialog/view */
|
||||||
getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData<IGetMailDialogViewResponseData>;
|
getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData<IGetMailDialogViewResponseData>;
|
||||||
|
/** Handle client/mail/dialog/info */
|
||||||
getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo>;
|
getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo>;
|
||||||
|
/** Handle client/mail/dialog/remove */
|
||||||
removeDialog(url: string, info: IRemoveDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
removeDialog(url: string, info: IRemoveDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
/** Handle client/mail/dialog/pin */
|
||||||
pinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
pinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
/** Handle client/mail/dialog/unpin */
|
||||||
unpinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
unpinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
/** Handle client/mail/dialog/read */
|
||||||
setRead(url: string, info: ISetDialogReadRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
setRead(url: string, info: ISetDialogReadRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
/**
|
/**
|
||||||
* Handles client/mail/dialog/getAllAttachments
|
* Handle client/mail/dialog/getAllAttachments
|
||||||
* @returns IGetAllAttachmentsResponse
|
* @returns IGetAllAttachmentsResponse
|
||||||
*/
|
*/
|
||||||
getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData<IGetAllAttachmentsResponse>;
|
getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData<IGetAllAttachmentsResponse>;
|
||||||
|
/** Handle client/mail/msg/send */
|
||||||
|
sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData<string>;
|
||||||
|
/** Handle client/friend/request/list/outbox */
|
||||||
listOutbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
listOutbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
/**
|
||||||
|
* Handle client/friend/request/list/inbox
|
||||||
|
*/
|
||||||
listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
friendRequest(url: string, request: IFriendRequestData, sessionID: string): INullResponseData;
|
/**
|
||||||
sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData<number>;
|
* Handle client/friend/request/send
|
||||||
|
*/
|
||||||
|
sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData<IFriendRequestSendResponse>;
|
||||||
|
/**
|
||||||
|
* Handle client/friend/request/accept
|
||||||
|
*/
|
||||||
|
acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||||
|
/**
|
||||||
|
* Handle client/friend/request/cancel
|
||||||
|
*/
|
||||||
|
cancelFriendRequest(url: string, request: ICancelFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||||
|
/** Handle client/friend/delete */
|
||||||
|
deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData;
|
||||||
|
/** Handle client/friend/ignore/set */
|
||||||
|
ignoreFriend(url: string, request: {
|
||||||
|
uid: string;
|
||||||
|
}, sessionID: string): INullResponseData;
|
||||||
|
/** Handle client/friend/ignore/remove */
|
||||||
|
unIgnoreFriend(url: string, request: {
|
||||||
|
uid: string;
|
||||||
|
}, sessionID: string): INullResponseData;
|
||||||
|
clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
||||||
getRoute(): string;
|
getRoute(): string;
|
||||||
}
|
}
|
||||||
|
59
types/callbacks/GameCallbacks.d.ts
vendored
59
types/callbacks/GameCallbacks.d.ts
vendored
@ -1,23 +1,31 @@
|
|||||||
import { GameController } from "../controllers/GameController";
|
import { GameController } from "@spt-aki/controllers/GameController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { OnLoad } from "@spt-aki/di/OnLoad";
|
||||||
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
|
import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse";
|
||||||
import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData";
|
import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse";
|
||||||
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
|
import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse";
|
||||||
import { IGameLogoutResponseData } from "../models/eft/game/IGameLogoutResponseData";
|
import { IGameEmptyCrcRequestData } from "@spt-aki/models/eft/game/IGameEmptyCrcRequestData";
|
||||||
import { IGameStartResponse } from "../models/eft/game/IGameStartResponse";
|
import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveResponse";
|
||||||
import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData";
|
import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData";
|
||||||
import { IServerDetails } from "../models/eft/game/IServerDetails";
|
import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse";
|
||||||
import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData";
|
import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse";
|
||||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails";
|
||||||
import { Watermark } from "../utils/Watermark";
|
import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData";
|
||||||
declare class GameCallbacks {
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
|
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
|
||||||
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
import { Watermark } from "@spt-aki/utils/Watermark";
|
||||||
|
export declare class GameCallbacks implements OnLoad {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected watermark: Watermark;
|
protected watermark: Watermark;
|
||||||
|
protected saveServer: SaveServer;
|
||||||
protected gameController: GameController;
|
protected gameController: GameController;
|
||||||
constructor(httpResponse: HttpResponseUtil, watermark: Watermark, gameController: GameController);
|
constructor(httpResponse: HttpResponseUtil, watermark: Watermark, saveServer: SaveServer, gameController: GameController);
|
||||||
|
onLoad(): Promise<void>;
|
||||||
|
getRoute(): string;
|
||||||
/**
|
/**
|
||||||
* Handle client/game/version/validate
|
* Handle client/game/version/validate
|
||||||
* @returns INullResponseData
|
* @returns INullResponseData
|
||||||
@ -30,6 +38,7 @@ declare class GameCallbacks {
|
|||||||
gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameStartResponse>;
|
gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameStartResponse>;
|
||||||
/**
|
/**
|
||||||
* Handle client/game/logout
|
* Handle client/game/logout
|
||||||
|
* Save profiles on game close
|
||||||
* @returns IGameLogoutResponseData
|
* @returns IGameLogoutResponseData
|
||||||
*/
|
*/
|
||||||
gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameLogoutResponseData>;
|
gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameLogoutResponseData>;
|
||||||
@ -38,7 +47,17 @@ declare class GameCallbacks {
|
|||||||
* @returns IGameConfigResponse
|
* @returns IGameConfigResponse
|
||||||
*/
|
*/
|
||||||
getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData<IGameConfigResponse>;
|
getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData<IGameConfigResponse>;
|
||||||
|
/**
|
||||||
|
* Handle client/server/list
|
||||||
|
*/
|
||||||
getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IServerDetails[]>;
|
getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IServerDetails[]>;
|
||||||
|
/**
|
||||||
|
* Handle client/match/group/current
|
||||||
|
*/
|
||||||
|
getCurrentGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICurrentGroupResponse>;
|
||||||
|
/**
|
||||||
|
* Handle client/checkVersion
|
||||||
|
*/
|
||||||
validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICheckVersionResponse>;
|
validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICheckVersionResponse>;
|
||||||
/**
|
/**
|
||||||
* Handle client/game/keepalive
|
* Handle client/game/keepalive
|
||||||
@ -51,5 +70,9 @@ declare class GameCallbacks {
|
|||||||
*/
|
*/
|
||||||
getVersion(url: string, info: IEmptyRequestData, sessionID: string): string;
|
getVersion(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData;
|
reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData;
|
||||||
|
/**
|
||||||
|
* Handle singleplayer/settings/getRaidTime
|
||||||
|
* @returns string
|
||||||
|
*/
|
||||||
|
getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse;
|
||||||
}
|
}
|
||||||
export { GameCallbacks };
|
|
||||||
|
4
types/callbacks/HandbookCallbacks.d.ts
vendored
4
types/callbacks/HandbookCallbacks.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
import { HandbookController } from "../controllers/HandbookController";
|
import { HandbookController } from "@spt-aki/controllers/HandbookController";
|
||||||
import { OnLoad } from "../di/OnLoad";
|
import { OnLoad } from "@spt-aki/di/OnLoad";
|
||||||
export declare class HandbookCallbacks implements OnLoad {
|
export declare class HandbookCallbacks implements OnLoad {
|
||||||
protected handbookController: HandbookController;
|
protected handbookController: HandbookController;
|
||||||
constructor(handbookController: HandbookController);
|
constructor(handbookController: HandbookController);
|
||||||
|
22
types/callbacks/HealthCallbacks.d.ts
vendored
22
types/callbacks/HealthCallbacks.d.ts
vendored
@ -1,14 +1,14 @@
|
|||||||
import { HealthController } from "../controllers/HealthController";
|
import { HealthController } from "@spt-aki/controllers/HealthController";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData";
|
import { IHealthTreatmentRequestData } from "@spt-aki/models/eft/health/IHealthTreatmentRequestData";
|
||||||
import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData";
|
import { IOffraidEatRequestData } from "@spt-aki/models/eft/health/IOffraidEatRequestData";
|
||||||
import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData";
|
import { IOffraidHealRequestData } from "@spt-aki/models/eft/health/IOffraidHealRequestData";
|
||||||
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
|
import { ISyncHealthRequestData } from "@spt-aki/models/eft/health/ISyncHealthRequestData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IWorkoutData } from "@spt-aki/models/eft/health/IWorkoutData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IWorkoutData } from "../models/eft/health/IWorkoutData";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
export declare class HealthCallbacks {
|
export declare class HealthCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
|
55
types/callbacks/HideoutCallbacks.d.ts
vendored
55
types/callbacks/HideoutCallbacks.d.ts
vendored
@ -1,21 +1,22 @@
|
|||||||
import { HideoutController } from "../controllers/HideoutController";
|
import { HideoutController } from "@spt-aki/controllers/HideoutController";
|
||||||
import { OnUpdate } from "../di/OnUpdate";
|
import { OnUpdate } from "@spt-aki/di/OnUpdate";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData";
|
import { IHandleQTEEventRequestData } from "@spt-aki/models/eft/hideout/IHandleQTEEventRequestData";
|
||||||
import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
|
import { IHideoutCancelProductionRequestData } from "@spt-aki/models/eft/hideout/IHideoutCancelProductionRequestData";
|
||||||
import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData";
|
import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData";
|
||||||
import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData";
|
import { IHideoutImproveAreaRequestData } from "@spt-aki/models/eft/hideout/IHideoutImproveAreaRequestData";
|
||||||
import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData";
|
import { IHideoutPutItemInRequestData } from "@spt-aki/models/eft/hideout/IHideoutPutItemInRequestData";
|
||||||
import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData";
|
import { IHideoutScavCaseStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutScavCaseStartRequestData";
|
||||||
import { IHideoutTakeItemOutRequestData } from "../models/eft/hideout/IHideoutTakeItemOutRequestData";
|
import { IHideoutSingleProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutSingleProductionStartRequestData";
|
||||||
import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData";
|
import { IHideoutTakeItemOutRequestData } from "@spt-aki/models/eft/hideout/IHideoutTakeItemOutRequestData";
|
||||||
import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData";
|
import { IHideoutTakeProductionRequestData } from "@spt-aki/models/eft/hideout/IHideoutTakeProductionRequestData";
|
||||||
import { IHideoutUpgradeCompleteRequestData } from "../models/eft/hideout/IHideoutUpgradeCompleteRequestData";
|
import { IHideoutToggleAreaRequestData } from "@spt-aki/models/eft/hideout/IHideoutToggleAreaRequestData";
|
||||||
import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData";
|
import { IHideoutUpgradeCompleteRequestData } from "@spt-aki/models/eft/hideout/IHideoutUpgradeCompleteRequestData";
|
||||||
import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints";
|
import { IHideoutUpgradeRequestData } from "@spt-aki/models/eft/hideout/IHideoutUpgradeRequestData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IRecordShootingRangePoints } from "@spt-aki/models/eft/hideout/IRecordShootingRangePoints";
|
||||||
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
|
||||||
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
export declare class HideoutCallbacks implements OnUpdate {
|
export declare class HideoutCallbacks implements OnUpdate {
|
||||||
protected hideoutController: HideoutController;
|
protected hideoutController: HideoutController;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
@ -23,11 +24,11 @@ export declare class HideoutCallbacks implements OnUpdate {
|
|||||||
constructor(hideoutController: HideoutController, // TODO: delay needed
|
constructor(hideoutController: HideoutController, // TODO: delay needed
|
||||||
configServer: ConfigServer);
|
configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Handle HideoutUpgrade
|
* Handle HideoutUpgrade event
|
||||||
*/
|
*/
|
||||||
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
|
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle HideoutUpgradeComplete
|
* Handle HideoutUpgradeComplete event
|
||||||
*/
|
*/
|
||||||
upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
|
upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
@ -35,19 +36,19 @@ export declare class HideoutCallbacks implements OnUpdate {
|
|||||||
*/
|
*/
|
||||||
putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
|
putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle HideoutTakeItemsFromAreaSlots
|
* Handle HideoutTakeItemsFromAreaSlots event
|
||||||
*/
|
*/
|
||||||
takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse;
|
takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle HideoutToggleArea
|
* Handle HideoutToggleArea event
|
||||||
*/
|
*/
|
||||||
toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
|
toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle HideoutSingleProductionStart
|
* Handle HideoutSingleProductionStart event
|
||||||
*/
|
*/
|
||||||
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle HideoutScavCaseProductionStart
|
* Handle HideoutScavCaseProductionStart event
|
||||||
*/
|
*/
|
||||||
scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse;
|
scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
@ -55,7 +56,7 @@ export declare class HideoutCallbacks implements OnUpdate {
|
|||||||
*/
|
*/
|
||||||
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle HideoutTakeProduction
|
* Handle HideoutTakeProduction event
|
||||||
*/
|
*/
|
||||||
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
|
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
@ -70,6 +71,10 @@ export declare class HideoutCallbacks implements OnUpdate {
|
|||||||
* Handle client/game/profile/items/moving - RecordShootingRangePoints
|
* Handle client/game/profile/items/moving - RecordShootingRangePoints
|
||||||
*/
|
*/
|
||||||
improveArea(pmcData: IPmcData, request: IHideoutImproveAreaRequestData, sessionId: string): IItemEventRouterResponse;
|
improveArea(pmcData: IPmcData, request: IHideoutImproveAreaRequestData, sessionId: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/items/moving - HideoutCancelProductionCommand
|
||||||
|
*/
|
||||||
|
cancelProduction(pmcData: IPmcData, request: IHideoutCancelProductionRequestData, sessionId: string): IItemEventRouterResponse;
|
||||||
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
||||||
getRoute(): string;
|
getRoute(): string;
|
||||||
}
|
}
|
||||||
|
4
types/callbacks/HttpCallbacks.d.ts
vendored
4
types/callbacks/HttpCallbacks.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
import { OnLoad } from "../di/OnLoad";
|
import { OnLoad } from "@spt-aki/di/OnLoad";
|
||||||
import { HttpServer } from "../servers/HttpServer";
|
import { HttpServer } from "@spt-aki/servers/HttpServer";
|
||||||
export declare class HttpCallbacks implements OnLoad {
|
export declare class HttpCallbacks implements OnLoad {
|
||||||
protected httpServer: HttpServer;
|
protected httpServer: HttpServer;
|
||||||
constructor(httpServer: HttpServer);
|
constructor(httpServer: HttpServer);
|
||||||
|
26
types/callbacks/InraidCallbacks.d.ts
vendored
26
types/callbacks/InraidCallbacks.d.ts
vendored
@ -1,8 +1,10 @@
|
|||||||
import { InraidController } from "../controllers/InraidController";
|
import { InraidController } from "@spt-aki/controllers/InraidController";
|
||||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
|
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
|
||||||
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
|
import { IItemDeliveryRequestData } from "@spt-aki/models/eft/inRaid/IItemDeliveryRequestData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IRegisterPlayerRequestData } from "@spt-aki/models/eft/inRaid/IRegisterPlayerRequestData";
|
||||||
|
import { ISaveProgressRequestData } from "@spt-aki/models/eft/inRaid/ISaveProgressRequestData";
|
||||||
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
/**
|
/**
|
||||||
* Handle client requests
|
* Handle client requests
|
||||||
*/
|
*/
|
||||||
@ -12,6 +14,7 @@ export declare class InraidCallbacks {
|
|||||||
constructor(inraidController: InraidController, httpResponse: HttpResponseUtil);
|
constructor(inraidController: InraidController, httpResponse: HttpResponseUtil);
|
||||||
/**
|
/**
|
||||||
* Handle client/location/getLocalloot
|
* Handle client/location/getLocalloot
|
||||||
|
* Store active map in profile + applicationContext
|
||||||
* @param url
|
* @param url
|
||||||
* @param info register player request
|
* @param info register player request
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
@ -46,4 +49,17 @@ export declare class InraidCallbacks {
|
|||||||
* @returns JSON as string
|
* @returns JSON as string
|
||||||
*/
|
*/
|
||||||
getAirdropConfig(): string;
|
getAirdropConfig(): string;
|
||||||
|
/**
|
||||||
|
* Handle singleplayer/btr/config
|
||||||
|
* @returns JSON as string
|
||||||
|
*/
|
||||||
|
getBTRConfig(): string;
|
||||||
|
/**
|
||||||
|
* Handle singleplayer/traderServices/getTraderServices
|
||||||
|
*/
|
||||||
|
getTraderServices(url: string, info: IEmptyRequestData, sessionId: string): string;
|
||||||
|
/**
|
||||||
|
* Handle singleplayer/traderServices/itemDelivery
|
||||||
|
*/
|
||||||
|
itemDelivery(url: string, request: IItemDeliveryRequestData, sessionId: string): INullResponseData;
|
||||||
}
|
}
|
||||||
|
26
types/callbacks/InsuranceCallbacks.d.ts
vendored
26
types/callbacks/InsuranceCallbacks.d.ts
vendored
@ -1,15 +1,15 @@
|
|||||||
import { InsuranceController } from "../controllers/InsuranceController";
|
import { InsuranceController } from "@spt-aki/controllers/InsuranceController";
|
||||||
import { OnUpdate } from "../di/OnUpdate";
|
import { OnUpdate } from "@spt-aki/di/OnUpdate";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsuranceCostRequestData";
|
import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData";
|
||||||
import { IGetInsuranceCostResponseData } from "../models/eft/insurance/IGetInsuranceCostResponseData";
|
import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData";
|
||||||
import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData";
|
import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
|
import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { InsuranceService } from "../services/InsuranceService";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
export declare class InsuranceCallbacks implements OnUpdate {
|
export declare class InsuranceCallbacks implements OnUpdate {
|
||||||
protected insuranceController: InsuranceController;
|
protected insuranceController: InsuranceController;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
@ -23,7 +23,7 @@ export declare class InsuranceCallbacks implements OnUpdate {
|
|||||||
*/
|
*/
|
||||||
getInsuranceCost(url: string, info: IGetInsuranceCostRequestData, sessionID: string): IGetBodyResponseData<IGetInsuranceCostResponseData>;
|
getInsuranceCost(url: string, info: IGetInsuranceCostRequestData, sessionID: string): IGetBodyResponseData<IGetInsuranceCostResponseData>;
|
||||||
/**
|
/**
|
||||||
* Handle Insure
|
* Handle Insure event
|
||||||
* @returns IItemEventRouterResponse
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
62
types/callbacks/InventoryCallbacks.d.ts
vendored
62
types/callbacks/InventoryCallbacks.d.ts
vendored
@ -1,41 +1,61 @@
|
|||||||
import { InventoryController } from "../controllers/InventoryController";
|
import { InventoryController } from "@spt-aki/controllers/InventoryController";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { QuestController } from "@spt-aki/controllers/QuestController";
|
||||||
import { IInventoryBindRequestData } from "../models/eft/inventory/IInventoryBindRequestData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IInventoryCreateMarkerRequestData } from "../models/eft/inventory/IInventoryCreateMarkerRequestData";
|
import { IInventoryBindRequestData } from "@spt-aki/models/eft/inventory/IInventoryBindRequestData";
|
||||||
import { IInventoryDeleteMarkerRequestData } from "../models/eft/inventory/IInventoryDeleteMarkerRequestData";
|
import { IInventoryCreateMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryCreateMarkerRequestData";
|
||||||
import { IInventoryEditMarkerRequestData } from "../models/eft/inventory/IInventoryEditMarkerRequestData";
|
import { IInventoryDeleteMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryDeleteMarkerRequestData";
|
||||||
import { IInventoryExamineRequestData } from "../models/eft/inventory/IInventoryExamineRequestData";
|
import { IInventoryEditMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryEditMarkerRequestData";
|
||||||
import { IInventoryFoldRequestData } from "../models/eft/inventory/IInventoryFoldRequestData";
|
import { IInventoryExamineRequestData } from "@spt-aki/models/eft/inventory/IInventoryExamineRequestData";
|
||||||
import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData";
|
import { IInventoryFoldRequestData } from "@spt-aki/models/eft/inventory/IInventoryFoldRequestData";
|
||||||
import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData";
|
import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData";
|
||||||
import { IInventoryReadEncyclopediaRequestData } from "../models/eft/inventory/IInventoryReadEncyclopediaRequestData";
|
import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData";
|
||||||
import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData";
|
import { IInventoryReadEncyclopediaRequestData } from "@spt-aki/models/eft/inventory/IInventoryReadEncyclopediaRequestData";
|
||||||
import { IInventorySortRequestData } from "../models/eft/inventory/IInventorySortRequestData";
|
import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData";
|
||||||
import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData";
|
import { IInventorySortRequestData } from "@spt-aki/models/eft/inventory/IInventorySortRequestData";
|
||||||
import { IInventorySwapRequestData } from "../models/eft/inventory/IInventorySwapRequestData";
|
import { IInventorySplitRequestData } from "@spt-aki/models/eft/inventory/IInventorySplitRequestData";
|
||||||
import { IInventoryTagRequestData } from "../models/eft/inventory/IInventoryTagRequestData";
|
import { IInventorySwapRequestData } from "@spt-aki/models/eft/inventory/IInventorySwapRequestData";
|
||||||
import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryToggleRequestData";
|
import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInventoryTagRequestData";
|
||||||
import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData";
|
import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData";
|
||||||
import { IOpenRandomLootContainerRequestData } from "../models/eft/inventory/IOpenRandomLootContainerRequestData";
|
import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData";
|
||||||
|
import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData";
|
||||||
|
import { ISetFavoriteItems } from "@spt-aki/models/eft/inventory/ISetFavoriteItems";
|
||||||
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
|
import { IFailQuestRequestData } from "@spt-aki/models/eft/quests/IFailQuestRequestData";
|
||||||
export declare class InventoryCallbacks {
|
export declare class InventoryCallbacks {
|
||||||
protected inventoryController: InventoryController;
|
protected inventoryController: InventoryController;
|
||||||
constructor(inventoryController: InventoryController);
|
protected questController: QuestController;
|
||||||
|
constructor(inventoryController: InventoryController, questController: QuestController);
|
||||||
|
/** Handle client/game/profile/items/moving Move event */
|
||||||
moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
|
moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle Remove event */
|
||||||
removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse;
|
removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle Split event */
|
||||||
splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;
|
splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse;
|
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse;
|
transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle Swap */
|
||||||
swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse;
|
swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
|
foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
|
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
|
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
unbindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse;
|
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle ReadEncyclopedia */
|
||||||
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
|
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle ApplyInventoryChanges */
|
||||||
sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse;
|
sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle OpenRandomLootContainer */
|
||||||
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
|
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse;
|
||||||
|
setFavoriteItem(pmcData: IPmcData, body: ISetFavoriteItems, sessionId: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* TODO - MOVE INTO QUEST CODE
|
||||||
|
* Handle game/profile/items/moving - QuestFail
|
||||||
|
*/
|
||||||
|
failQuest(pmcData: IPmcData, request: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
12
types/callbacks/ItemEventCallbacks.d.ts
vendored
12
types/callbacks/ItemEventCallbacks.d.ts
vendored
@ -1,9 +1,9 @@
|
|||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { Warning } from "../models/eft/itemEvent/IItemEventRouterBase";
|
import { Warning } from "@spt-aki/models/eft/itemEvent/IItemEventRouterBase";
|
||||||
import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest";
|
import { IItemEventRouterRequest } from "@spt-aki/models/eft/itemEvent/IItemEventRouterRequest";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
import { ItemEventRouter } from "@spt-aki/routers/ItemEventRouter";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
export declare class ItemEventCallbacks {
|
export declare class ItemEventCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected itemEventRouter: ItemEventRouter;
|
protected itemEventRouter: ItemEventRouter;
|
||||||
|
23
types/callbacks/LauncherCallbacks.d.ts
vendored
23
types/callbacks/LauncherCallbacks.d.ts
vendored
@ -1,13 +1,13 @@
|
|||||||
import { LauncherController } from "../controllers/LauncherController";
|
import { LauncherController } from "@spt-aki/controllers/LauncherController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData";
|
import { IChangeRequestData } from "@spt-aki/models/eft/launcher/IChangeRequestData";
|
||||||
import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData";
|
import { ILoginRequestData } from "@spt-aki/models/eft/launcher/ILoginRequestData";
|
||||||
import { IRegisterData } from "../models/eft/launcher/IRegisterData";
|
import { IRegisterData } from "@spt-aki/models/eft/launcher/IRegisterData";
|
||||||
import { IRemoveProfileData } from "../models/eft/launcher/IRemoveProfileData";
|
import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileData";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
import { Watermark } from "../utils/Watermark";
|
import { Watermark } from "@spt-aki/utils/Watermark";
|
||||||
declare class LauncherCallbacks {
|
export declare class LauncherCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected launcherController: LauncherController;
|
protected launcherController: LauncherController;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
@ -24,5 +24,6 @@ declare class LauncherCallbacks {
|
|||||||
ping(url: string, info: IEmptyRequestData, sessionID: string): string;
|
ping(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string;
|
removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string;
|
||||||
getCompatibleTarkovVersion(): string;
|
getCompatibleTarkovVersion(): string;
|
||||||
|
getLoadedServerMods(): string;
|
||||||
|
getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string;
|
||||||
}
|
}
|
||||||
export { LauncherCallbacks };
|
|
||||||
|
17
types/callbacks/LocationCallbacks.d.ts
vendored
17
types/callbacks/LocationCallbacks.d.ts
vendored
@ -1,15 +1,18 @@
|
|||||||
import { LocationController } from "../controllers/LocationController";
|
import { LocationController } from "@spt-aki/controllers/LocationController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
import { ILocationBase } from "@spt-aki/models/eft/common/ILocationBase";
|
||||||
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
import { ILocationsGenerateAllResponse } from "@spt-aki/models/eft/common/ILocationsSourceDestinationBase";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IGetLocationRequestData } from "../models/eft/location/IGetLocationRequestData";
|
import { IGetLocationRequestData } from "@spt-aki/models/eft/location/IGetLocationRequestData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
export declare class LocationCallbacks {
|
export declare class LocationCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected locationController: LocationController;
|
protected locationController: LocationController;
|
||||||
constructor(httpResponse: HttpResponseUtil, locationController: LocationController);
|
constructor(httpResponse: HttpResponseUtil, locationController: LocationController);
|
||||||
|
/** Handle client/locations */
|
||||||
getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILocationsGenerateAllResponse>;
|
getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILocationsGenerateAllResponse>;
|
||||||
|
/** Handle client/location/getLocalloot */
|
||||||
getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData<ILocationBase>;
|
getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData<ILocationBase>;
|
||||||
|
/** Handle client/location/getAirdropLoot */
|
||||||
getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): string;
|
getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
}
|
}
|
||||||
|
76
types/callbacks/MatchCallbacks.d.ts
vendored
76
types/callbacks/MatchCallbacks.d.ts
vendored
@ -1,46 +1,76 @@
|
|||||||
import { MatchController } from "../controllers/MatchController";
|
import { MatchController } from "@spt-aki/controllers/MatchController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
|
||||||
import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData";
|
import { IAcceptGroupInviteRequest } from "@spt-aki/models/eft/match/IAcceptGroupInviteRequest";
|
||||||
import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData";
|
import { IAcceptGroupInviteResponse } from "@spt-aki/models/eft/match/IAcceptGroupInviteResponse";
|
||||||
import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData";
|
import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGroupInviteRequest";
|
||||||
import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData";
|
import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData";
|
||||||
import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData";
|
import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData";
|
||||||
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
|
import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData";
|
||||||
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
|
import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse";
|
||||||
import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData";
|
import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData";
|
||||||
import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData";
|
import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IJoinMatchResult } from "@spt-aki/models/eft/match/IJoinMatchResult";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { IPutMetricsRequestData } from "@spt-aki/models/eft/match/IPutMetricsRequestData";
|
||||||
|
import { IRemovePlayerFromGroupRequest } from "@spt-aki/models/eft/match/IRemovePlayerFromGroupRequest";
|
||||||
|
import { ISendGroupInviteRequest } from "@spt-aki/models/eft/match/ISendGroupInviteRequest";
|
||||||
|
import { ITransferGroupRequest } from "@spt-aki/models/eft/match/ITransferGroupRequest";
|
||||||
|
import { IUpdatePingRequestData } from "@spt-aki/models/eft/match/IUpdatePingRequestData";
|
||||||
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
export declare class MatchCallbacks {
|
export declare class MatchCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
protected matchController: MatchController;
|
protected matchController: MatchController;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer);
|
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer);
|
||||||
|
/** Handle client/match/updatePing */
|
||||||
updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData;
|
updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData;
|
||||||
exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||||
|
/** Handle client/match/group/exit_from_menu */
|
||||||
exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||||
startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||||
stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||||
sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData;
|
/** Handle client/match/group/invite/send */
|
||||||
acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData;
|
sendGroupInvite(url: string, info: ISendGroupInviteRequest, sessionID: string): IGetBodyResponseData<string>;
|
||||||
cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData;
|
/** Handle client/match/group/invite/accept */
|
||||||
|
acceptGroupInvite(url: string, info: IAcceptGroupInviteRequest, sessionID: string): IGetBodyResponseData<IAcceptGroupInviteResponse[]>;
|
||||||
|
/** Handle client/match/group/invite/cancel */
|
||||||
|
cancelGroupInvite(url: string, info: ICancelGroupInviteRequest, sessionID: string): IGetBodyResponseData<boolean>;
|
||||||
|
/** Handle client/match/group/transfer */
|
||||||
|
transferGroup(url: string, info: ITransferGroupRequest, sessionID: string): IGetBodyResponseData<boolean>;
|
||||||
|
/** Handle client/match/group/invite/cancel-all */
|
||||||
|
cancelAllGroupInvite(url: string, info: any, sessionID: string): INullResponseData;
|
||||||
|
/** @deprecated - not called on raid start/end or game start/exit */
|
||||||
putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData;
|
putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData;
|
||||||
|
/** Handle raid/profile/list */
|
||||||
getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
||||||
serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any> | IGetBodyResponseData<true>;
|
serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||||
joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData<IJoinMatchResult[]>;
|
/** Handle match/group/start_game */
|
||||||
|
joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData<IJoinMatchResult>;
|
||||||
|
/** Handle client/getMetricsConfig */
|
||||||
getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<string>;
|
getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<string>;
|
||||||
/**
|
/**
|
||||||
|
* @deprecated - not called on raid start/end or game start/exit
|
||||||
* Handle client/match/group/status
|
* Handle client/match/group/status
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<any>;
|
getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<IGetGroupStatusResponse>;
|
||||||
|
/** Handle client/match/group/create */
|
||||||
createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData<any>;
|
createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||||
|
/** Handle client/match/group/delete */
|
||||||
deleteGroup(url: string, info: any, sessionID: string): INullResponseData;
|
deleteGroup(url: string, info: any, sessionID: string): INullResponseData;
|
||||||
|
leaveGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||||
|
/** Handle client/match/group/player/remove */
|
||||||
|
removePlayerFromGroup(url: string, info: IRemovePlayerFromGroupRequest, sessionID: string): INullResponseData;
|
||||||
|
/** Handle client/match/offline/end */
|
||||||
endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData;
|
endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData;
|
||||||
|
/** Handle client/raid/configuration */
|
||||||
getRaidConfiguration(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData;
|
getRaidConfiguration(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData;
|
||||||
|
/** Handle client/raid/configuration-by-profile */
|
||||||
|
getConfigurationByProfile(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData;
|
||||||
}
|
}
|
||||||
|
19
types/callbacks/ModCallbacks.d.ts
vendored
19
types/callbacks/ModCallbacks.d.ts
vendored
@ -1,12 +1,12 @@
|
|||||||
import { OnLoad } from "../di/OnLoad";
|
import { OnLoad } from "@spt-aki/di/OnLoad";
|
||||||
import { PostAkiModLoader } from "../loaders/PostAkiModLoader";
|
import { PostAkiModLoader } from "@spt-aki/loaders/PostAkiModLoader";
|
||||||
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
|
import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
import { HttpFileUtil } from "../utils/HttpFileUtil";
|
import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
declare class ModCallbacks implements OnLoad {
|
export declare class ModCallbacks implements OnLoad {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected httpFileUtil: HttpFileUtil;
|
protected httpFileUtil: HttpFileUtil;
|
||||||
@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad {
|
|||||||
onLoad(): Promise<void>;
|
onLoad(): Promise<void>;
|
||||||
getRoute(): string;
|
getRoute(): string;
|
||||||
}
|
}
|
||||||
export { ModCallbacks };
|
|
||||||
|
11
types/callbacks/NoteCallbacks.d.ts
vendored
11
types/callbacks/NoteCallbacks.d.ts
vendored
@ -1,11 +1,14 @@
|
|||||||
import { NoteController } from "../controllers/NoteController";
|
import { NoteController } from "@spt-aki/controllers/NoteController";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { INoteActionData } from "../models/eft/notes/INoteActionData";
|
import { INoteActionData } from "@spt-aki/models/eft/notes/INoteActionData";
|
||||||
export declare class NoteCallbacks {
|
export declare class NoteCallbacks {
|
||||||
protected noteController: NoteController;
|
protected noteController: NoteController;
|
||||||
constructor(noteController: NoteController);
|
constructor(noteController: NoteController);
|
||||||
|
/** Handle AddNote event */
|
||||||
addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle EditNote event */
|
||||||
editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle DeleteNote event */
|
||||||
deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
23
types/callbacks/NotifierCallbacks.d.ts
vendored
23
types/callbacks/NotifierCallbacks.d.ts
vendored
@ -1,16 +1,18 @@
|
|||||||
import { NotifierController } from "../controllers/NotifierController";
|
import { NotifierController } from "@spt-aki/controllers/NotifierController";
|
||||||
import { HttpServerHelper } from "../helpers/HttpServerHelper";
|
import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { INotifierChannel } from "../models/eft/notifier/INotifier";
|
import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier";
|
||||||
import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData";
|
import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData";
|
||||||
import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse";
|
import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
export declare class NotifierCallbacks {
|
export declare class NotifierCallbacks {
|
||||||
protected httpServerHelper: HttpServerHelper;
|
protected httpServerHelper: HttpServerHelper;
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
|
protected jsonUtil: JsonUtil;
|
||||||
protected notifierController: NotifierController;
|
protected notifierController: NotifierController;
|
||||||
constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController);
|
constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController);
|
||||||
/**
|
/**
|
||||||
* If we don't have anything to send, it's ok to not send anything back
|
* If we don't have anything to send, it's ok to not send anything back
|
||||||
* because notification requests can be long-polling. In fact, we SHOULD wait
|
* because notification requests can be long-polling. In fact, we SHOULD wait
|
||||||
@ -18,7 +20,10 @@ export declare class NotifierCallbacks {
|
|||||||
* and the client would abort the connection due to spam.
|
* and the client would abort the connection due to spam.
|
||||||
*/
|
*/
|
||||||
sendNotification(sessionID: string, req: any, resp: any, data: any): void;
|
sendNotification(sessionID: string, req: any, resp: any, data: any): void;
|
||||||
|
/** Handle push/notifier/get */
|
||||||
|
/** Handle push/notifier/getwebsocket */
|
||||||
getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData<any[]>;
|
getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
/** Handle client/notifier/channel/create */
|
||||||
createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<INotifierChannel>;
|
createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<INotifierChannel>;
|
||||||
/**
|
/**
|
||||||
* Handle client/game/profile/select
|
* Handle client/game/profile/select
|
||||||
|
4
types/callbacks/PresetCallbacks.d.ts
vendored
4
types/callbacks/PresetCallbacks.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
import { PresetController } from "../controllers/PresetController";
|
import { PresetController } from "@spt-aki/controllers/PresetController";
|
||||||
import { OnLoad } from "../di/OnLoad";
|
import { OnLoad } from "@spt-aki/di/OnLoad";
|
||||||
export declare class PresetCallbacks implements OnLoad {
|
export declare class PresetCallbacks implements OnLoad {
|
||||||
protected presetController: PresetController;
|
protected presetController: PresetController;
|
||||||
constructor(presetController: PresetController);
|
constructor(presetController: PresetController);
|
||||||
|
88
types/callbacks/ProfileCallbacks.d.ts
vendored
88
types/callbacks/ProfileCallbacks.d.ts
vendored
@ -1,34 +1,41 @@
|
|||||||
import { ProfileController } from "../controllers/ProfileController";
|
import { ProfileController } from "@spt-aki/controllers/ProfileController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IGetMiniProfileRequestData } from "../models/eft/launcher/IGetMiniProfileRequestData";
|
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
|
||||||
import { GetProfileStatusResponseData } from "../models/eft/profile/GetProfileStatusResponseData";
|
import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData";
|
||||||
import { IProfileChangeNicknameRequestData } from "../models/eft/profile/IProfileChangeNicknameRequestData";
|
import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData";
|
||||||
import { IProfileChangeVoiceRequestData } from "../models/eft/profile/IProfileChangeVoiceRequestData";
|
import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse";
|
||||||
import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateRequestData";
|
import { IGetOtherProfileRequest } from "@spt-aki/models/eft/profile/IGetOtherProfileRequest";
|
||||||
import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData";
|
import { IGetOtherProfileResponse } from "@spt-aki/models/eft/profile/IGetOtherProfileResponse";
|
||||||
import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse";
|
import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest";
|
||||||
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
|
import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { IProfileCreateRequestData } from "@spt-aki/models/eft/profile/IProfileCreateRequestData";
|
||||||
|
import { ISearchFriendRequestData } from "@spt-aki/models/eft/profile/ISearchFriendRequestData";
|
||||||
|
import { ISearchFriendResponse } from "@spt-aki/models/eft/profile/ISearchFriendResponse";
|
||||||
|
import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData";
|
||||||
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
/** Handle profile related client events */
|
/** Handle profile related client events */
|
||||||
export declare class ProfileCallbacks {
|
export declare class ProfileCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected profileController: ProfileController;
|
protected profileController: ProfileController;
|
||||||
constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, profileController: ProfileController);
|
protected profileHelper: ProfileHelper;
|
||||||
createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<any>;
|
constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, profileController: ProfileController, profileHelper: ProfileHelper);
|
||||||
/**
|
/**
|
||||||
|
* Handle client/game/profile/create
|
||||||
|
*/
|
||||||
|
createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<ICreateProfileResponse>;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/list
|
||||||
* Get the complete player profile (scav + pmc character)
|
* Get the complete player profile (scav + pmc character)
|
||||||
* @param url
|
|
||||||
* @param info Empty
|
|
||||||
* @param sessionID Session id
|
|
||||||
* @returns Profile object
|
|
||||||
*/
|
*/
|
||||||
getProfileData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
getProfileData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
||||||
/**
|
/**
|
||||||
|
* Handle client/game/profile/savage/regenerate
|
||||||
* Handle the creation of a scav profile for player
|
* Handle the creation of a scav profile for player
|
||||||
* Occurs post-raid and when profile first created immediately after character details are confirmed by player
|
* Occurs post-raid and when profile first created immediately after character details are confirmed by player
|
||||||
* @param url
|
* @param url
|
||||||
@ -39,32 +46,45 @@ export declare class ProfileCallbacks {
|
|||||||
regenerateScav(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
regenerateScav(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
||||||
/**
|
/**
|
||||||
* Handle client/game/profile/voice/change event
|
* Handle client/game/profile/voice/change event
|
||||||
* @param url
|
|
||||||
* @param info Change voice request object
|
|
||||||
* @param sessionID Session id
|
|
||||||
* @returns Client response
|
|
||||||
*/
|
*/
|
||||||
changeVoice(url: string, info: IProfileChangeVoiceRequestData, sessionID: string): INullResponseData;
|
changeVoice(url: string, info: IProfileChangeVoiceRequestData, sessionID: string): INullResponseData;
|
||||||
/**
|
/**
|
||||||
* Handle client/game/profile/nickname/change event
|
* Handle client/game/profile/nickname/change event
|
||||||
* Client allows player to adjust their profile name
|
* Client allows player to adjust their profile name
|
||||||
* @param url
|
|
||||||
* @param info Change nickname request object
|
|
||||||
* @param sessionID Session id
|
|
||||||
* @returns client response
|
|
||||||
*/
|
*/
|
||||||
changeNickname(url: string, info: IProfileChangeNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
changeNickname(url: string, info: IProfileChangeNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/nickname/validate
|
||||||
|
*/
|
||||||
validateNickname(url: string, info: IValidateNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
validateNickname(url: string, info: IValidateNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/nickname/reserved
|
||||||
|
*/
|
||||||
getReservedNickname(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
getReservedNickname(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
||||||
/**
|
/**
|
||||||
|
* Handle client/profile/status
|
||||||
* Called when creating a character when choosing a character face/voice
|
* Called when creating a character when choosing a character face/voice
|
||||||
* @param url
|
|
||||||
* @param info response (empty)
|
|
||||||
* @param sessionID
|
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
getProfileStatus(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<GetProfileStatusResponseData>;
|
getProfileStatus(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<GetProfileStatusResponseData>;
|
||||||
|
/**
|
||||||
|
* Handle client/profile/view
|
||||||
|
* Called when viewing another players profile
|
||||||
|
*/
|
||||||
|
getOtherProfile(url: string, request: IGetOtherProfileRequest, sessionID: string): IGetBodyResponseData<IGetOtherProfileResponse>;
|
||||||
|
/**
|
||||||
|
* Handle client/profile/settings
|
||||||
|
*/
|
||||||
|
getProfileSettings(url: string, info: IGetProfileSettingsRequest, sessionId: string): IGetBodyResponseData<string>;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/search
|
||||||
|
*/
|
||||||
searchFriend(url: string, info: ISearchFriendRequestData, sessionID: string): IGetBodyResponseData<ISearchFriendResponse[]>;
|
searchFriend(url: string, info: ISearchFriendRequestData, sessionID: string): IGetBodyResponseData<ISearchFriendResponse[]>;
|
||||||
|
/**
|
||||||
|
* Handle launcher/profile/info
|
||||||
|
*/
|
||||||
getMiniProfile(url: string, info: IGetMiniProfileRequestData, sessionID: string): string;
|
getMiniProfile(url: string, info: IGetMiniProfileRequestData, sessionID: string): string;
|
||||||
getAllMiniProfiles(url: string, info: any, sessionID: string): string;
|
/**
|
||||||
|
* Handle /launcher/profiles
|
||||||
|
*/
|
||||||
|
getAllMiniProfiles(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
}
|
}
|
||||||
|
47
types/callbacks/QuestCallbacks.d.ts
vendored
47
types/callbacks/QuestCallbacks.d.ts
vendored
@ -1,33 +1,44 @@
|
|||||||
import { QuestController } from "../controllers/QuestController";
|
import { QuestController } from "@spt-aki/controllers/QuestController";
|
||||||
import { RepeatableQuestController } from "../controllers/RepeatableQuestController";
|
import { RepeatableQuestController } from "@spt-aki/controllers/RepeatableQuestController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IQuest } from "../models/eft/common/tables/IQuest";
|
import { IQuest } from "@spt-aki/models/eft/common/tables/IQuest";
|
||||||
import { IPmcDataRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
|
import { IPmcDataRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
|
import { IAcceptQuestRequestData } from "@spt-aki/models/eft/quests/IAcceptQuestRequestData";
|
||||||
import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData";
|
import { ICompleteQuestRequestData } from "@spt-aki/models/eft/quests/ICompleteQuestRequestData";
|
||||||
import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData";
|
import { IHandoverQuestRequestData } from "@spt-aki/models/eft/quests/IHandoverQuestRequestData";
|
||||||
import { IListQuestsRequestData } from "../models/eft/quests/IListQuestsRequestData";
|
import { IListQuestsRequestData } from "@spt-aki/models/eft/quests/IListQuestsRequestData";
|
||||||
import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest";
|
import { IRepeatableQuestChangeRequest } from "@spt-aki/models/eft/quests/IRepeatableQuestChangeRequest";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
export declare class QuestCallbacks {
|
export declare class QuestCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected questController: QuestController;
|
protected questController: QuestController;
|
||||||
protected repeatableQuestController: RepeatableQuestController;
|
protected repeatableQuestController: RepeatableQuestController;
|
||||||
constructor(httpResponse: HttpResponseUtil, questController: QuestController, repeatableQuestController: RepeatableQuestController);
|
constructor(httpResponse: HttpResponseUtil, questController: QuestController, repeatableQuestController: RepeatableQuestController);
|
||||||
|
/**
|
||||||
|
* Handle RepeatableQuestChange event
|
||||||
|
*/
|
||||||
changeRepeatableQuest(pmcData: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
|
changeRepeatableQuest(pmcData: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle QuestAccept event
|
||||||
|
*/
|
||||||
acceptQuest(pmcData: IPmcData, body: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
acceptQuest(pmcData: IPmcData, body: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle QuestComplete event
|
||||||
|
*/
|
||||||
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle QuestHandover event
|
||||||
|
*/
|
||||||
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle client/quest/list
|
* Handle client/quest/list
|
||||||
* @param url
|
|
||||||
* @param info
|
|
||||||
* @param sessionID
|
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
listQuests(url: string, info: IListQuestsRequestData, sessionID: string): IGetBodyResponseData<IQuest[]>;
|
listQuests(url: string, info: IListQuestsRequestData, sessionID: string): IGetBodyResponseData<IQuest[]>;
|
||||||
|
/**
|
||||||
|
* Handle client/repeatalbeQuests/activityPeriods
|
||||||
|
*/
|
||||||
activityPeriods(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcDataRepeatableQuest[]>;
|
activityPeriods(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcDataRepeatableQuest[]>;
|
||||||
}
|
}
|
||||||
|
63
types/callbacks/RagfairCallbacks.d.ts
vendored
63
types/callbacks/RagfairCallbacks.d.ts
vendored
@ -1,24 +1,28 @@
|
|||||||
import { OnLoad } from "../di/OnLoad";
|
import { RagfairController } from "@spt-aki/controllers/RagfairController";
|
||||||
import { OnUpdate } from "../di/OnUpdate";
|
import { OnLoad } from "@spt-aki/di/OnLoad";
|
||||||
import { RagfairController } from "../controllers/RagfairController";
|
import { OnUpdate } from "@spt-aki/di/OnUpdate";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IAddOfferRequestData } from "../models/eft/ragfair/IAddOfferRequestData";
|
import { IAddOfferRequestData } from "@spt-aki/models/eft/ragfair/IAddOfferRequestData";
|
||||||
import { IExtendOfferRequestData } from "../models/eft/ragfair/IExtendOfferRequestData";
|
import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOfferRequestData";
|
||||||
import { IGetItemPriceResult } from "../models/eft/ragfair/IGetItemPriceResult";
|
import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult";
|
||||||
import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPriceRequestData";
|
import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData";
|
||||||
import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
|
import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult";
|
||||||
import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData";
|
import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest";
|
||||||
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
|
import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
|
||||||
import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData";
|
import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData";
|
||||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData";
|
||||||
import { RagfairServer } from "../servers/RagfairServer";
|
import { IStorePlayerOfferTaxAmountRequestData } from "@spt-aki/models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
|
import { RagfairServer } from "@spt-aki/servers/RagfairServer";
|
||||||
|
import { RagfairTaxService } from "@spt-aki/services/RagfairTaxService";
|
||||||
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
/**
|
/**
|
||||||
* Handle ragfair related callback events
|
* Handle ragfair related callback events
|
||||||
*/
|
*/
|
||||||
@ -27,21 +31,34 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
|
|||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
protected ragfairServer: RagfairServer;
|
protected ragfairServer: RagfairServer;
|
||||||
protected ragfairController: RagfairController;
|
protected ragfairController: RagfairController;
|
||||||
|
protected ragfairTaxService: RagfairTaxService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer);
|
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, ragfairTaxService: RagfairTaxService, configServer: ConfigServer);
|
||||||
onLoad(): Promise<void>;
|
onLoad(): Promise<void>;
|
||||||
getRoute(): string;
|
getRoute(): string;
|
||||||
|
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
||||||
|
/**
|
||||||
|
* Handle client/ragfair/search
|
||||||
|
* Handle client/ragfair/find
|
||||||
|
*/
|
||||||
search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData<IGetOffersResult>;
|
search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData<IGetOffersResult>;
|
||||||
|
/** Handle client/ragfair/itemMarketPrice */
|
||||||
getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData<IGetItemPriceResult>;
|
getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData<IGetItemPriceResult>;
|
||||||
|
/** Handle RagFairAddOffer event */
|
||||||
addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle RagFairRemoveOffer event */
|
||||||
removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle RagFairRenewOffer event */
|
||||||
extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle /client/items/prices
|
* Handle /client/items/prices
|
||||||
* Called when clicking an item to list on flea
|
* Called when clicking an item to list on flea
|
||||||
*/
|
*/
|
||||||
getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>>;
|
getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>>;
|
||||||
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
/** Handle client/reports/ragfair/send */
|
||||||
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
|
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
|
||||||
|
storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData;
|
||||||
|
/** Handle client/ragfair/offer/findbyid */
|
||||||
|
getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData<IRagfairOffer>;
|
||||||
}
|
}
|
||||||
|
32
types/callbacks/RepairCallbacks.d.ts
vendored
32
types/callbacks/RepairCallbacks.d.ts
vendored
@ -1,25 +1,27 @@
|
|||||||
import { RepairController } from "../controllers/RepairController";
|
import { RepairController } from "@spt-aki/controllers/RepairController";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionDataRequest";
|
import { IRepairActionDataRequest } from "@spt-aki/models/eft/repair/IRepairActionDataRequest";
|
||||||
import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest";
|
import { ITraderRepairActionDataRequest } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest";
|
||||||
export declare class RepairCallbacks {
|
export declare class RepairCallbacks {
|
||||||
protected repairController: RepairController;
|
protected repairController: RepairController;
|
||||||
constructor(repairController: RepairController);
|
constructor(repairController: RepairController);
|
||||||
/**
|
/**
|
||||||
|
* Handle TraderRepair event
|
||||||
* use trader to repair item
|
* use trader to repair item
|
||||||
* @param pmcData
|
* @param pmcData Player profile
|
||||||
* @param body
|
* @param traderRepairRequest Request object
|
||||||
* @param sessionID
|
* @param sessionID Session id
|
||||||
* @returns
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
traderRepair(pmcData: IPmcData, body: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
|
traderRepair(pmcData: IPmcData, traderRepairRequest: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle Repair event
|
||||||
* Use repair kit to repair item
|
* Use repair kit to repair item
|
||||||
* @param pmcData
|
* @param pmcData Player profile
|
||||||
* @param body
|
* @param repairRequest Request object
|
||||||
* @param sessionID
|
* @param sessionID Session id
|
||||||
* @returns
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
repair(pmcData: IPmcData, body: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
|
repair(pmcData: IPmcData, repairRequest: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
12
types/callbacks/SaveCallbacks.d.ts
vendored
12
types/callbacks/SaveCallbacks.d.ts
vendored
@ -1,9 +1,13 @@
|
|||||||
import { OnLoad } from "../di/OnLoad";
|
import { OnLoad } from "@spt-aki/di/OnLoad";
|
||||||
import { OnUpdate } from "../di/OnUpdate";
|
import { OnUpdate } from "@spt-aki/di/OnUpdate";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig";
|
||||||
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
export declare class SaveCallbacks implements OnLoad, OnUpdate {
|
export declare class SaveCallbacks implements OnLoad, OnUpdate {
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
constructor(saveServer: SaveServer);
|
protected configServer: ConfigServer;
|
||||||
|
protected coreConfig: ICoreConfig;
|
||||||
|
constructor(saveServer: SaveServer, configServer: ConfigServer);
|
||||||
onLoad(): Promise<void>;
|
onLoad(): Promise<void>;
|
||||||
getRoute(): string;
|
getRoute(): string;
|
||||||
onUpdate(secondsSinceLastRun: number): Promise<boolean>;
|
onUpdate(secondsSinceLastRun: number): Promise<boolean>;
|
||||||
|
16
types/callbacks/TradeCallbacks.d.ts
vendored
16
types/callbacks/TradeCallbacks.d.ts
vendored
@ -1,14 +1,18 @@
|
|||||||
import { TradeController } from "../controllers/TradeController";
|
import { TradeController } from "@spt-aki/controllers/TradeController";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
|
import { IProcessBaseTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBaseTradeRequestData";
|
||||||
import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
|
import { IProcessRagfairTradeRequestData } from "@spt-aki/models/eft/trade/IProcessRagfairTradeRequestData";
|
||||||
|
import { ISellScavItemsToFenceRequestData } from "@spt-aki/models/eft/trade/ISellScavItemsToFenceRequestData";
|
||||||
export declare class TradeCallbacks {
|
export declare class TradeCallbacks {
|
||||||
protected tradeController: TradeController;
|
protected tradeController: TradeController;
|
||||||
constructor(tradeController: TradeController);
|
constructor(tradeController: TradeController);
|
||||||
/**
|
/**
|
||||||
* Handle client/game/profile/items/moving TradingConfirm
|
* Handle client/game/profile/items/moving TradingConfirm event
|
||||||
*/
|
*/
|
||||||
processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle RagFairBuyOffer event */
|
||||||
processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle SellAllFromSavage event */
|
||||||
|
sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
25
types/callbacks/TraderCallbacks.d.ts
vendored
25
types/callbacks/TraderCallbacks.d.ts
vendored
@ -1,23 +1,22 @@
|
|||||||
import { OnLoad } from "../di/OnLoad";
|
import { TraderController } from "@spt-aki/controllers/TraderController";
|
||||||
import { OnUpdate } from "../di/OnUpdate";
|
import { OnLoad } from "@spt-aki/di/OnLoad";
|
||||||
import { TraderController } from "../controllers/TraderController";
|
import { OnUpdate } from "@spt-aki/di/OnUpdate";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
|
import { ITraderAssort, ITraderBase } from "@spt-aki/models/eft/common/tables/ITrader";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
export declare class TraderCallbacks implements OnLoad, OnUpdate {
|
export declare class TraderCallbacks implements OnLoad, OnUpdate {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected traderController: TraderController;
|
protected traderController: TraderController;
|
||||||
constructor(httpResponse: HttpResponseUtil, traderController: TraderController);
|
constructor(httpResponse: HttpResponseUtil, // TODO: delay required
|
||||||
|
traderController: TraderController);
|
||||||
onLoad(): Promise<void>;
|
onLoad(): Promise<void>;
|
||||||
onUpdate(): Promise<boolean>;
|
onUpdate(): Promise<boolean>;
|
||||||
getRoute(): string;
|
getRoute(): string;
|
||||||
|
/** Handle client/trading/api/traderSettings */
|
||||||
getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]>;
|
getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]>;
|
||||||
/**
|
/** Handle client/trading/api/getTrader */
|
||||||
* Handle client/trading/api/getUserAssortPrice/trader
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, IBarterScheme[][]>>;
|
|
||||||
getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase>;
|
getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase>;
|
||||||
|
/** Handle client/trading/api/getTraderAssort */
|
||||||
getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>;
|
getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>;
|
||||||
}
|
}
|
||||||
|
10
types/callbacks/WeatherCallbacks.d.ts
vendored
10
types/callbacks/WeatherCallbacks.d.ts
vendored
@ -1,8 +1,8 @@
|
|||||||
import { WeatherController } from "../controllers/WeatherController";
|
import { WeatherController } from "@spt-aki/controllers/WeatherController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IWeatherData } from "../models/eft/weather/IWeatherData";
|
import { IWeatherData } from "@spt-aki/models/eft/weather/IWeatherData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
export declare class WeatherCallbacks {
|
export declare class WeatherCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected weatherController: WeatherController;
|
protected weatherController: WeatherController;
|
||||||
|
10
types/callbacks/WishlistCallbacks.d.ts
vendored
10
types/callbacks/WishlistCallbacks.d.ts
vendored
@ -1,10 +1,12 @@
|
|||||||
import { WishlistController } from "../controllers/WishlistController";
|
import { WishlistController } from "@spt-aki/controllers/WishlistController";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData";
|
import { IWishlistActionData } from "@spt-aki/models/eft/wishlist/IWishlistActionData";
|
||||||
export declare class WishlistCallbacks {
|
export declare class WishlistCallbacks {
|
||||||
protected wishlistController: WishlistController;
|
protected wishlistController: WishlistController;
|
||||||
constructor(wishlistController: WishlistController);
|
constructor(wishlistController: WishlistController);
|
||||||
|
/** Handle AddToWishList event */
|
||||||
addToWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
addToWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle RemoveFromWishList event */
|
||||||
removeFromWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
removeFromWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
14
types/context/ApplicationContext.d.ts
vendored
14
types/context/ApplicationContext.d.ts
vendored
@ -1,18 +1,20 @@
|
|||||||
import { ContextVariable } from "./ContextVariable";
|
import { ContextVariable } from "@spt-aki/context/ContextVariable";
|
||||||
import { ContextVariableType } from "./ContextVariableType";
|
import { ContextVariableType } from "@spt-aki/context/ContextVariableType";
|
||||||
export declare class ApplicationContext {
|
export declare class ApplicationContext {
|
||||||
private variables;
|
private variables;
|
||||||
private static holderMaxSize;
|
private static holderMaxSize;
|
||||||
/**
|
/**
|
||||||
* Called like:
|
* Called like:
|
||||||
*
|
* ```
|
||||||
* const registerPlayerInfo = this.applicationContext.getLatestValue(ContextVariableType.REGISTER_PLAYER_REQUEST).getValue<IRegisterPlayerRequestData>();
|
* const registerPlayerInfo = this.applicationContext.getLatestValue(ContextVariableType.REGISTER_PLAYER_REQUEST).getValue<IRegisterPlayerRequestData>();
|
||||||
*
|
*
|
||||||
* const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.MATCH_INFO).getValue<IStartOfflineRaidRequestData>();
|
* const activePlayerSessionId = this.applicationContext.getLatestValue(ContextVariableType.SESSION_ID).getValue<string>();
|
||||||
* @param type
|
*
|
||||||
* @returns
|
* const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue<IGetRaidConfigurationRequestData>();
|
||||||
|
* ```
|
||||||
*/
|
*/
|
||||||
getLatestValue(type: ContextVariableType): ContextVariable;
|
getLatestValue(type: ContextVariableType): ContextVariable;
|
||||||
getValues(type: ContextVariableType): ContextVariable[];
|
getValues(type: ContextVariableType): ContextVariable[];
|
||||||
addValue(type: ContextVariableType, value: any): void;
|
addValue(type: ContextVariableType, value: any): void;
|
||||||
|
clearValues(type: ContextVariableType): void;
|
||||||
}
|
}
|
||||||
|
2
types/context/ContextVariable.d.ts
vendored
2
types/context/ContextVariable.d.ts
vendored
@ -1,4 +1,4 @@
|
|||||||
import { ContextVariableType } from "./ContextVariableType";
|
import { ContextVariableType } from "@spt-aki/context/ContextVariableType";
|
||||||
export declare class ContextVariable {
|
export declare class ContextVariable {
|
||||||
private value;
|
private value;
|
||||||
private timestamp;
|
private timestamp;
|
||||||
|
3
types/context/ContextVariableType.d.ts
vendored
3
types/context/ContextVariableType.d.ts
vendored
@ -6,5 +6,6 @@ export declare enum ContextVariableType {
|
|||||||
/** Timestamp when client first connected */
|
/** Timestamp when client first connected */
|
||||||
CLIENT_START_TIMESTAMP = 2,
|
CLIENT_START_TIMESTAMP = 2,
|
||||||
/** When player is loading into map and loot is requested */
|
/** When player is loading into map and loot is requested */
|
||||||
REGISTER_PLAYER_REQUEST = 3
|
REGISTER_PLAYER_REQUEST = 3,
|
||||||
|
RAID_ADJUSTMENTS = 4
|
||||||
}
|
}
|
||||||
|
23
types/controllers/AchievementController.d.ts
vendored
Normal file
23
types/controllers/AchievementController.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { ICompletedAchievementsResponse } from "@spt-aki/models/eft/profile/ICompletedAchievementsResponse";
|
||||||
|
import { IGetAchievementsResponse } from "@spt-aki/models/eft/profile/IGetAchievementsResponse";
|
||||||
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
|
/**
|
||||||
|
* Logic for handling In Raid callbacks
|
||||||
|
*/
|
||||||
|
export declare class AchievementController {
|
||||||
|
protected logger: ILogger;
|
||||||
|
protected databaseServer: DatabaseServer;
|
||||||
|
constructor(logger: ILogger, databaseServer: DatabaseServer);
|
||||||
|
/**
|
||||||
|
* Get base achievements
|
||||||
|
* @param sessionID Session id
|
||||||
|
*/
|
||||||
|
getAchievements(sessionID: string): IGetAchievementsResponse;
|
||||||
|
/**
|
||||||
|
* Shows % of 'other' players who've completed each achievement
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @returns ICompletedAchievementsResponse
|
||||||
|
*/
|
||||||
|
getAchievementStatistics(sessionId: string): ICompletedAchievementsResponse;
|
||||||
|
}
|
74
types/controllers/BotController.d.ts
vendored
74
types/controllers/BotController.d.ts
vendored
@ -1,19 +1,24 @@
|
|||||||
import { ApplicationContext } from "../context/ApplicationContext";
|
import { ApplicationContext } from "@spt-aki/context/ApplicationContext";
|
||||||
import { BotGenerator } from "../generators/BotGenerator";
|
import { BotGenerator } from "@spt-aki/generators/BotGenerator";
|
||||||
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
|
import { BotDifficultyHelper } from "@spt-aki/helpers/BotDifficultyHelper";
|
||||||
import { BotHelper } from "../helpers/BotHelper";
|
import { BotHelper } from "@spt-aki/helpers/BotHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData";
|
import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData";
|
||||||
import { IBotBase } from "../models/eft/common/tables/IBotBase";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IBotCore } from "../models/eft/common/tables/IBotCore";
|
import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||||
import { Difficulty } from "../models/eft/common/tables/IBotType";
|
import { IBotCore } from "@spt-aki/models/eft/common/tables/IBotCore";
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { Difficulty } from "@spt-aki/models/eft/common/tables/IBotType";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { BotGenerationCacheService } from "@spt-aki/services/BotGenerationCacheService";
|
||||||
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
|
import { MatchBotDetailsCacheService } from "@spt-aki/services/MatchBotDetailsCacheService";
|
||||||
|
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
export declare class BotController {
|
export declare class BotController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
@ -21,22 +26,26 @@ export declare class BotController {
|
|||||||
protected botHelper: BotHelper;
|
protected botHelper: BotHelper;
|
||||||
protected botDifficultyHelper: BotDifficultyHelper;
|
protected botDifficultyHelper: BotDifficultyHelper;
|
||||||
protected botGenerationCacheService: BotGenerationCacheService;
|
protected botGenerationCacheService: BotGenerationCacheService;
|
||||||
|
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
|
protected seasonalEventService: SeasonalEventService;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected applicationContext: ApplicationContext;
|
protected applicationContext: ApplicationContext;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
static readonly pmcTypeLabel = "PMC";
|
protected pmcConfig: IPmcConfig;
|
||||||
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
|
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, jsonUtil: JsonUtil);
|
||||||
/**
|
/**
|
||||||
* Return the number of bot loadout varieties to be generated
|
* Return the number of bot load-out varieties to be generated
|
||||||
* @param type bot Type we want the loadout gen count for
|
* @param type bot Type we want the load-out gen count for
|
||||||
* @returns number of bots to generate
|
* @returns number of bots to generate
|
||||||
*/
|
*/
|
||||||
getBotPresetGenerationLimit(type: string): number;
|
getBotPresetGenerationLimit(type: string): number;
|
||||||
/**
|
/**
|
||||||
* Get the core.json difficulty settings from database\bots
|
* Handle singleplayer/settings/bot/difficulty
|
||||||
|
* Get the core.json difficulty settings from database/bots
|
||||||
* @returns IBotCore
|
* @returns IBotCore
|
||||||
*/
|
*/
|
||||||
getBotCoreDifficulty(): IBotCore;
|
getBotCoreDifficulty(): IBotCore;
|
||||||
@ -44,10 +53,10 @@ export declare class BotController {
|
|||||||
* Get bot difficulty settings
|
* Get bot difficulty settings
|
||||||
* adjust PMC settings to ensure they engage the correct bot types
|
* adjust PMC settings to ensure they engage the correct bot types
|
||||||
* @param type what bot the server is requesting settings for
|
* @param type what bot the server is requesting settings for
|
||||||
* @param difficulty difficulty level server requested settings for
|
* @param diffLevel difficulty level server requested settings for
|
||||||
* @returns Difficulty object
|
* @returns Difficulty object
|
||||||
*/
|
*/
|
||||||
getBotDifficulty(type: string, difficulty: string): Difficulty;
|
getBotDifficulty(type: string, diffLevel: string): Difficulty;
|
||||||
/**
|
/**
|
||||||
* Generate bot profiles and store in cache
|
* Generate bot profiles and store in cache
|
||||||
* @param sessionId Session id
|
* @param sessionId Session id
|
||||||
@ -56,7 +65,22 @@ export declare class BotController {
|
|||||||
*/
|
*/
|
||||||
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
|
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
|
||||||
/**
|
/**
|
||||||
* Get the difficulty passed in, if its not "asoline", get selected difficulty from config
|
* On first bot generation bots are generated and stored inside a cache, ready to be used later
|
||||||
|
* @param request Bot generation request object
|
||||||
|
* @param pmcProfile Player profile
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
protected generateBotsFirstTime(request: IGenerateBotsRequestData, pmcProfile: IPmcData, sessionId: string): IBotBase[];
|
||||||
|
/**
|
||||||
|
* Pull a single bot out of cache and return, if cache is empty add bots to it and then return
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param request Bot generation request object
|
||||||
|
* @returns Single IBotBase object
|
||||||
|
*/
|
||||||
|
protected returnSingleBotFromCache(sessionId: string, request: IGenerateBotsRequestData): IBotBase[];
|
||||||
|
/**
|
||||||
|
* Get the difficulty passed in, if its not "asonline", get selected difficulty from config
|
||||||
* @param requestedDifficulty
|
* @param requestedDifficulty
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
@ -67,5 +91,5 @@ export declare class BotController {
|
|||||||
* @returns cap number
|
* @returns cap number
|
||||||
*/
|
*/
|
||||||
getBotCap(): number;
|
getBotCap(): number;
|
||||||
getPmcBotTypes(): Record<string, Record<string, Record<string, number>>>;
|
getAiBotBrainTypes(): any;
|
||||||
}
|
}
|
||||||
|
36
types/controllers/BuildController.d.ts
vendored
Normal file
36
types/controllers/BuildController.d.ts
vendored
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
|
import { ISetMagazineRequest } from "@spt-aki/models/eft/builds/ISetMagazineRequest";
|
||||||
|
import { IPresetBuildActionRequestData } from "@spt-aki/models/eft/presetBuild/IPresetBuildActionRequestData";
|
||||||
|
import { IRemoveBuildRequestData } from "@spt-aki/models/eft/presetBuild/IRemoveBuildRequestData";
|
||||||
|
import { IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
|
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||||
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
export declare class BuildController {
|
||||||
|
protected logger: ILogger;
|
||||||
|
protected hashUtil: HashUtil;
|
||||||
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
|
protected jsonUtil: JsonUtil;
|
||||||
|
protected databaseServer: DatabaseServer;
|
||||||
|
protected profileHelper: ProfileHelper;
|
||||||
|
protected itemHelper: ItemHelper;
|
||||||
|
protected saveServer: SaveServer;
|
||||||
|
constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, saveServer: SaveServer);
|
||||||
|
/** Handle client/handbook/builds/my/list */
|
||||||
|
getUserBuilds(sessionID: string): IUserBuilds;
|
||||||
|
/** Handle client/builds/weapon/save */
|
||||||
|
saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void;
|
||||||
|
/** Handle client/builds/equipment/save event */
|
||||||
|
saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void;
|
||||||
|
/** Handle client/builds/delete*/
|
||||||
|
removeBuild(sessionID: string, request: IRemoveBuildRequestData): void;
|
||||||
|
protected removePlayerBuild(id: string, sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Handle client/builds/magazine/save
|
||||||
|
*/
|
||||||
|
createMagazineTemplate(sessionId: string, request: ISetMagazineRequest): void;
|
||||||
|
}
|
10
types/controllers/ClientLogController.d.ts
vendored
Normal file
10
types/controllers/ClientLogController.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { IClientLogRequest } from "@spt-aki/models/spt/logging/IClientLogRequest";
|
||||||
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
|
export declare class ClientLogController {
|
||||||
|
protected logger: ILogger;
|
||||||
|
constructor(logger: ILogger);
|
||||||
|
/**
|
||||||
|
* Handle /singleplayer/log
|
||||||
|
*/
|
||||||
|
clientLog(logRequest: IClientLogRequest): void;
|
||||||
|
}
|
72
types/controllers/CustomizationController.d.ts
vendored
72
types/controllers/CustomizationController.d.ts
vendored
@ -1,14 +1,14 @@
|
|||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { ISuit } from "../models/eft/common/tables/ITrader";
|
import { ISuit } from "@spt-aki/models/eft/common/tables/ITrader";
|
||||||
import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothingRequestData";
|
import { ClothingItem, IBuyClothingRequestData } from "@spt-aki/models/eft/customization/IBuyClothingRequestData";
|
||||||
import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData";
|
import { IWearClothingRequestData } from "@spt-aki/models/eft/customization/IWearClothingRequestData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
export declare class CustomizationController {
|
export declare class CustomizationController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
@ -16,9 +16,55 @@ export declare class CustomizationController {
|
|||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
|
protected readonly clothingIds: {
|
||||||
|
lowerParentId: string;
|
||||||
|
upperParentId: string;
|
||||||
|
};
|
||||||
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper);
|
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper);
|
||||||
|
/**
|
||||||
|
* Get purchasable clothing items from trader that match players side (usec/bear)
|
||||||
|
* @param traderID trader to look up clothing for
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns ISuit array
|
||||||
|
*/
|
||||||
getTraderSuits(traderID: string, sessionID: string): ISuit[];
|
getTraderSuits(traderID: string, sessionID: string): ISuit[];
|
||||||
wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
/**
|
||||||
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
* Handle CustomizationWear event
|
||||||
|
* Equip one to many clothing items to player
|
||||||
|
*/
|
||||||
|
wearClothing(pmcData: IPmcData, wearClothingRequest: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle CustomizationBuy event
|
||||||
|
* Purchase/unlock a clothing item from a trader
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param buyClothingRequest Request object
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
buyClothing(pmcData: IPmcData, buyClothingRequest: IBuyClothingRequestData, sessionId: string): IItemEventRouterResponse;
|
||||||
|
protected getTraderClothingOffer(sessionId: string, offerId: string): ISuit;
|
||||||
|
/**
|
||||||
|
* Has an outfit been purchased by a player
|
||||||
|
* @param suitId clothing id
|
||||||
|
* @param sessionID Session id of profile to check for clothing in
|
||||||
|
* @returns true if already purchased
|
||||||
|
*/
|
||||||
|
protected outfitAlreadyPurchased(suitId: string, sessionID: string): boolean;
|
||||||
|
/**
|
||||||
|
* Update output object and player profile with purchase details
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param clothingItems Clothing purchased
|
||||||
|
* @param output Client response
|
||||||
|
*/
|
||||||
|
protected payForClothingItems(sessionId: string, pmcData: IPmcData, clothingItems: ClothingItem[], output: IItemEventRouterResponse): void;
|
||||||
|
/**
|
||||||
|
* Update output object and player profile with purchase details for single piece of clothing
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param clothingItem Clothing item purchased
|
||||||
|
* @param output Client response
|
||||||
|
*/
|
||||||
|
protected payForClothingItem(sessionId: string, pmcData: IPmcData, clothingItem: ClothingItem, output: IItemEventRouterResponse): void;
|
||||||
protected getAllTraderSuits(sessionID: string): ISuit[];
|
protected getAllTraderSuits(sessionID: string): ISuit[];
|
||||||
}
|
}
|
||||||
|
113
types/controllers/DialogueController.d.ts
vendored
113
types/controllers/DialogueController.d.ts
vendored
@ -1,18 +1,36 @@
|
|||||||
import { DialogueHelper } from "../helpers/DialogueHelper";
|
import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot";
|
||||||
import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse";
|
import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper";
|
||||||
import { IGetFriendListDataResponse } from "../models/eft/dialog/IGetFriendListDataResponse";
|
import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse";
|
||||||
import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDialogViewResponseData";
|
import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse";
|
||||||
import { DialogueInfo, Message } from "../models/eft/profile/IAkiProfile";
|
import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewResponseData";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||||
|
import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
|
import { MessageType } from "@spt-aki/models/enums/MessageType";
|
||||||
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
export declare class DialogueController {
|
export declare class DialogueController {
|
||||||
|
protected logger: ILogger;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected dialogueHelper: DialogueHelper;
|
protected dialogueHelper: DialogueHelper;
|
||||||
constructor(saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper);
|
protected mailSendService: MailSendService;
|
||||||
|
protected configServer: ConfigServer;
|
||||||
|
protected dialogueChatBots: IDialogueChatBot[];
|
||||||
|
constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]);
|
||||||
|
registerChatBot(chatBot: IDialogueChatBot): void;
|
||||||
|
/** Handle onUpdate spt event */
|
||||||
update(): void;
|
update(): void;
|
||||||
|
/**
|
||||||
|
* Handle client/friend/list
|
||||||
|
* @returns IGetFriendListDataResponse
|
||||||
|
*/
|
||||||
getFriendList(sessionID: string): IGetFriendListDataResponse;
|
getFriendList(sessionID: string): IGetFriendListDataResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle client/mail/dialog/list
|
||||||
* Create array holding trader dialogs and mail interactions with player
|
* Create array holding trader dialogs and mail interactions with player
|
||||||
* Set the content of the dialogue on the list tab.
|
* Set the content of the dialogue on the list tab.
|
||||||
* @param sessionID Session Id
|
* @param sessionID Session Id
|
||||||
@ -27,14 +45,37 @@ export declare class DialogueController {
|
|||||||
*/
|
*/
|
||||||
getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo;
|
getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo;
|
||||||
/**
|
/**
|
||||||
|
* Get the users involved in a dialog (player + other party)
|
||||||
|
* @param dialog The dialog to check for users
|
||||||
|
* @param messageType What type of message is being sent
|
||||||
|
* @param sessionID Player id
|
||||||
|
* @returns IUserDialogInfo array
|
||||||
|
*/
|
||||||
|
getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[];
|
||||||
|
/**
|
||||||
|
* Handle client/mail/dialog/view
|
||||||
* Handle player clicking 'messenger' and seeing all the messages they've recieved
|
* 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
|
* Set the content of the dialogue on the details panel, showing all the messages
|
||||||
* for the specified dialogue.
|
* for the specified dialogue.
|
||||||
* @param dialogueID Dialog id
|
* @param request Get dialog request
|
||||||
* @param sessionID Session id
|
* @param sessionId Session id
|
||||||
* @returns IGetMailDialogViewResponseData object
|
* @returns IGetMailDialogViewResponseData object
|
||||||
*/
|
*/
|
||||||
generateDialogueView(dialogueID: string, sessionID: string): IGetMailDialogViewResponseData;
|
generateDialogueView(request: IGetMailDialogViewRequestData, sessionId: string): IGetMailDialogViewResponseData;
|
||||||
|
/**
|
||||||
|
* Get dialog from player profile, create if doesn't exist
|
||||||
|
* @param profile Player profile
|
||||||
|
* @param request get dialog request (params used when dialog doesnt exist in profile)
|
||||||
|
* @returns Dialogue
|
||||||
|
*/
|
||||||
|
protected getDialogByIdFromProfile(profile: IAkiProfile, request: IGetMailDialogViewRequestData): Dialogue;
|
||||||
|
/**
|
||||||
|
* Get the users involved in a mail between two entities
|
||||||
|
* @param fullProfile Player profile
|
||||||
|
* @param dialogUsers The participants of the mail
|
||||||
|
* @returns IUserDialogInfo array
|
||||||
|
*/
|
||||||
|
protected getProfilesForMail(fullProfile: IAkiProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[];
|
||||||
/**
|
/**
|
||||||
* Get a count of messages with attachments from a particular dialog
|
* Get a count of messages with attachments from a particular dialog
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
@ -48,16 +89,32 @@ export declare class DialogueController {
|
|||||||
* @returns true if uncollected rewards found
|
* @returns true if uncollected rewards found
|
||||||
*/
|
*/
|
||||||
protected messagesHaveUncollectedRewards(messages: Message[]): boolean;
|
protected messagesHaveUncollectedRewards(messages: Message[]): boolean;
|
||||||
removeDialogue(dialogueID: string, sessionID: string): void;
|
|
||||||
setDialoguePin(dialogueID: string, shouldPin: boolean, sessionID: string): void;
|
|
||||||
setRead(dialogueIDs: string[], sessionID: string): void;
|
|
||||||
/**
|
/**
|
||||||
* Get all uncollected items attached to mail in a particular dialog
|
* Handle client/mail/dialog/remove
|
||||||
* @param dialogueID Dialog to get mail attachments from
|
* Remove an entire dialog with an entity (trader/user)
|
||||||
* @param sessionID Session id
|
* @param dialogueId id of the dialog to remove
|
||||||
* @returns
|
* @param sessionId Player id
|
||||||
*/
|
*/
|
||||||
getAllAttachments(dialogueID: string, sessionID: string): IGetAllAttachmentsResponse;
|
removeDialogue(dialogueId: string, sessionId: string): void;
|
||||||
|
/** Handle client/mail/dialog/pin && Handle client/mail/dialog/unpin */
|
||||||
|
setDialoguePin(dialogueId: string, shouldPin: boolean, sessionId: string): void;
|
||||||
|
/**
|
||||||
|
* Handle client/mail/dialog/read
|
||||||
|
* Set a dialog to be read (no number alert/attachment alert)
|
||||||
|
* @param dialogueIds Dialog ids to set as read
|
||||||
|
* @param sessionId Player profile id
|
||||||
|
*/
|
||||||
|
setRead(dialogueIds: string[], sessionId: string): void;
|
||||||
|
/**
|
||||||
|
* Handle client/mail/dialog/getAllAttachments
|
||||||
|
* Get all uncollected items attached to mail in a particular dialog
|
||||||
|
* @param dialogueId Dialog to get mail attachments from
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @returns IGetAllAttachmentsResponse
|
||||||
|
*/
|
||||||
|
getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse;
|
||||||
|
/** client/mail/msg/send */
|
||||||
|
sendMessage(sessionId: string, request: ISendMessageRequest): string;
|
||||||
/**
|
/**
|
||||||
* Get messages from a specific dialog that have items not expired
|
* Get messages from a specific dialog that have items not expired
|
||||||
* @param sessionId Session id
|
* @param sessionId Session id
|
||||||
@ -72,8 +129,20 @@ export declare class DialogueController {
|
|||||||
*/
|
*/
|
||||||
protected getMessagesWithAttachments(messages: Message[]): Message[];
|
protected getMessagesWithAttachments(messages: Message[]): Message[];
|
||||||
/**
|
/**
|
||||||
* Delete expired items. triggers when updating traders.
|
* Delete expired items from all messages in player profile. triggers when updating traders.
|
||||||
* @param sessionID Session id
|
* @param sessionId Session id
|
||||||
*/
|
*/
|
||||||
protected removeExpiredItems(sessionID: string): void;
|
protected removeExpiredItemsFromMessages(sessionId: string): void;
|
||||||
|
/**
|
||||||
|
* Removes expired items from a message in player profile
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param dialogueId Dialog id
|
||||||
|
*/
|
||||||
|
protected removeExpiredItemsFromMessage(sessionId: string, dialogueId: string): void;
|
||||||
|
/**
|
||||||
|
* Has a dialog message expired
|
||||||
|
* @param message Message to check expiry of
|
||||||
|
* @returns true or false
|
||||||
|
*/
|
||||||
|
protected messageHasExpired(message: Message): boolean;
|
||||||
}
|
}
|
||||||
|
146
types/controllers/GameController.d.ts
vendored
146
types/controllers/GameController.d.ts
vendored
@ -1,32 +1,49 @@
|
|||||||
import { ApplicationContext } from "../context/ApplicationContext";
|
import { ApplicationContext } from "@spt-aki/context/ApplicationContext";
|
||||||
import { HideoutHelper } from "../helpers/HideoutHelper";
|
import { HideoutHelper } from "@spt-aki/helpers/HideoutHelper";
|
||||||
import { HttpServerHelper } from "../helpers/HttpServerHelper";
|
import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { PreAkiModLoader } from "../loaders/PreAkiModLoader";
|
import { PreAkiModLoader } from "@spt-aki/loaders/PreAkiModLoader";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
|
import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse";
|
||||||
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
|
import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse";
|
||||||
import { IServerDetails } from "../models/eft/game/IServerDetails";
|
import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse";
|
||||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveResponse";
|
||||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest";
|
||||||
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
|
import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse";
|
||||||
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
|
import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig";
|
||||||
import { CustomLocationWaveService } from "../services/CustomLocationWaveService";
|
import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
|
||||||
import { OpenZoneService } from "../services/OpenZoneService";
|
import { ILootConfig } from "@spt-aki/models/spt/config/ILootConfig";
|
||||||
import { ProfileFixerService } from "../services/ProfileFixerService";
|
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
|
||||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
|
import { CustomLocationWaveService } from "@spt-aki/services/CustomLocationWaveService";
|
||||||
|
import { GiftService } from "@spt-aki/services/GiftService";
|
||||||
|
import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService";
|
||||||
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
|
import { OpenZoneService } from "@spt-aki/services/OpenZoneService";
|
||||||
|
import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService";
|
||||||
|
import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService";
|
||||||
|
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
export declare class GameController {
|
export declare class GameController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
|
protected jsonUtil: JsonUtil;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
|
protected hashUtil: HashUtil;
|
||||||
protected preAkiModLoader: PreAkiModLoader;
|
protected preAkiModLoader: PreAkiModLoader;
|
||||||
protected httpServerHelper: HttpServerHelper;
|
protected httpServerHelper: HttpServerHelper;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
protected hideoutHelper: HideoutHelper;
|
protected hideoutHelper: HideoutHelper;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected profileFixerService: ProfileFixerService;
|
protected profileFixerService: ProfileFixerService;
|
||||||
@ -34,17 +51,70 @@ export declare class GameController {
|
|||||||
protected customLocationWaveService: CustomLocationWaveService;
|
protected customLocationWaveService: CustomLocationWaveService;
|
||||||
protected openZoneService: OpenZoneService;
|
protected openZoneService: OpenZoneService;
|
||||||
protected seasonalEventService: SeasonalEventService;
|
protected seasonalEventService: SeasonalEventService;
|
||||||
|
protected itemBaseClassService: ItemBaseClassService;
|
||||||
|
protected giftService: GiftService;
|
||||||
|
protected raidTimeAdjustmentService: RaidTimeAdjustmentService;
|
||||||
protected applicationContext: ApplicationContext;
|
protected applicationContext: ApplicationContext;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected httpConfig: IHttpConfig;
|
protected httpConfig: IHttpConfig;
|
||||||
protected coreConfig: ICoreConfig;
|
protected coreConfig: ICoreConfig;
|
||||||
protected locationConfig: ILocationConfig;
|
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);
|
protected ragfairConfig: IRagfairConfig;
|
||||||
|
protected pmcConfig: IPmcConfig;
|
||||||
|
protected lootConfig: ILootConfig;
|
||||||
|
protected botConfig: IBotConfig;
|
||||||
|
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||||
|
load(): void;
|
||||||
|
/**
|
||||||
|
* Handle client/game/start
|
||||||
|
*/
|
||||||
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
|
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
|
||||||
|
protected adjustLocationBotValues(): void;
|
||||||
|
/**
|
||||||
|
* Out of date/incorrectly made trader mods forget this data
|
||||||
|
*/
|
||||||
|
protected checkTraderRepairValuesExist(): void;
|
||||||
|
protected addCustomLooseLootPositions(): void;
|
||||||
|
protected adjustLooseLootSpawnProbabilities(): void;
|
||||||
|
/** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */
|
||||||
|
protected adjustMapBotLimits(): void;
|
||||||
|
/**
|
||||||
|
* Handle client/game/config
|
||||||
|
*/
|
||||||
|
getGameConfig(sessionID: string): IGameConfigResponse;
|
||||||
|
/**
|
||||||
|
* Handle client/server/list
|
||||||
|
*/
|
||||||
|
getServer(sessionId: string): IServerDetails[];
|
||||||
|
/**
|
||||||
|
* Handle client/match/group/current
|
||||||
|
*/
|
||||||
|
getCurrentGroup(sessionId: string): ICurrentGroupResponse;
|
||||||
|
/**
|
||||||
|
* Handle client/checkVersion
|
||||||
|
*/
|
||||||
|
getValidGameVersion(sessionId: string): ICheckVersionResponse;
|
||||||
|
/**
|
||||||
|
* Handle client/game/keepalive
|
||||||
|
*/
|
||||||
|
getKeepAlive(sessionId: string): IGameKeepAliveResponse;
|
||||||
|
/**
|
||||||
|
* Handle singleplayer/settings/getRaidTime
|
||||||
|
*/
|
||||||
|
getRaidTime(sessionId: string, request: IGetRaidTimeRequest): IGetRaidTimeResponse;
|
||||||
|
/**
|
||||||
|
* BSG have two values for shotgun dispersion, we make sure both have the same value
|
||||||
|
*/
|
||||||
|
protected fixShotgunDispersions(): void;
|
||||||
|
/**
|
||||||
|
* Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it
|
||||||
|
* @param pmcProfile Player profile
|
||||||
|
*/
|
||||||
|
protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void;
|
||||||
|
protected flagAllItemsInDbAsSellableOnFlea(): void;
|
||||||
/**
|
/**
|
||||||
* When player logs in, iterate over all active effects and reduce timer
|
* When player logs in, iterate over all active effects and reduce timer
|
||||||
* TODO - add body part HP regen
|
* @param pmcProfile Profile to adjust values for
|
||||||
* @param pmcProfile
|
|
||||||
*/
|
*/
|
||||||
protected updateProfileHealthValues(pmcProfile: IPmcData): void;
|
protected updateProfileHealthValues(pmcProfile: IPmcData): void;
|
||||||
/**
|
/**
|
||||||
@ -55,16 +125,35 @@ export declare class GameController {
|
|||||||
* Make Rogues spawn later to allow for scavs to spawn first instead of rogues filling up all spawn positions
|
* Make Rogues spawn later to allow for scavs to spawn first instead of rogues filling up all spawn positions
|
||||||
*/
|
*/
|
||||||
protected fixRoguesSpawningInstantlyOnLighthouse(): void;
|
protected fixRoguesSpawningInstantlyOnLighthouse(): void;
|
||||||
|
/**
|
||||||
|
* Send starting gifts to profile after x days
|
||||||
|
* @param pmcProfile Profile to add gifts to
|
||||||
|
*/
|
||||||
|
protected sendPraporGiftsToNewProfiles(pmcProfile: IPmcData): void;
|
||||||
|
/**
|
||||||
|
* Find and split waves with large numbers of bots into smaller waves - BSG appears to reduce the size of these
|
||||||
|
* waves to one bot when they're waiting to spawn for too long
|
||||||
|
*/
|
||||||
|
protected splitBotWavesIntoSingleWaves(): void;
|
||||||
/**
|
/**
|
||||||
* Get a list of installed mods and save their details to the profile being used
|
* Get a list of installed mods and save their details to the profile being used
|
||||||
* @param fullProfile Profile to add mod details to
|
* @param fullProfile Profile to add mod details to
|
||||||
*/
|
*/
|
||||||
protected saveActiveModsToProfile(fullProfile: IAkiProfile): void;
|
protected saveActiveModsToProfile(fullProfile: IAkiProfile): void;
|
||||||
|
/**
|
||||||
|
* Check for any missing assorts inside each traders assort.json data, checking against traders questassort.json
|
||||||
|
*/
|
||||||
|
protected validateQuestAssortUnlocksExist(): void;
|
||||||
/**
|
/**
|
||||||
* Add the logged in players name to PMC name pool
|
* Add the logged in players name to PMC name pool
|
||||||
* @param pmcProfile
|
* @param pmcProfile Profile of player to get name from
|
||||||
*/
|
*/
|
||||||
protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
|
protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
|
||||||
|
/**
|
||||||
|
* Check for a dialog with the key 'undefined', and remove it
|
||||||
|
* @param fullProfile Profile to check for dialog in
|
||||||
|
*/
|
||||||
|
protected checkForAndRemoveUndefinedDialogs(fullProfile: IAkiProfile): void;
|
||||||
/**
|
/**
|
||||||
* Blank out the "test" mail message from prapor
|
* Blank out the "test" mail message from prapor
|
||||||
*/
|
*/
|
||||||
@ -74,7 +163,4 @@ export declare class GameController {
|
|||||||
*/
|
*/
|
||||||
protected adjustLabsRaiderSpawnRate(): void;
|
protected adjustLabsRaiderSpawnRate(): void;
|
||||||
protected logProfileDetails(fullProfile: IAkiProfile): void;
|
protected logProfileDetails(fullProfile: IAkiProfile): void;
|
||||||
getGameConfig(sessionID: string): IGameConfigResponse;
|
|
||||||
getServer(): IServerDetails[];
|
|
||||||
getValidGameVersion(): ICheckVersionResponse;
|
|
||||||
}
|
}
|
||||||
|
4
types/controllers/HandbookController.d.ts
vendored
4
types/controllers/HandbookController.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
export declare class HandbookController {
|
export declare class HandbookController {
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected handbookHelper: HandbookHelper;
|
protected handbookHelper: HandbookHelper;
|
||||||
|
63
types/controllers/HealthController.d.ts
vendored
63
types/controllers/HealthController.d.ts
vendored
@ -1,18 +1,19 @@
|
|||||||
import { HealthHelper } from "../helpers/HealthHelper";
|
import { HealthHelper } from "@spt-aki/helpers/HealthHelper";
|
||||||
import { InventoryHelper } from "../helpers/InventoryHelper";
|
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData";
|
import { IHealthTreatmentRequestData } from "@spt-aki/models/eft/health/IHealthTreatmentRequestData";
|
||||||
import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData";
|
import { IOffraidEatRequestData } from "@spt-aki/models/eft/health/IOffraidEatRequestData";
|
||||||
import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData";
|
import { IOffraidHealRequestData } from "@spt-aki/models/eft/health/IOffraidHealRequestData";
|
||||||
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
|
import { ISyncHealthRequestData } from "@spt-aki/models/eft/health/ISyncHealthRequestData";
|
||||||
import { IWorkoutData } from "../models/eft/health/IWorkoutData";
|
import { IWorkoutData } from "@spt-aki/models/eft/health/IWorkoutData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
import { PaymentService } from "../services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
export declare class HealthController {
|
export declare class HealthController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
@ -21,38 +22,42 @@ export declare class HealthController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected inventoryHelper: InventoryHelper;
|
protected inventoryHelper: InventoryHelper;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected healthHelper: HealthHelper;
|
protected healthHelper: HealthHelper;
|
||||||
constructor(logger: ILogger, jsonUtil: JsonUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, healthHelper: HealthHelper);
|
constructor(logger: ILogger, jsonUtil: JsonUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, httpResponse: HttpResponseUtil, healthHelper: HealthHelper);
|
||||||
/**
|
/**
|
||||||
* stores in-raid player health
|
* stores in-raid player health
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param info Request data
|
* @param info Request data
|
||||||
* @param sessionID
|
* @param sessionID Player id
|
||||||
* @param addEffects Should effects found be added or removed from profile
|
* @param addEffects Should effects found be added or removed from profile
|
||||||
|
* @param deleteExistingEffects Should all prior effects be removed before apply new ones
|
||||||
*/
|
*/
|
||||||
saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
|
saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
|
||||||
/**
|
/**
|
||||||
* When healing in menu
|
* When healing in menu
|
||||||
* @param pmcData
|
* @param pmcData Player profile
|
||||||
* @param body
|
* @param request Healing request
|
||||||
* @param sessionID
|
* @param sessionID Player id
|
||||||
* @returns
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse;
|
offraidHeal(pmcData: IPmcData, request: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle Eat event
|
||||||
* Consume food/water outside of a raid
|
* Consume food/water outside of a raid
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param body request Object
|
* @param request Eat request
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
* @returns IItemEventRouterResponse
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse;
|
offraidEat(pmcData: IPmcData, request: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle RestoreHealth event
|
||||||
* Occurs on post-raid healing page
|
* Occurs on post-raid healing page
|
||||||
* @param pmcData player profile
|
* @param pmcData player profile
|
||||||
* @param healthTreatmentRequest Request data from client
|
* @param healthTreatmentRequest Request data from client
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
* @returns
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse;
|
healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
@ -62,12 +67,4 @@ export declare class HealthController {
|
|||||||
* @param sessionID
|
* @param sessionID
|
||||||
*/
|
*/
|
||||||
applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void;
|
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;
|
|
||||||
}
|
}
|
||||||
|
159
types/controllers/HideoutController.d.ts
vendored
159
types/controllers/HideoutController.d.ts
vendored
@ -1,40 +1,44 @@
|
|||||||
import { ScavCaseRewardGenerator } from "../generators/ScavCaseRewardGenerator";
|
import { ScavCaseRewardGenerator } from "@spt-aki/generators/ScavCaseRewardGenerator";
|
||||||
import { HideoutHelper } from "../helpers/HideoutHelper";
|
import { HideoutHelper } from "@spt-aki/helpers/HideoutHelper";
|
||||||
import { InventoryHelper } from "../helpers/InventoryHelper";
|
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
|
||||||
import { PaymentHelper } from "../helpers/PaymentHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { PresetHelper } from "../helpers/PresetHelper";
|
import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData";
|
import { HideoutArea, ITaskConditionCounter, Product } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||||
import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData";
|
import { HideoutUpgradeCompleteRequestData } from "@spt-aki/models/eft/hideout/HideoutUpgradeCompleteRequestData";
|
||||||
import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
|
import { IHandleQTEEventRequestData } from "@spt-aki/models/eft/hideout/IHandleQTEEventRequestData";
|
||||||
import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData";
|
import { IHideoutArea, Stage } from "@spt-aki/models/eft/hideout/IHideoutArea";
|
||||||
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
|
import { IHideoutCancelProductionRequestData } from "@spt-aki/models/eft/hideout/IHideoutCancelProductionRequestData";
|
||||||
import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData";
|
import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData";
|
||||||
import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData";
|
import { IHideoutImproveAreaRequestData } from "@spt-aki/models/eft/hideout/IHideoutImproveAreaRequestData";
|
||||||
import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData";
|
import { IHideoutProduction } from "@spt-aki/models/eft/hideout/IHideoutProduction";
|
||||||
import { IHideoutTakeItemOutRequestData } from "../models/eft/hideout/IHideoutTakeItemOutRequestData";
|
import { IHideoutPutItemInRequestData } from "@spt-aki/models/eft/hideout/IHideoutPutItemInRequestData";
|
||||||
import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData";
|
import { IHideoutScavCaseStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutScavCaseStartRequestData";
|
||||||
import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData";
|
import { IHideoutSingleProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutSingleProductionStartRequestData";
|
||||||
import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData";
|
import { IHideoutTakeItemOutRequestData } from "@spt-aki/models/eft/hideout/IHideoutTakeItemOutRequestData";
|
||||||
import { IQteData } from "../models/eft/hideout/IQteData";
|
import { IHideoutTakeProductionRequestData } from "@spt-aki/models/eft/hideout/IHideoutTakeProductionRequestData";
|
||||||
import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints";
|
import { IHideoutToggleAreaRequestData } from "@spt-aki/models/eft/hideout/IHideoutToggleAreaRequestData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IHideoutUpgradeRequestData } from "@spt-aki/models/eft/hideout/IHideoutUpgradeRequestData";
|
||||||
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
|
import { IQteData } from "@spt-aki/models/eft/hideout/IQteData";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IRecordShootingRangePoints } from "@spt-aki/models/eft/hideout/IRecordShootingRangePoints";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { FenceService } from "../services/FenceService";
|
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { PlayerService } from "../services/PlayerService";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { FenceService } from "@spt-aki/services/FenceService";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { PlayerService } from "@spt-aki/services/PlayerService";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
export declare class HideoutController {
|
export declare class HideoutController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
@ -42,6 +46,7 @@ export declare class HideoutController {
|
|||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected inventoryHelper: InventoryHelper;
|
protected inventoryHelper: InventoryHelper;
|
||||||
|
protected itemHelper: ItemHelper;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected playerService: PlayerService;
|
protected playerService: PlayerService;
|
||||||
protected presetHelper: PresetHelper;
|
protected presetHelper: PresetHelper;
|
||||||
@ -55,10 +60,12 @@ export declare class HideoutController {
|
|||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
protected fenceService: FenceService;
|
protected fenceService: FenceService;
|
||||||
protected static nameBackendCountersCrafting: string;
|
/** Key used in TaskConditionCounters array */
|
||||||
|
protected static nameTaskConditionCountersCrafting: string;
|
||||||
protected hideoutConfig: IHideoutConfig;
|
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, fenceService: FenceService);
|
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService);
|
||||||
/**
|
/**
|
||||||
|
* Handle HideoutUpgrade event
|
||||||
* Start a hideout area upgrade
|
* Start a hideout area upgrade
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param request upgrade start request
|
* @param request upgrade start request
|
||||||
@ -67,6 +74,7 @@ export declare class HideoutController {
|
|||||||
*/
|
*/
|
||||||
startUpgrade(pmcData: IPmcData, request: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
|
startUpgrade(pmcData: IPmcData, request: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle HideoutUpgradeComplete event
|
||||||
* Complete a hideout area upgrade
|
* Complete a hideout area upgrade
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param request Completed upgrade request
|
* @param request Completed upgrade request
|
||||||
@ -74,6 +82,35 @@ export declare class HideoutController {
|
|||||||
* @returns IItemEventRouterResponse
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
|
upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Upgrade wall status to visible in profile if medstation/water collector are both level 1
|
||||||
|
* @param pmcData Player profile
|
||||||
|
*/
|
||||||
|
protected checkAndUpgradeWall(pmcData: IPmcData): void;
|
||||||
|
/**
|
||||||
|
* @param pmcData Profile to edit
|
||||||
|
* @param output Object to send back to client
|
||||||
|
* @param sessionID Session/player id
|
||||||
|
* @param profileParentHideoutArea Current hideout area for profile
|
||||||
|
* @param dbHideoutArea Hideout area being upgraded
|
||||||
|
* @param hideoutStage Stage hideout area is being upgraded to
|
||||||
|
*/
|
||||||
|
protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileParentHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void;
|
||||||
|
/**
|
||||||
|
* Add an inventory item to profile from a hideout area stage data
|
||||||
|
* @param pmcData Profile to update
|
||||||
|
* @param dbHideoutData Hideout area from db being upgraded
|
||||||
|
* @param hideoutStage Stage area upgraded to
|
||||||
|
*/
|
||||||
|
protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void;
|
||||||
|
/**
|
||||||
|
* @param output Object to send to client
|
||||||
|
* @param sessionID Session/player id
|
||||||
|
* @param areaType Hideout area that had stash added
|
||||||
|
* @param hideoutDbData Hideout area that caused addition of stash
|
||||||
|
* @param hideoutStage Hideout area upgraded to this
|
||||||
|
*/
|
||||||
|
protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void;
|
||||||
/**
|
/**
|
||||||
* Handle HideoutPutItemsInAreaSlots
|
* Handle HideoutPutItemsInAreaSlots
|
||||||
* Create item in hideout slot item array, remove item from player inventory
|
* Create item in hideout slot item array, remove item from player inventory
|
||||||
@ -84,6 +121,7 @@ export declare class HideoutController {
|
|||||||
*/
|
*/
|
||||||
putItemsInAreaSlots(pmcData: IPmcData, addItemToHideoutRequest: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
|
putItemsInAreaSlots(pmcData: IPmcData, addItemToHideoutRequest: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle HideoutTakeItemsFromAreaSlots event
|
||||||
* Remove item from hideout area and place into player inventory
|
* Remove item from hideout area and place into player inventory
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param request Take item out of area request
|
* @param request Take item out of area request
|
||||||
@ -102,6 +140,7 @@ export declare class HideoutController {
|
|||||||
*/
|
*/
|
||||||
protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: HideoutArea): IItemEventRouterResponse;
|
protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: HideoutArea): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle HideoutToggleArea event
|
||||||
* Toggle area on/off
|
* Toggle area on/off
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param request Toggle area request
|
* @param request Toggle area request
|
||||||
@ -110,6 +149,7 @@ export declare class HideoutController {
|
|||||||
*/
|
*/
|
||||||
toggleArea(pmcData: IPmcData, request: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
|
toggleArea(pmcData: IPmcData, request: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle HideoutSingleProductionStart event
|
||||||
* Start production for an item from hideout area
|
* Start production for an item from hideout area
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param body Start prodution of single item request
|
* @param body Start prodution of single item request
|
||||||
@ -118,6 +158,7 @@ export declare class HideoutController {
|
|||||||
*/
|
*/
|
||||||
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle HideoutScavCaseProductionStart event
|
||||||
* Handles event after clicking 'start' on the scav case hideout page
|
* Handles event after clicking 'start' on the scav case hideout page
|
||||||
* @param pmcData player profile
|
* @param pmcData player profile
|
||||||
* @param body client request object
|
* @param body client request object
|
||||||
@ -137,9 +178,9 @@ export declare class HideoutController {
|
|||||||
* Add generated scav case rewards to player profile
|
* Add generated scav case rewards to player profile
|
||||||
* @param pmcData player profile to add rewards to
|
* @param pmcData player profile to add rewards to
|
||||||
* @param rewards reward items to add to profile
|
* @param rewards reward items to add to profile
|
||||||
* @param recipieId recipie id to save into Production dict
|
* @param recipeId recipe id to save into Production dict
|
||||||
*/
|
*/
|
||||||
protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[], recipieId: string): void;
|
protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[], recipeId: string): void;
|
||||||
/**
|
/**
|
||||||
* Start production of continuously created item
|
* Start production of continuously created item
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
@ -149,6 +190,7 @@ export declare class HideoutController {
|
|||||||
*/
|
*/
|
||||||
continuousProductionStart(pmcData: IPmcData, request: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
continuousProductionStart(pmcData: IPmcData, request: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle HideoutTakeProduction event
|
||||||
* Take completed item out of hideout area and place into player inventory
|
* Take completed item out of hideout area and place into player inventory
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param request Remove production from area request
|
* @param request Remove production from area request
|
||||||
@ -157,26 +199,31 @@ export declare class HideoutController {
|
|||||||
*/
|
*/
|
||||||
takeProduction(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
|
takeProduction(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Take recipie-type production out of hideout area and place into player inventory
|
* Take recipe-type production out of hideout area and place into player inventory
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
* @param recipe Completed recipie of item
|
* @param recipe Completed recipe of item
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param request Remove production from area request
|
* @param request Remove production from area request
|
||||||
* @param output Output object to update
|
* @param output Output object to update
|
||||||
* @returns IItemEventRouterResponse
|
|
||||||
*/
|
*/
|
||||||
protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): void;
|
||||||
/**
|
/**
|
||||||
* Handles giving rewards stored in player profile to player after clicking 'get rewards'
|
* Get the "CounterHoursCrafting" TaskConditionCounter from a profile
|
||||||
|
* @param pmcData Profile to get counter from
|
||||||
|
* @param recipe Recipe being crafted
|
||||||
|
* @returns ITaskConditionCounter
|
||||||
|
*/
|
||||||
|
protected getHoursCraftingTaskConditionCounter(pmcData: IPmcData, recipe: IHideoutProduction): ITaskConditionCounter;
|
||||||
|
/**
|
||||||
|
* Handles generating case rewards and sending to player inventory
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param request Get rewards from scavcase craft request
|
* @param request Get rewards from scavcase craft request
|
||||||
* @param output Output object to update
|
* @param output Output object to update
|
||||||
* @returns IItemEventRouterResponse
|
|
||||||
*/
|
*/
|
||||||
protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): void;
|
||||||
/**
|
/**
|
||||||
* Start area production for item
|
* Start area production for item by adding production to profiles' Hideout.Production array
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param request Start production request
|
* @param request Start production request
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
@ -188,7 +235,7 @@ export declare class HideoutController {
|
|||||||
* // TODO - implement this
|
* // TODO - implement this
|
||||||
* @param sessionId Session id
|
* @param sessionId Session id
|
||||||
* @returns IQteData array
|
* @returns IQteData array
|
||||||
*/
|
*/
|
||||||
getQteList(sessionId: string): IQteData[];
|
getQteList(sessionId: string): IQteData[];
|
||||||
/**
|
/**
|
||||||
* Handle HideoutQuickTimeEvent on client/game/profile/items/moving
|
* Handle HideoutQuickTimeEvent on client/game/profile/items/moving
|
||||||
@ -209,10 +256,18 @@ export declare class HideoutController {
|
|||||||
/**
|
/**
|
||||||
* Handle client/game/profile/items/moving - HideoutImproveArea
|
* Handle client/game/profile/items/moving - HideoutImproveArea
|
||||||
* @param sessionId Session id
|
* @param sessionId Session id
|
||||||
* @param pmcData profile to improve area in
|
* @param pmcData Profile to improve area in
|
||||||
* @param request improve area request data
|
* @param request Improve area request data
|
||||||
*/
|
*/
|
||||||
improveArea(sessionId: string, pmcData: IPmcData, request: IHideoutImproveAreaRequestData): IItemEventRouterResponse;
|
improveArea(sessionId: string, pmcData: IPmcData, request: IHideoutImproveAreaRequestData): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/items/moving HideoutCancelProductionCommand
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param pmcData Profile with craft to cancel
|
||||||
|
* @param request Cancel production request data
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
cancelProduction(sessionId: string, pmcData: IPmcData, request: IHideoutCancelProductionRequestData): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Function called every x seconds as part of onUpdate event
|
* Function called every x seconds as part of onUpdate event
|
||||||
*/
|
*/
|
||||||
|
129
types/controllers/InraidController.d.ts
vendored
129
types/controllers/InraidController.d.ts
vendored
@ -1,24 +1,33 @@
|
|||||||
import { ApplicationContext } from "../context/ApplicationContext";
|
import { ApplicationContext } from "@spt-aki/context/ApplicationContext";
|
||||||
import { PlayerScavGenerator } from "../generators/PlayerScavGenerator";
|
import { PlayerScavGenerator } from "@spt-aki/generators/PlayerScavGenerator";
|
||||||
import { HealthHelper } from "../helpers/HealthHelper";
|
import { HealthHelper } from "@spt-aki/helpers/HealthHelper";
|
||||||
import { InRaidHelper } from "../helpers/InRaidHelper";
|
import { InRaidHelper } from "@spt-aki/helpers/InRaidHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { QuestHelper } from "../helpers/QuestHelper";
|
import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
|
||||||
import { TraderHelper } from "../helpers/TraderHelper";
|
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
|
import { IRegisterPlayerRequestData } from "@spt-aki/models/eft/inRaid/IRegisterPlayerRequestData";
|
||||||
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
|
import { ISaveProgressRequestData } from "@spt-aki/models/eft/inRaid/ISaveProgressRequestData";
|
||||||
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
import { PlayerRaidEndState } from "@spt-aki/models/enums/PlayerRaidEndState";
|
||||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IBTRConfig } from "@spt-aki/models/spt/config/IBTRConfig";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { ITraderServiceModel } from "@spt-aki/models/spt/services/ITraderServiceModel";
|
||||||
import { InsuranceService } from "../services/InsuranceService";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
|
import { MatchBotDetailsCacheService } from "@spt-aki/services/MatchBotDetailsCacheService";
|
||||||
|
import { PmcChatResponseService } from "@spt-aki/services/PmcChatResponseService";
|
||||||
|
import { TraderServicesService } from "@spt-aki/services/TraderServicesService";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
/**
|
/**
|
||||||
* Logic for handling In Raid callbacks
|
* Logic for handling In Raid callbacks
|
||||||
*/
|
*/
|
||||||
@ -28,19 +37,26 @@ export declare class InraidController {
|
|||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
|
protected pmcChatResponseService: PmcChatResponseService;
|
||||||
|
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
||||||
protected questHelper: QuestHelper;
|
protected questHelper: QuestHelper;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected playerScavGenerator: PlayerScavGenerator;
|
protected playerScavGenerator: PlayerScavGenerator;
|
||||||
protected healthHelper: HealthHelper;
|
protected healthHelper: HealthHelper;
|
||||||
protected traderHelper: TraderHelper;
|
protected traderHelper: TraderHelper;
|
||||||
|
protected traderServicesService: TraderServicesService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected inRaidHelper: InRaidHelper;
|
protected inRaidHelper: InRaidHelper;
|
||||||
protected applicationContext: ApplicationContext;
|
protected applicationContext: ApplicationContext;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected mailSendService: MailSendService;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
protected airdropConfig: IAirdropConfig;
|
protected airdropConfig: IAirdropConfig;
|
||||||
protected inraidConfig: IInRaidConfig;
|
protected btrConfig: IBTRConfig;
|
||||||
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);
|
protected inRaidConfig: IInRaidConfig;
|
||||||
|
protected traderConfig: ITraderConfig;
|
||||||
|
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil);
|
||||||
/**
|
/**
|
||||||
* Save locationId to active profiles inraid object AND app context
|
* Save locationId to active profiles inraid object AND app context
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
@ -48,6 +64,7 @@ export declare class InraidController {
|
|||||||
*/
|
*/
|
||||||
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
|
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
|
||||||
/**
|
/**
|
||||||
|
* Handle raid/profile/save
|
||||||
* Save profile state to disk
|
* Save profile state to disk
|
||||||
* Handles pmc/pscav
|
* Handles pmc/pscav
|
||||||
* @param offraidData post-raid request data
|
* @param offraidData post-raid request data
|
||||||
@ -56,23 +73,21 @@ export declare class InraidController {
|
|||||||
savePostRaidProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
|
savePostRaidProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
|
||||||
/**
|
/**
|
||||||
* Handle updating player profile post-pmc raid
|
* Handle updating player profile post-pmc raid
|
||||||
* @param sessionID session id
|
* @param sessionID Session id
|
||||||
* @param offraidData post-raid data
|
* @param postRaidRequest Post-raid data
|
||||||
*/
|
*/
|
||||||
protected savePmcProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
|
protected savePmcProgress(sessionID: string, postRaidRequest: ISaveProgressRequestData): void;
|
||||||
/**
|
/**
|
||||||
* Make changes to pmc profile after they left raid dead,
|
* Make changes to PMC profile after they've died in raid,
|
||||||
* alter bodypart hp, handle insurance, delete inventory items, remove carried quest items
|
* Alter body part hp, handle insurance, delete inventory items, remove carried quest items
|
||||||
* @param postRaidSaveRequest post-raid save request
|
* @param postRaidSaveRequest Post-raid save request
|
||||||
* @param pmcData pmc profile
|
* @param pmcData Pmc profile
|
||||||
* @param insuranceEnabled is insurance enabled
|
|
||||||
* @param preRaidGear gear player had before raid
|
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
* @returns Updated profile object
|
* @returns Updated profile object
|
||||||
*/
|
*/
|
||||||
protected performPostRaidActionsWhenDead(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData, insuranceEnabled: boolean, preRaidGear: Item[], sessionID: string): IPmcData;
|
protected performPostRaidActionsWhenDead(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData, sessionID: string): IPmcData;
|
||||||
/**
|
/**
|
||||||
* Adjust player characters bodypart hp if they left raid early
|
* Adjust player characters body part hp post-raid
|
||||||
* @param postRaidSaveRequest post raid data
|
* @param postRaidSaveRequest post raid data
|
||||||
* @param pmcData player profile
|
* @param pmcData player profile
|
||||||
*/
|
*/
|
||||||
@ -80,28 +95,38 @@ export declare class InraidController {
|
|||||||
/**
|
/**
|
||||||
* Reduce body part hp to % of max
|
* Reduce body part hp to % of max
|
||||||
* @param pmcData profile to edit
|
* @param pmcData profile to edit
|
||||||
* @param multipler multipler to apply to max health
|
* @param multiplier multiplier to apply to max health
|
||||||
*/
|
*/
|
||||||
protected reducePmcHealthToPercent(pmcData: IPmcData, multipler: number): void;
|
protected reducePmcHealthToPercent(pmcData: IPmcData, multiplier: number): void;
|
||||||
/**
|
/**
|
||||||
* Handle updating the profile post-pscav raid
|
* Handle updating the profile post-pscav raid
|
||||||
* @param sessionID session id
|
* @param sessionID Session id
|
||||||
* @param offraidData post-raid data of raid
|
* @param postRaidRequest Post-raid data of raid
|
||||||
*/
|
*/
|
||||||
protected savePlayerScavProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
|
protected savePlayerScavProgress(sessionID: string, postRaidRequest: ISaveProgressRequestData): void;
|
||||||
|
/**
|
||||||
|
* Does provided profile contain any condition counters
|
||||||
|
* @param profile Profile to check for condition counters
|
||||||
|
* @returns Profile has condition counters
|
||||||
|
*/
|
||||||
|
protected profileHasConditionCounters(profile: IPmcData): boolean;
|
||||||
|
/**
|
||||||
|
* Scav quest progress isnt transferred automatically from scav to pmc, we do this manually
|
||||||
|
* @param scavProfile Scav profile with quest progress post-raid
|
||||||
|
* @param pmcProfile Server pmc profile to copy scav quest progress into
|
||||||
|
*/
|
||||||
|
protected migrateScavQuestProgressToPmcProfile(scavProfile: IPmcData, pmcProfile: IPmcData): void;
|
||||||
/**
|
/**
|
||||||
* Is the player dead after a raid - dead is anything other than "survived" / "runner"
|
* Is the player dead after a raid - dead is anything other than "survived" / "runner"
|
||||||
* @param statusOnExit exit value from offraidData object
|
* @param statusOnExit exit value from offraidData object
|
||||||
* @returns true if dead
|
* @returns true if dead
|
||||||
*/
|
*/
|
||||||
protected isPlayerDead(statusOnExit: string): boolean;
|
protected isPlayerDead(statusOnExit: PlayerRaidEndState): boolean;
|
||||||
/**
|
/**
|
||||||
* Mark inventory items as FiR if player survived raid, otherwise remove FiR from them
|
* Mark inventory items as FiR if player survived raid, otherwise remove FiR from them
|
||||||
* @param offraidData Save Progress Request
|
* @param offraidData Save Progress Request
|
||||||
* @param pmcData player profile
|
|
||||||
* @param isPlayerScav Was the player a pScav
|
|
||||||
*/
|
*/
|
||||||
protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void;
|
protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void;
|
||||||
/**
|
/**
|
||||||
* Update profile after player completes scav raid
|
* Update profile after player completes scav raid
|
||||||
* @param scavData Scav profile
|
* @param scavData Scav profile
|
||||||
@ -115,10 +140,8 @@ export declare class InraidController {
|
|||||||
* Update profile with scav karma values based on in-raid actions
|
* Update profile with scav karma values based on in-raid actions
|
||||||
* @param pmcData Pmc profile
|
* @param pmcData Pmc profile
|
||||||
* @param offraidData Post-raid save request
|
* @param offraidData Post-raid save request
|
||||||
* @param scavData Scav profile
|
|
||||||
* @param sessionID Session id
|
|
||||||
*/
|
*/
|
||||||
protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void;
|
protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData): void;
|
||||||
/**
|
/**
|
||||||
* Get the inraid config from configs/inraid.json
|
* Get the inraid config from configs/inraid.json
|
||||||
* @returns InRaid Config
|
* @returns InRaid Config
|
||||||
@ -129,4 +152,18 @@ export declare class InraidController {
|
|||||||
* @returns Airdrop config
|
* @returns Airdrop config
|
||||||
*/
|
*/
|
||||||
getAirdropConfig(): IAirdropConfig;
|
getAirdropConfig(): IAirdropConfig;
|
||||||
|
/**
|
||||||
|
* Get BTR config from configs/btr.json
|
||||||
|
* @returns Airdrop config
|
||||||
|
*/
|
||||||
|
getBTRConfig(): IBTRConfig;
|
||||||
|
/**
|
||||||
|
* Handle singleplayer/traderServices/getTraderServices
|
||||||
|
* @returns Trader services data
|
||||||
|
*/
|
||||||
|
getTraderServices(sessionId: string, traderId: string): ITraderServiceModel[];
|
||||||
|
/**
|
||||||
|
* Handle singleplayer/traderServices/itemDelivery
|
||||||
|
*/
|
||||||
|
itemDelivery(sessionId: string, traderId: string, items: Item[]): void;
|
||||||
}
|
}
|
||||||
|
216
types/controllers/InsuranceController.d.ts
vendored
216
types/controllers/InsuranceController.d.ts
vendored
@ -1,24 +1,32 @@
|
|||||||
import { DialogueHelper } from "../helpers/DialogueHelper";
|
import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
|
||||||
import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsuranceCostRequestData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IGetInsuranceCostResponseData } from "../models/eft/insurance/IGetInsuranceCostResponseData";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData";
|
import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData";
|
||||||
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
|
import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { Insurance } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||||
import { InsuranceService } from "../services/InsuranceService";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { PaymentService } from "../services/PaymentService";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { InsuranceService } from "@spt-aki/services/InsuranceService";
|
||||||
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
export declare class InsuranceController {
|
export declare class InsuranceController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
|
protected mathUtil: MathUtil;
|
||||||
|
protected hashUtil: HashUtil;
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
@ -26,17 +34,174 @@ export declare class InsuranceController {
|
|||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected dialogueHelper: DialogueHelper;
|
protected dialogueHelper: DialogueHelper;
|
||||||
|
protected traderHelper: TraderHelper;
|
||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
|
protected mailSendService: MailSendService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
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);
|
protected roubleTpl: string;
|
||||||
|
constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Process insurance items prior to being given to player in mail
|
* Process insurance items of all profiles prior to being given back to the player through the mail service.
|
||||||
|
*
|
||||||
|
* @returns void
|
||||||
*/
|
*/
|
||||||
processReturn(): void;
|
processReturn(): void;
|
||||||
/**
|
/**
|
||||||
|
* Process insurance items of a single profile prior to being given back to the player through the mail service.
|
||||||
|
*
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
processReturnByProfile(sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Get all insured items that are ready to be processed in a specific profile.
|
||||||
|
*
|
||||||
|
* @param sessionID Session ID of the profile to check.
|
||||||
|
* @param time The time to check ready status against. Current time by default.
|
||||||
|
* @returns All insured items that are ready to be processed.
|
||||||
|
*/
|
||||||
|
protected filterInsuredItems(sessionID: string, time?: number): Insurance[];
|
||||||
|
/**
|
||||||
|
* This method orchestrates the processing of insured items in a profile.
|
||||||
|
*
|
||||||
|
* @param insuranceDetails The insured items to process.
|
||||||
|
* @param sessionID The session ID that should receive the processed items.
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
protected processInsuredItems(insuranceDetails: Insurance[], sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Count all items in all insurance packages.
|
||||||
|
* @param insurance
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
protected countAllInsuranceItems(insurance: Insurance[]): number;
|
||||||
|
/**
|
||||||
|
* Remove an insurance package from a profile using the package's system data information.
|
||||||
|
*
|
||||||
|
* @param sessionID The session ID of the profile to remove the package from.
|
||||||
|
* @param index The array index of the insurance package to remove.
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
protected removeInsurancePackageFromProfile(sessionID: string, insPackage: Insurance): void;
|
||||||
|
/**
|
||||||
|
* Finds the items that should be deleted based on the given Insurance object.
|
||||||
|
*
|
||||||
|
* @param rootItemParentID - The ID that should be assigned to all "hideout"/root items.
|
||||||
|
* @param insured - The insurance object containing the items to evaluate for deletion.
|
||||||
|
* @returns A Set containing the IDs of items that should be deleted.
|
||||||
|
*/
|
||||||
|
protected findItemsToDelete(rootItemParentID: string, insured: Insurance): Set<string>;
|
||||||
|
/**
|
||||||
|
* Initialize a Map object that holds main-parents to all of their attachments. Note that "main-parent" in this
|
||||||
|
* context refers to the parent item that an attachment is attached to. For example, a suppressor attached to a gun,
|
||||||
|
* not the backpack that the gun is located in (the gun's parent).
|
||||||
|
*
|
||||||
|
* @param rootItemParentID - The ID that should be assigned to all "hideout"/root items.
|
||||||
|
* @param insured - The insurance object containing the items to evaluate.
|
||||||
|
* @param itemsMap - A Map object for quick item look-up by item ID.
|
||||||
|
* @returns A Map object containing parent item IDs to arrays of their attachment items.
|
||||||
|
*/
|
||||||
|
protected populateParentAttachmentsMap(rootItemParentID: string, insured: Insurance, itemsMap: Map<string, Item>): Map<string, Item[]>;
|
||||||
|
/**
|
||||||
|
* Remove attachments that can not be moddable in-raid from the parentAttachmentsMap. If no moddable attachments
|
||||||
|
* remain, the parent is removed from the map as well.
|
||||||
|
*
|
||||||
|
* @param parentAttachmentsMap - A Map object containing parent item IDs to arrays of their attachment items.
|
||||||
|
* @param itemsMap - A Map object for quick item look-up by item ID.
|
||||||
|
* @returns A Map object containing parent item IDs to arrays of their attachment items which are not moddable in-raid.
|
||||||
|
*/
|
||||||
|
protected removeNonModdableAttachments(parentAttachmentsMap: Map<string, Item[]>, itemsMap: Map<string, Item>): Map<string, Item[]>;
|
||||||
|
/**
|
||||||
|
* Process "regular" insurance items. Any insured item that is not an attached, attachment is considered a "regular"
|
||||||
|
* item. This method iterates over them, preforming item deletion rolls to see if they should be deleted. If so,
|
||||||
|
* they (and their attached, attachments, if any) are marked for deletion in the toDelete Set.
|
||||||
|
*
|
||||||
|
* @param insured The insurance object containing the items to evaluate.
|
||||||
|
* @param toDelete A Set to keep track of items marked for deletion.
|
||||||
|
* @param parentAttachmentsMap A Map object containing parent item IDs to arrays of their attachment items.
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
protected processRegularItems(insured: Insurance, toDelete: Set<string>, parentAttachmentsMap: Map<string, Item[]>): void;
|
||||||
|
/**
|
||||||
|
* Process parent items and their attachments, updating the toDelete Set accordingly.
|
||||||
|
*
|
||||||
|
* @param mainParentToAttachmentsMap A Map object containing parent item IDs to arrays of their attachment items.
|
||||||
|
* @param itemsMap A Map object for quick item look-up by item ID.
|
||||||
|
* @param traderId The trader ID from the Insurance object.
|
||||||
|
* @param toDelete A Set object to keep track of items marked for deletion.
|
||||||
|
*/
|
||||||
|
protected processAttachments(mainParentToAttachmentsMap: Map<string, Item[]>, itemsMap: Map<string, Item>, traderId: string, toDelete: Set<string>): void;
|
||||||
|
/**
|
||||||
|
* Takes an array of attachment items that belong to the same main-parent item, sorts them in descending order by
|
||||||
|
* their maximum price. For each attachment, a roll is made to determine if a deletion should be made. Once the
|
||||||
|
* number of deletions has been counted, the attachments are added to the toDelete Set, starting with the most
|
||||||
|
* valuable attachments first.
|
||||||
|
*
|
||||||
|
* @param attachments The array of attachment items to sort, filter, and roll.
|
||||||
|
* @param traderId The ID of the trader to that has ensured these items.
|
||||||
|
* @param toDelete The array that accumulates the IDs of the items to be deleted.
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): void;
|
||||||
|
/**
|
||||||
|
* Sorts the attachment items by their max price in descending order.
|
||||||
|
*
|
||||||
|
* @param attachments The array of attachments items.
|
||||||
|
* @returns An array of items enriched with their max price and common locale-name.
|
||||||
|
*/
|
||||||
|
protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[];
|
||||||
|
/**
|
||||||
|
* Logs the details of each attachment item.
|
||||||
|
*
|
||||||
|
* @param attachments The array of attachment items.
|
||||||
|
*/
|
||||||
|
protected logAttachmentsDetails(attachments: EnrichedItem[]): void;
|
||||||
|
/**
|
||||||
|
* Counts the number of successful rolls for the attachment items.
|
||||||
|
*
|
||||||
|
* @param attachments The array of attachment items.
|
||||||
|
* @param traderId The ID of the trader that has insured these attachments.
|
||||||
|
* @returns The number of successful rolls.
|
||||||
|
*/
|
||||||
|
protected countSuccessfulRolls(attachments: Item[], traderId: string): number;
|
||||||
|
/**
|
||||||
|
* Marks the most valuable attachments for deletion based on the number of successful rolls made.
|
||||||
|
*
|
||||||
|
* @param attachments The array of attachment items.
|
||||||
|
* @param successfulRolls The number of successful rolls.
|
||||||
|
* @param toDelete The array that accumulates the IDs of the items to be deleted.
|
||||||
|
*/
|
||||||
|
protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set<string>): void;
|
||||||
|
/**
|
||||||
|
* Remove items from the insured items that should not be returned to the player.
|
||||||
|
*
|
||||||
|
* @param insured The insured items to process.
|
||||||
|
* @param toDelete The items that should be deleted.
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
protected removeItemsFromInsurance(insured: Insurance, toDelete: Set<string>): void;
|
||||||
|
/**
|
||||||
|
* Handle sending the insurance message to the user that potentially contains the valid insurance items.
|
||||||
|
*
|
||||||
|
* @param sessionID The session ID that should receive the insurance message.
|
||||||
|
* @param insurance The context of insurance to use.
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
protected sendMail(sessionID: string, insurance: Insurance): void;
|
||||||
|
/**
|
||||||
|
* Determines whether a insured item should be removed from the player's inventory based on a random roll and
|
||||||
|
* trader-specific return chance.
|
||||||
|
*
|
||||||
|
* @param traderId The ID of the trader who insured the item.
|
||||||
|
* @param insuredItem Optional. The item to roll for. Only used for logging.
|
||||||
|
* @returns true if the insured item should be removed from inventory, false otherwise, or null on error.
|
||||||
|
*/
|
||||||
|
protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null;
|
||||||
|
/**
|
||||||
|
* Handle Insure event
|
||||||
* Add insurance to an item
|
* Add insurance to an item
|
||||||
|
*
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param body Insurance request
|
* @param body Insurance request
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
@ -44,10 +209,17 @@ export declare class InsuranceController {
|
|||||||
*/
|
*/
|
||||||
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle client/insurance/items/list/cost
|
||||||
* Calculate insurance cost
|
* Calculate insurance cost
|
||||||
* @param info request object
|
*
|
||||||
|
* @param request request object
|
||||||
* @param sessionID session id
|
* @param sessionID session id
|
||||||
* @returns IGetInsuranceCostResponseData object to send to client
|
* @returns IGetInsuranceCostResponseData object to send to client
|
||||||
*/
|
*/
|
||||||
cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData;
|
cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData;
|
||||||
}
|
}
|
||||||
|
interface EnrichedItem extends Item {
|
||||||
|
name: string;
|
||||||
|
maxPrice: number;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
|
216
types/controllers/InventoryController.d.ts
vendored
216
types/controllers/InventoryController.d.ts
vendored
@ -1,60 +1,69 @@
|
|||||||
import { InventoryHelper } from "../helpers/InventoryHelper";
|
import { LootGenerator } from "@spt-aki/generators/LootGenerator";
|
||||||
import { PaymentHelper } from "../helpers/PaymentHelper";
|
import { HideoutHelper } from "@spt-aki/helpers/HideoutHelper";
|
||||||
import { PresetHelper } from "../helpers/PresetHelper";
|
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||||
import { IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { IInventoryBindRequestData } from "../models/eft/inventory/IInventoryBindRequestData";
|
import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
|
||||||
import { IInventoryCreateMarkerRequestData } from "../models/eft/inventory/IInventoryCreateMarkerRequestData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IInventoryDeleteMarkerRequestData } from "../models/eft/inventory/IInventoryDeleteMarkerRequestData";
|
import { IInventoryBindRequestData } from "@spt-aki/models/eft/inventory/IInventoryBindRequestData";
|
||||||
import { IInventoryEditMarkerRequestData } from "../models/eft/inventory/IInventoryEditMarkerRequestData";
|
import { IInventoryCreateMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryCreateMarkerRequestData";
|
||||||
import { IInventoryExamineRequestData } from "../models/eft/inventory/IInventoryExamineRequestData";
|
import { IInventoryDeleteMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryDeleteMarkerRequestData";
|
||||||
import { IInventoryFoldRequestData } from "../models/eft/inventory/IInventoryFoldRequestData";
|
import { IInventoryEditMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryEditMarkerRequestData";
|
||||||
import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData";
|
import { IInventoryExamineRequestData } from "@spt-aki/models/eft/inventory/IInventoryExamineRequestData";
|
||||||
import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData";
|
import { IInventoryFoldRequestData } from "@spt-aki/models/eft/inventory/IInventoryFoldRequestData";
|
||||||
import { IInventoryReadEncyclopediaRequestData } from "../models/eft/inventory/IInventoryReadEncyclopediaRequestData";
|
import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData";
|
||||||
import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData";
|
import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData";
|
||||||
import { IInventorySortRequestData } from "../models/eft/inventory/IInventorySortRequestData";
|
import { IInventoryReadEncyclopediaRequestData } from "@spt-aki/models/eft/inventory/IInventoryReadEncyclopediaRequestData";
|
||||||
import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData";
|
import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData";
|
||||||
import { IInventorySwapRequestData } from "../models/eft/inventory/IInventorySwapRequestData";
|
import { IInventorySortRequestData } from "@spt-aki/models/eft/inventory/IInventorySortRequestData";
|
||||||
import { IInventoryTagRequestData } from "../models/eft/inventory/IInventoryTagRequestData";
|
import { IInventorySplitRequestData } from "@spt-aki/models/eft/inventory/IInventorySplitRequestData";
|
||||||
import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryToggleRequestData";
|
import { IInventorySwapRequestData } from "@spt-aki/models/eft/inventory/IInventorySwapRequestData";
|
||||||
import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData";
|
import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInventoryTagRequestData";
|
||||||
import { IOpenRandomLootContainerRequestData } from "../models/eft/inventory/IOpenRandomLootContainerRequestData";
|
import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ISetFavoriteItems } from "@spt-aki/models/eft/inventory/ISetFavoriteItems";
|
||||||
import { FenceService } from "../services/FenceService";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { FenceService } from "@spt-aki/services/FenceService";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { PlayerService } from "@spt-aki/services/PlayerService";
|
||||||
|
import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
export declare class InventoryController {
|
export declare class InventoryController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
|
protected itemHelper: ItemHelper;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected fenceService: FenceService;
|
protected fenceService: FenceService;
|
||||||
protected presetHelper: PresetHelper;
|
protected presetHelper: PresetHelper;
|
||||||
protected inventoryHelper: InventoryHelper;
|
protected inventoryHelper: InventoryHelper;
|
||||||
|
protected questHelper: QuestHelper;
|
||||||
|
protected hideoutHelper: HideoutHelper;
|
||||||
protected ragfairOfferService: RagfairOfferService;
|
protected ragfairOfferService: RagfairOfferService;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected weightedRandomHelper: WeightedRandomHelper;
|
|
||||||
protected paymentHelper: PaymentHelper;
|
protected paymentHelper: PaymentHelper;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
|
protected playerService: PlayerService;
|
||||||
|
protected lootGenerator: LootGenerator;
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
protected httpResponseUtil: HttpResponseUtil;
|
protected httpResponseUtil: HttpResponseUtil;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, weightedRandomHelper: WeightedRandomHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
|
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
|
||||||
/**
|
/**
|
||||||
* Move Item
|
* Move Item
|
||||||
* change location of item with parentId and slotId
|
* change location of item with parentId and slotId
|
||||||
* transfers items from one profile to another if fromOwner/toOwner is set in the body.
|
* transfers items from one profile to another if fromOwner/toOwner is set in the body.
|
||||||
* otherwise, move is contained within the same profile_f.
|
* otherwise, move is contained within the same profile_f.
|
||||||
* @param pmcData Profile
|
* @param pmcData Profile
|
||||||
* @param moveRequest Move request data
|
* @param moveRequest Move request data
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
@ -62,46 +71,67 @@ export declare class InventoryController {
|
|||||||
*/
|
*/
|
||||||
moveItem(pmcData: IPmcData, moveRequest: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
|
moveItem(pmcData: IPmcData, moveRequest: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Remove Item from Profile
|
* Get a event router response with inventory trader message
|
||||||
* Deep tree item deletion, also removes items from insurance list
|
* @param output Item event router response
|
||||||
*/
|
* @returns Item event router response
|
||||||
|
*/
|
||||||
|
protected getTraderExploitErrorResponse(output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Remove Item from Profile
|
||||||
|
* Deep tree item deletion, also removes items from insurance list
|
||||||
|
*/
|
||||||
removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
|
removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle Remove event
|
||||||
* Implements functionality "Discard" from Main menu (Stash etc.)
|
* Implements functionality "Discard" from Main menu (Stash etc.)
|
||||||
* Removes item from PMC Profile
|
* Removes item from PMC Profile
|
||||||
*/
|
*/
|
||||||
discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse;
|
discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Split Item
|
* Split Item
|
||||||
* spliting 1 item-stack into 2 separate items ...
|
* spliting 1 stack into 2
|
||||||
*/
|
* @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile)
|
||||||
splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;
|
* @param request Split request
|
||||||
|
* @param sessionID Session/player id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Merge Item
|
* Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer')
|
||||||
* merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with`
|
* Deletes item from `body.item` and adding number of stacks into `body.with`
|
||||||
|
* @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile)
|
||||||
|
* @param body Merge request
|
||||||
|
* @param sessionID Player id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse;
|
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Transfer item
|
* TODO: Adds no data to output to send to client, is this by design?
|
||||||
* Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload"
|
* TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc
|
||||||
*/
|
* Transfer items from one stack into another while keeping original stack
|
||||||
|
* Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload"
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param body Transfer request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse;
|
transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Swap Item
|
* Swap Item
|
||||||
* its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment
|
* its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment
|
||||||
*/
|
* Also used to swap items using quick selection on character screen
|
||||||
swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse;
|
*/
|
||||||
/**
|
swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
* Give Item
|
|
||||||
* its used for "add" item like gifts etc.
|
|
||||||
*/
|
|
||||||
addItem(pmcData: IPmcData, body: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: any, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse;
|
|
||||||
/**
|
/**
|
||||||
* Handles folding of Weapons
|
* Handles folding of Weapons
|
||||||
*/
|
*/
|
||||||
foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
|
foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Toggles "Toggleable" items like night vision goggles and face shields.
|
* Toggles "Toggleable" items like night vision goggles and face shields.
|
||||||
|
* @param pmcData player profile
|
||||||
|
* @param body Toggle request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
|
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
@ -112,7 +142,24 @@ export declare class InventoryController {
|
|||||||
* @returns client response object
|
* @returns client response object
|
||||||
*/
|
*/
|
||||||
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
|
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
/**
|
||||||
|
* Bind an inventory item to the quick access menu at bottom of player screen
|
||||||
|
* Handle bind event
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param bindRequest Reqeust object
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
bindItem(pmcData: IPmcData, bindRequest: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Unbind an inventory item from quick access menu at bottom of player screen
|
||||||
|
* Handle unbind event
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param bindRequest Request object
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
unbindItem(pmcData: IPmcData, request: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handles examining an item
|
* Handles examining an item
|
||||||
* @param pmcData player profile
|
* @param pmcData player profile
|
||||||
@ -121,12 +168,13 @@ export declare class InventoryController {
|
|||||||
* @returns response
|
* @returns response
|
||||||
*/
|
*/
|
||||||
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse;
|
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void;
|
||||||
/**
|
/**
|
||||||
* Get the tplid of an item from the examine request object
|
* Get the tplid of an item from the examine request object
|
||||||
* @param body response request
|
* @param request Response request
|
||||||
* @returns tplid
|
* @returns tplId
|
||||||
*/
|
*/
|
||||||
protected getExaminedItemTpl(body: IInventoryExamineRequestData): string;
|
protected getExaminedItemTpl(request: IInventoryExamineRequestData): string;
|
||||||
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
|
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle ApplyInventoryChanges
|
* Handle ApplyInventoryChanges
|
||||||
@ -137,10 +185,38 @@ export declare class InventoryController {
|
|||||||
* @returns IItemEventRouterResponse
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
sortInventory(pmcData: IPmcData, request: 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;
|
|
||||||
/**
|
/**
|
||||||
|
* Add note to a map
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param request Add marker request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
createMapMarker(pmcData: IPmcData, request: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Delete a map marker
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param request Delete marker request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
deleteMapMarker(pmcData: IPmcData, request: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Edit an existing map marker
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param request Edit marker request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
editMapMarker(pmcData: IPmcData, request: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Strip out characters from note string that are not: letter/numbers/unicode/spaces
|
||||||
|
* @param mapNoteText Marker text to sanitise
|
||||||
|
* @returns Sanitised map marker text
|
||||||
|
*/
|
||||||
|
protected sanitiseMapMarkerText(mapNoteText: string): string;
|
||||||
|
/**
|
||||||
|
* Handle OpenRandomLootContainer event
|
||||||
* Handle event fired when a container is unpacked (currently only the halloween pumpkin)
|
* Handle event fired when a container is unpacked (currently only the halloween pumpkin)
|
||||||
* @param pmcData Profile data
|
* @param pmcData Profile data
|
||||||
* @param body open loot container request data
|
* @param body open loot container request data
|
||||||
@ -148,4 +224,6 @@ export declare class InventoryController {
|
|||||||
* @returns IItemEventRouterResponse
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
|
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse;
|
||||||
|
setFavoriteItem(pmcData: IPmcData, request: ISetFavoriteItems, sessionId: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
56
types/controllers/LauncherController.d.ts
vendored
56
types/controllers/LauncherController.d.ts
vendored
@ -1,28 +1,60 @@
|
|||||||
import { HttpServerHelper } from "../helpers/HttpServerHelper";
|
import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper";
|
||||||
import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData";
|
import { PreAkiModLoader } from "@spt-aki/loaders/PreAkiModLoader";
|
||||||
import { IRegisterData } from "../models/eft/launcher/IRegisterData";
|
import { IChangeRequestData } from "@spt-aki/models/eft/launcher/IChangeRequestData";
|
||||||
import { Info } from "../models/eft/profile/IAkiProfile";
|
import { ILoginRequestData } from "@spt-aki/models/eft/launcher/ILoginRequestData";
|
||||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
import { IRegisterData } from "@spt-aki/models/eft/launcher/IRegisterData";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { Info, ModDetails } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IConnectResponse } from "@spt-aki/models/eft/profile/IConnectResponse";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { IPackageJsonData } from "@spt-aki/models/spt/mod/IPackageJsonData";
|
||||||
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
export declare class LauncherController {
|
export declare class LauncherController {
|
||||||
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
|
protected timeUtil: TimeUtil;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected httpServerHelper: HttpServerHelper;
|
protected httpServerHelper: HttpServerHelper;
|
||||||
|
protected profileHelper: ProfileHelper;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
|
protected localisationService: LocalisationService;
|
||||||
|
protected preAkiModLoader: PreAkiModLoader;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected coreConfig: ICoreConfig;
|
protected coreConfig: ICoreConfig;
|
||||||
constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, configServer: ConfigServer);
|
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer);
|
||||||
connect(): any;
|
connect(): IConnectResponse;
|
||||||
|
/**
|
||||||
|
* Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness"
|
||||||
|
* @returns Dictionary of profile types with related descriptive text
|
||||||
|
*/
|
||||||
|
protected getProfileDescriptions(): Record<string, string>;
|
||||||
find(sessionIdKey: string): Info;
|
find(sessionIdKey: string): Info;
|
||||||
login(info: ILoginRequestData): string;
|
login(info: ILoginRequestData): string;
|
||||||
register(info: IRegisterData): string;
|
register(info: IRegisterData): string;
|
||||||
protected createAccount(info: IRegisterData): string;
|
protected createAccount(info: IRegisterData): string;
|
||||||
|
protected generateProfileId(): string;
|
||||||
|
protected formatID(timeStamp: number, counter: number): string;
|
||||||
changeUsername(info: IChangeRequestData): string;
|
changeUsername(info: IChangeRequestData): string;
|
||||||
changePassword(info: IChangeRequestData): string;
|
changePassword(info: IChangeRequestData): string;
|
||||||
wipe(info: IRegisterData): string;
|
wipe(info: IRegisterData): string;
|
||||||
getCompatibleTarkovVersion(): string;
|
getCompatibleTarkovVersion(): string;
|
||||||
|
/**
|
||||||
|
* Get the mods the server has currently loaded
|
||||||
|
* @returns Dictionary of mod name and mod details
|
||||||
|
*/
|
||||||
|
getLoadedServerMods(): Record<string, IPackageJsonData>;
|
||||||
|
/**
|
||||||
|
* Get the mods a profile has ever loaded into game with
|
||||||
|
* @param sessionId Player id
|
||||||
|
* @returns Array of mod details
|
||||||
|
*/
|
||||||
|
getServerModsProfileUsed(sessionId: string): ModDetails[];
|
||||||
}
|
}
|
||||||
|
85
types/controllers/LocationController.d.ts
vendored
85
types/controllers/LocationController.d.ts
vendored
@ -1,35 +1,78 @@
|
|||||||
import { LocationGenerator } from "../generators/LocationGenerator";
|
import { ApplicationContext } from "@spt-aki/context/ApplicationContext";
|
||||||
import { LootGenerator } from "../generators/LootGenerator";
|
import { LocationGenerator } from "@spt-aki/generators/LocationGenerator";
|
||||||
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
import { LootGenerator } from "@spt-aki/generators/LootGenerator";
|
||||||
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
|
||||||
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
import { ILocationBase } from "@spt-aki/models/eft/common/ILocationBase";
|
||||||
import { LootItem } from "../models/spt/services/LootItem";
|
import { ILocationsGenerateAllResponse } from "@spt-aki/models/eft/common/ILocationsSourceDestinationBase";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IAirdropLootResult } from "@spt-aki/models/eft/location/IAirdropLootResult";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IGetLocationRequestData } from "@spt-aki/models/eft/location/IGetLocationRequestData";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { AirdropTypeEnum } from "@spt-aki/models/enums/AirdropType";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { LootRequest } from "@spt-aki/models/spt/services/LootRequest";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
|
import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
export declare class LocationController {
|
export declare class LocationController {
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected locationGenerator: LocationGenerator;
|
protected locationGenerator: LocationGenerator;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
|
protected raidTimeAdjustmentService: RaidTimeAdjustmentService;
|
||||||
protected lootGenerator: LootGenerator;
|
protected lootGenerator: LootGenerator;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected applicationContext: ApplicationContext;
|
||||||
protected airdropConfig: IAirdropConfig;
|
protected airdropConfig: IAirdropConfig;
|
||||||
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
|
protected locationConfig: ILocationConfig;
|
||||||
get(location: string): ILocationBase;
|
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext);
|
||||||
generate(name: string): ILocationBase;
|
|
||||||
generateAll(): ILocationsGenerateAllResponse;
|
|
||||||
/**
|
/**
|
||||||
* Get loot for an airdop container
|
* Handle client/location/getLocalloot
|
||||||
* Generates it randomly based on config/airdrop.json values
|
* Get a location (map) with generated loot data
|
||||||
* @returns Array of LootItem
|
* @param sessionId Player id
|
||||||
|
* @param request Map request to generate
|
||||||
|
* @returns ILocationBase
|
||||||
*/
|
*/
|
||||||
getAirdropLoot(): LootItem[];
|
get(sessionId: string, request: IGetLocationRequestData): ILocationBase;
|
||||||
|
/**
|
||||||
|
* Generate a maps base location with loot
|
||||||
|
* @param name Map name
|
||||||
|
* @returns ILocationBase
|
||||||
|
*/
|
||||||
|
protected generate(name: string): ILocationBase;
|
||||||
|
/**
|
||||||
|
* Handle client/locations
|
||||||
|
* Get all maps base location properties without loot data
|
||||||
|
* @param sessionId Players Id
|
||||||
|
* @returns ILocationsGenerateAllResponse
|
||||||
|
*/
|
||||||
|
generateAll(sessionId: string): ILocationsGenerateAllResponse;
|
||||||
|
/**
|
||||||
|
* Handle client/location/getAirdropLoot
|
||||||
|
* Get loot for an airdrop container
|
||||||
|
* Generates it randomly based on config/airdrop.json values
|
||||||
|
* @returns Array of LootItem objects
|
||||||
|
*/
|
||||||
|
getAirdropLoot(): IAirdropLootResult;
|
||||||
|
/**
|
||||||
|
* Randomly pick a type of airdrop loot using weighted values from config
|
||||||
|
* @returns airdrop type value
|
||||||
|
*/
|
||||||
|
protected chooseAirdropType(): AirdropTypeEnum;
|
||||||
|
/**
|
||||||
|
* Get the configuration for a specific type of airdrop
|
||||||
|
* @param airdropType Type of airdrop to get settings for
|
||||||
|
* @returns LootRequest
|
||||||
|
*/
|
||||||
|
protected getAirdropLootConfigByType(airdropType: AirdropTypeEnum): LootRequest;
|
||||||
}
|
}
|
||||||
|
112
types/controllers/MatchController.d.ts
vendored
112
types/controllers/MatchController.d.ts
vendored
@ -1,27 +1,37 @@
|
|||||||
import { ApplicationContext } from "../context/ApplicationContext";
|
import { ApplicationContext } from "@spt-aki/context/ApplicationContext";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { LootGenerator } from "@spt-aki/generators/LootGenerator";
|
||||||
import { TraderHelper } from "../helpers/TraderHelper";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
|
||||||
import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData";
|
import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData";
|
||||||
import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData";
|
import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData";
|
||||||
import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData";
|
import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData";
|
||||||
import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData";
|
import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse";
|
||||||
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
|
import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData";
|
||||||
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
|
import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData";
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData";
|
||||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
import { IJoinMatchResult } from "@spt-aki/models/eft/match/IJoinMatchResult";
|
||||||
import { IMatchConfig } from "../models/spt/config/IMatchConfig";
|
import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IMatchConfig } from "@spt-aki/models/spt/config/IMatchConfig";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
|
||||||
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { BotLootCacheService } from "../services/BotLootCacheService";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { MatchLocationService } from "../services/MatchLocationService";
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
import { ProfileSnapshotService } from "../services/ProfileSnapshotService";
|
import { BotGenerationCacheService } from "@spt-aki/services/BotGenerationCacheService";
|
||||||
|
import { BotLootCacheService } from "@spt-aki/services/BotLootCacheService";
|
||||||
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
|
import { MatchLocationService } from "@spt-aki/services/MatchLocationService";
|
||||||
|
import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
export declare class MatchController {
|
export declare class MatchController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
|
protected timeUtil: TimeUtil;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
|
protected hashUtil: HashUtil;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected matchLocationService: MatchLocationService;
|
protected matchLocationService: MatchLocationService;
|
||||||
protected traderHelper: TraderHelper;
|
protected traderHelper: TraderHelper;
|
||||||
@ -29,22 +39,29 @@ export declare class MatchController {
|
|||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected profileSnapshotService: ProfileSnapshotService;
|
protected profileSnapshotService: ProfileSnapshotService;
|
||||||
protected botGenerationCacheService: BotGenerationCacheService;
|
protected botGenerationCacheService: BotGenerationCacheService;
|
||||||
|
protected mailSendService: MailSendService;
|
||||||
|
protected lootGenerator: LootGenerator;
|
||||||
protected applicationContext: ApplicationContext;
|
protected applicationContext: ApplicationContext;
|
||||||
protected matchConfig: IMatchConfig;
|
protected matchConfig: IMatchConfig;
|
||||||
protected inraidConfig: IInRaidConfig;
|
protected inRaidConfig: IInRaidConfig;
|
||||||
protected botConfig: IBotConfig;
|
protected traderConfig: ITraderConfig;
|
||||||
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext);
|
protected pmcConfig: IPmcConfig;
|
||||||
|
constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, mailSendService: MailSendService, lootGenerator: LootGenerator, applicationContext: ApplicationContext);
|
||||||
getEnabled(): boolean;
|
getEnabled(): boolean;
|
||||||
|
/** Handle raid/profile/list */
|
||||||
getProfile(info: IGetProfileRequestData): IPmcData[];
|
getProfile(info: IGetProfileRequestData): IPmcData[];
|
||||||
|
/** Handle client/match/group/create */
|
||||||
createGroup(sessionID: string, info: ICreateGroupRequestData): any;
|
createGroup(sessionID: string, info: ICreateGroupRequestData): any;
|
||||||
|
/** Handle client/match/group/delete */
|
||||||
deleteGroup(info: any): void;
|
deleteGroup(info: any): void;
|
||||||
joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[];
|
/** Handle match/group/start_game */
|
||||||
protected getMatch(location: string): any;
|
joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult;
|
||||||
getGroupStatus(info: IGetGroupStatusRequestData): any;
|
/** Handle client/match/group/status */
|
||||||
|
getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse;
|
||||||
/**
|
/**
|
||||||
* Handle /client/raid/configuration
|
* Handle /client/raid/configuration
|
||||||
* @param request
|
* @param request Raid config request
|
||||||
* @param sessionID
|
* @param sessionID Session id
|
||||||
*/
|
*/
|
||||||
startOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void;
|
startOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void;
|
||||||
/**
|
/**
|
||||||
@ -53,5 +70,40 @@ export declare class MatchController {
|
|||||||
* @returns bot difficulty
|
* @returns bot difficulty
|
||||||
*/
|
*/
|
||||||
protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: string): string;
|
protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: string): string;
|
||||||
endOfflineRaid(info: IEndOfflineRaidRequestData, sessionID: string): void;
|
/** Handle client/match/offline/end */
|
||||||
|
endOfflineRaid(info: IEndOfflineRaidRequestData, sessionId: string): void;
|
||||||
|
/**
|
||||||
|
* Did player take a COOP extract
|
||||||
|
* @param extractName Name of extract player took
|
||||||
|
* @returns True if coop extract
|
||||||
|
*/
|
||||||
|
protected extractWasViaCoop(extractName: string): boolean;
|
||||||
|
protected sendCoopTakenFenceMessage(sessionId: string): void;
|
||||||
|
/**
|
||||||
|
* Handle when a player extracts using a coop extract - add rep to fence
|
||||||
|
* @param pmcData Profile
|
||||||
|
* @param extractName Name of extract taken
|
||||||
|
*/
|
||||||
|
protected handleCoopExtract(pmcData: IPmcData, extractName: string): void;
|
||||||
|
/**
|
||||||
|
* Was extract by car
|
||||||
|
* @param extractName name of extract
|
||||||
|
* @returns true if car extract
|
||||||
|
*/
|
||||||
|
protected extractWasViaCar(extractName: string): boolean;
|
||||||
|
/**
|
||||||
|
* Handle when a player extracts using a car - Add rep to fence
|
||||||
|
* @param extractName name of the extract used
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param sessionId Session id
|
||||||
|
*/
|
||||||
|
protected handleCarExtract(extractName: string, pmcData: IPmcData, sessionId: string): void;
|
||||||
|
/**
|
||||||
|
* Get the fence rep gain from using a car or coop extract
|
||||||
|
* @param pmcData Profile
|
||||||
|
* @param baseGain amount gained for the first extract
|
||||||
|
* @param extractCount Number of times extract was taken
|
||||||
|
* @returns Fence standing after taking extract
|
||||||
|
*/
|
||||||
|
protected getFenceStandingAfterExtract(pmcData: IPmcData, baseGain: number, extractCount: number): number;
|
||||||
}
|
}
|
||||||
|
8
types/controllers/NoteController.d.ts
vendored
8
types/controllers/NoteController.d.ts
vendored
@ -1,7 +1,7 @@
|
|||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { INoteActionData } from "../models/eft/notes/INoteActionData";
|
import { INoteActionData } from "@spt-aki/models/eft/notes/INoteActionData";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||||
export declare class NoteController {
|
export declare class NoteController {
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
constructor(eventOutputHolder: EventOutputHolder);
|
constructor(eventOutputHolder: EventOutputHolder);
|
||||||
|
9
types/controllers/NotifierController.d.ts
vendored
9
types/controllers/NotifierController.d.ts
vendored
@ -1,7 +1,7 @@
|
|||||||
import { NotifierHelper } from "../helpers/NotifierHelper";
|
import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper";
|
||||||
import { NotificationService } from "../services/NotificationService";
|
import { NotifierHelper } from "@spt-aki/helpers/NotifierHelper";
|
||||||
import { INotifierChannel } from "../models/eft/notifier/INotifier";
|
import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier";
|
||||||
import { HttpServerHelper } from "../helpers/HttpServerHelper";
|
import { NotificationService } from "@spt-aki/services/NotificationService";
|
||||||
export declare class NotifierController {
|
export declare class NotifierController {
|
||||||
protected notifierHelper: NotifierHelper;
|
protected notifierHelper: NotifierHelper;
|
||||||
protected httpServerHelper: HttpServerHelper;
|
protected httpServerHelper: HttpServerHelper;
|
||||||
@ -18,5 +18,6 @@ export declare class NotifierController {
|
|||||||
*/
|
*/
|
||||||
notifyAsync(sessionID: string): Promise<unknown>;
|
notifyAsync(sessionID: string): Promise<unknown>;
|
||||||
getServer(sessionID: string): string;
|
getServer(sessionID: string): string;
|
||||||
|
/** Handle client/notifier/channel/create */
|
||||||
getChannel(sessionID: string): INotifierChannel;
|
getChannel(sessionID: string): INotifierChannel;
|
||||||
}
|
}
|
||||||
|
4
types/controllers/PresetController.d.ts
vendored
4
types/controllers/PresetController.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
import { PresetHelper } from "../helpers/PresetHelper";
|
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
export declare class PresetController {
|
export declare class PresetController {
|
||||||
protected presetHelper: PresetHelper;
|
protected presetHelper: PresetHelper;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
|
115
types/controllers/ProfileController.d.ts
vendored
115
types/controllers/ProfileController.d.ts
vendored
@ -1,46 +1,119 @@
|
|||||||
import { PlayerScavGenerator } from "../generators/PlayerScavGenerator";
|
import { PlayerScavGenerator } from "@spt-aki/generators/PlayerScavGenerator";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { QuestHelper } from "../helpers/QuestHelper";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { TraderHelper } from "../helpers/TraderHelper";
|
import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
|
||||||
import { IMiniProfile } from "../models/eft/launcher/IMiniProfile";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IProfileChangeNicknameRequestData } from "../models/eft/profile/IProfileChangeNicknameRequestData";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IProfileChangeVoiceRequestData } from "../models/eft/profile/IProfileChangeVoiceRequestData";
|
import { IMiniProfile } from "@spt-aki/models/eft/launcher/IMiniProfile";
|
||||||
import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateRequestData";
|
import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData";
|
||||||
import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData";
|
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse";
|
import { IGetOtherProfileRequest } from "@spt-aki/models/eft/profile/IGetOtherProfileRequest";
|
||||||
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
|
import { IGetOtherProfileResponse } from "@spt-aki/models/eft/profile/IGetOtherProfileResponse";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData";
|
||||||
import { ProfileFixerService } from "../services/ProfileFixerService";
|
import { IProfileCreateRequestData } from "@spt-aki/models/eft/profile/IProfileCreateRequestData";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { ISearchFriendRequestData } from "@spt-aki/models/eft/profile/ISearchFriendRequestData";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { ISearchFriendResponse } from "@spt-aki/models/eft/profile/ISearchFriendResponse";
|
||||||
|
import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData";
|
||||||
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
|
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||||
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
|
import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService";
|
||||||
|
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
export declare class ProfileController {
|
export declare class ProfileController {
|
||||||
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected profileFixerService: ProfileFixerService;
|
protected profileFixerService: ProfileFixerService;
|
||||||
|
protected localisationService: LocalisationService;
|
||||||
|
protected seasonalEventService: SeasonalEventService;
|
||||||
|
protected mailSendService: MailSendService;
|
||||||
protected playerScavGenerator: PlayerScavGenerator;
|
protected playerScavGenerator: PlayerScavGenerator;
|
||||||
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
protected traderHelper: TraderHelper;
|
protected traderHelper: TraderHelper;
|
||||||
|
protected dialogueHelper: DialogueHelper;
|
||||||
protected questHelper: QuestHelper;
|
protected questHelper: QuestHelper;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper);
|
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper);
|
||||||
|
/**
|
||||||
|
* Handle /launcher/profiles
|
||||||
|
*/
|
||||||
getMiniProfiles(): IMiniProfile[];
|
getMiniProfiles(): IMiniProfile[];
|
||||||
|
/**
|
||||||
|
* Handle launcher/profile/info
|
||||||
|
*/
|
||||||
getMiniProfile(sessionID: string): any;
|
getMiniProfile(sessionID: string): any;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/list
|
||||||
|
*/
|
||||||
getCompleteProfile(sessionID: string): IPmcData[];
|
getCompleteProfile(sessionID: string): IPmcData[];
|
||||||
createProfile(info: IProfileCreateRequestData, sessionID: string): void;
|
/**
|
||||||
|
* Handle client/game/profile/create
|
||||||
|
* @param info Client reqeust object
|
||||||
|
* @param sessionID Player id
|
||||||
|
* @returns Profiles _id value
|
||||||
|
*/
|
||||||
|
createProfile(info: IProfileCreateRequestData, sessionID: string): string;
|
||||||
|
/**
|
||||||
|
* make profiles pmcData.Inventory.equipment unique
|
||||||
|
* @param pmcData Profile to update
|
||||||
|
*/
|
||||||
|
protected updateInventoryEquipmentId(pmcData: IPmcData): void;
|
||||||
|
/**
|
||||||
|
* Delete a profile
|
||||||
|
* @param sessionID Id of profile to delete
|
||||||
|
*/
|
||||||
|
protected deleteProfileBySessionId(sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Iterate over all quests in player profile, inspect rewards for the quests current state (accepted/completed)
|
||||||
|
* and send rewards to them in mail
|
||||||
|
* @param profileDetails Player profile
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @param response Event router response
|
||||||
|
*/
|
||||||
|
protected givePlayerStartingQuestRewards(profileDetails: IAkiProfile, sessionID: string, response: IItemEventRouterResponse): void;
|
||||||
|
/**
|
||||||
|
* For each trader reset their state to what a level 1 player would see
|
||||||
|
* @param sessionID Session id of profile to reset
|
||||||
|
*/
|
||||||
|
protected resetAllTradersInProfile(sessionID: string): void;
|
||||||
/**
|
/**
|
||||||
* Generate a player scav object
|
* Generate a player scav object
|
||||||
* pmc profile MUST exist first before pscav can be generated
|
* PMC profile MUST exist first before pscav can be generated
|
||||||
* @param sessionID
|
* @param sessionID
|
||||||
* @returns IPmcData object
|
* @returns IPmcData object
|
||||||
*/
|
*/
|
||||||
generatePlayerScav(sessionID: string): IPmcData;
|
generatePlayerScav(sessionID: string): IPmcData;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/nickname/validate
|
||||||
|
*/
|
||||||
validateNickname(info: IValidateNicknameRequestData, sessionID: string): string;
|
validateNickname(info: IValidateNicknameRequestData, sessionID: string): string;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/nickname/change event
|
||||||
|
* Client allows player to adjust their profile name
|
||||||
|
*/
|
||||||
changeNickname(info: IProfileChangeNicknameRequestData, sessionID: string): string;
|
changeNickname(info: IProfileChangeNicknameRequestData, sessionID: string): string;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/voice/change event
|
||||||
|
*/
|
||||||
changeVoice(info: IProfileChangeVoiceRequestData, sessionID: string): void;
|
changeVoice(info: IProfileChangeVoiceRequestData, sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/search
|
||||||
|
*/
|
||||||
getFriends(info: ISearchFriendRequestData, sessionID: string): ISearchFriendResponse[];
|
getFriends(info: ISearchFriendRequestData, sessionID: string): ISearchFriendResponse[];
|
||||||
|
/**
|
||||||
|
* Handle client/profile/status
|
||||||
|
*/
|
||||||
|
getProfileStatus(sessionId: string): GetProfileStatusResponseData;
|
||||||
|
getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse;
|
||||||
}
|
}
|
||||||
|
153
types/controllers/QuestController.d.ts
vendored
153
types/controllers/QuestController.d.ts
vendored
@ -1,43 +1,55 @@
|
|||||||
import { DialogueHelper } from "../helpers/DialogueHelper";
|
import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
|
import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper";
|
||||||
import { QuestHelper } from "../helpers/QuestHelper";
|
import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
|
||||||
import { IQuest, Reward } from "../models/eft/common/tables/IQuest";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
|
import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
|
import { IQuest, IQuestCondition } from "@spt-aki/models/eft/common/tables/IQuest";
|
||||||
import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData";
|
import { IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests";
|
||||||
import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IQuestConfig } from "../models/spt/config/IQuestConfig";
|
import { IAcceptQuestRequestData } from "@spt-aki/models/eft/quests/IAcceptQuestRequestData";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ICompleteQuestRequestData } from "@spt-aki/models/eft/quests/ICompleteQuestRequestData";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { IFailQuestRequestData } from "@spt-aki/models/eft/quests/IFailQuestRequestData";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IHandoverQuestRequestData } from "@spt-aki/models/eft/quests/IHandoverQuestRequestData";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
|
||||||
import { LocaleService } from "../services/LocaleService";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||||
import { PlayerService } from "../services/PlayerService";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||||
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
|
import { PlayerService } from "@spt-aki/services/PlayerService";
|
||||||
|
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||||
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
export declare class QuestController {
|
export declare class QuestController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
|
protected jsonUtil: JsonUtil;
|
||||||
protected httpResponseUtil: HttpResponseUtil;
|
protected httpResponseUtil: HttpResponseUtil;
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected dialogueHelper: DialogueHelper;
|
protected dialogueHelper: DialogueHelper;
|
||||||
|
protected mailSendService: MailSendService;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
|
protected traderHelper: TraderHelper;
|
||||||
protected questHelper: QuestHelper;
|
protected questHelper: QuestHelper;
|
||||||
protected questConditionHelper: QuestConditionHelper;
|
protected questConditionHelper: QuestConditionHelper;
|
||||||
protected playerService: PlayerService;
|
protected playerService: PlayerService;
|
||||||
protected localeService: LocaleService;
|
protected localeService: LocaleService;
|
||||||
|
protected seasonalEventService: SeasonalEventService;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected questConfig: IQuestConfig;
|
protected questConfig: IQuestConfig;
|
||||||
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer);
|
constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
|
* Handle client/quest/list
|
||||||
* Get all quests visible to player
|
* Get all quests visible to player
|
||||||
* Exclude quests with incomplete preconditions (level/loyalty)
|
* Exclude quests with incomplete preconditions (level/loyalty)
|
||||||
* @param sessionID session id
|
* @param sessionID session id
|
||||||
@ -45,28 +57,35 @@ export declare class QuestController {
|
|||||||
*/
|
*/
|
||||||
getClientQuests(sessionID: string): IQuest[];
|
getClientQuests(sessionID: string): IQuest[];
|
||||||
/**
|
/**
|
||||||
* Is the quest for the opposite side the player is on
|
* Does a provided quest have a level requirement equal to or below defined level
|
||||||
* @param side player side (usec/bear)
|
* @param quest Quest to check
|
||||||
* @param questId questId to check
|
* @param playerLevel level of player to test against quest
|
||||||
|
* @returns true if quest can be seen/accepted by player of defined level
|
||||||
*/
|
*/
|
||||||
protected questIsForOtherSide(side: string, questId: string): boolean;
|
protected playerLevelFulfillsQuestRequirement(quest: IQuest, playerLevel: number): boolean;
|
||||||
/**
|
/**
|
||||||
|
* Should a quest be shown to the player in trader quest screen
|
||||||
|
* @param questId Quest to check
|
||||||
|
* @returns true = show to player
|
||||||
|
*/
|
||||||
|
protected showEventQuestToPlayer(questId: string): boolean;
|
||||||
|
/**
|
||||||
|
* Is the quest for the opposite side the player is on
|
||||||
|
* @param playerSide Player side (usec/bear)
|
||||||
|
* @param questId QuestId to check
|
||||||
|
*/
|
||||||
|
protected questIsForOtherSide(playerSide: string, questId: string): boolean;
|
||||||
|
/**
|
||||||
|
* Handle QuestAccept event
|
||||||
* Handle the client accepting a quest and starting it
|
* Handle the client accepting a quest and starting it
|
||||||
* Send starting rewards if any to player and
|
* Send starting rewards if any to player and
|
||||||
* Send start notification if any to player
|
* Send start notification if any to player
|
||||||
* @param pmcData Profile to update
|
* @param pmcData Profile to update
|
||||||
* @param acceptedQuest Quest accepted
|
* @param acceptedQuest Quest accepted
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
* @returns client response
|
* @returns Client response
|
||||||
*/
|
*/
|
||||||
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
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
|
* Handle the client accepting a repeatable quest and starting it
|
||||||
* Send starting rewards if any to player and
|
* Send starting rewards if any to player and
|
||||||
@ -85,15 +104,29 @@ export declare class QuestController {
|
|||||||
*/
|
*/
|
||||||
protected getRepeatableQuestFromProfile(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData): IRepeatableQuest;
|
protected getRepeatableQuestFromProfile(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData): IRepeatableQuest;
|
||||||
/**
|
/**
|
||||||
|
* Handle QuestComplete event
|
||||||
* Update completed quest in profile
|
* Update completed quest in profile
|
||||||
* Add newly unlocked quests to profile
|
* Add newly unlocked quests to profile
|
||||||
* Also recalculate thier level due to exp rewards
|
* Also recalculate their level due to exp rewards
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param body Completed quest request
|
* @param body Completed quest request
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
* @returns ItemEvent client response
|
* @returns ItemEvent client response
|
||||||
*/
|
*/
|
||||||
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Remove a quest entirely from a profile
|
||||||
|
* @param sessionId Player id
|
||||||
|
* @param questIdToRemove Qid of quest to remove
|
||||||
|
*/
|
||||||
|
protected removeQuestFromScavProfile(sessionId: string, questIdToRemove: string): void;
|
||||||
|
/**
|
||||||
|
* Return quests that have different statuses
|
||||||
|
* @param preQuestStatusus Quests before
|
||||||
|
* @param postQuestStatuses Quests after
|
||||||
|
* @returns QuestStatusChange array
|
||||||
|
*/
|
||||||
|
protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[];
|
||||||
/**
|
/**
|
||||||
* Send a popup to player on successful completion of a quest
|
* Send a popup to player on successful completion of a quest
|
||||||
* @param sessionID session id
|
* @param sessionID session id
|
||||||
@ -101,7 +134,7 @@ export declare class QuestController {
|
|||||||
* @param completedQuestId Completed quest id
|
* @param completedQuestId Completed quest id
|
||||||
* @param questRewards Rewards given to player
|
* @param questRewards Rewards given to player
|
||||||
*/
|
*/
|
||||||
protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Reward[]): void;
|
protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Item[]): 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
|
* 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 pmcData Player profile to update
|
||||||
@ -110,20 +143,38 @@ export declare class QuestController {
|
|||||||
*/
|
*/
|
||||||
protected addTimeLockedQuestsToProfile(pmcData: IPmcData, quests: IQuest[], completedQuestId: string): void;
|
protected addTimeLockedQuestsToProfile(pmcData: IPmcData, quests: IQuest[], completedQuestId: string): void;
|
||||||
/**
|
/**
|
||||||
* Returns a list of quests that should be failed when a quest is completed
|
* Fail the provided quests
|
||||||
* @param completedQuestId quest completed id
|
|
||||||
* @returns array of quests
|
|
||||||
*/
|
|
||||||
protected getQuestsFailedByCompletingQuest(completedQuestId: string): IQuest[];
|
|
||||||
/**
|
|
||||||
* Fail the quests provided
|
|
||||||
* Update quest in profile, otherwise add fresh quest object with failed status
|
* Update quest in profile, otherwise add fresh quest object with failed status
|
||||||
* @param sessionID session id
|
* @param sessionID session id
|
||||||
* @param pmcData player profile
|
* @param pmcData player profile
|
||||||
* @param questsToFail quests to fail
|
* @param questsToFail quests to fail
|
||||||
|
* @param output Client output
|
||||||
*/
|
*/
|
||||||
protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void;
|
protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void;
|
||||||
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
/**
|
||||||
|
* Handle QuestHandover event
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param handoverQuestRequest handover item request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Show warning to user and write to log that repeatable quest failed a condition check
|
||||||
|
* @param handoverQuestRequest Quest request
|
||||||
|
* @param output Response to send to user
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
protected showRepeatableQuestInvalidConditionError(handoverQuestRequest: IHandoverQuestRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Show warning to user and write to log quest item handed over did not match what is required
|
||||||
|
* @param handoverQuestRequest Quest request
|
||||||
|
* @param itemHandedOver Non-matching item found
|
||||||
|
* @param handoverRequirements Quest handover requirements
|
||||||
|
* @param output Response to send to user
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: Item, handoverRequirements: IQuestCondition, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Increment a backend counter stored value by an amount,
|
* Increment a backend counter stored value by an amount,
|
||||||
* Create counter if it does not exist
|
* Create counter if it does not exist
|
||||||
@ -132,5 +183,13 @@ export declare class QuestController {
|
|||||||
* @param questId quest id counter is associated with
|
* @param questId quest id counter is associated with
|
||||||
* @param counterValue value to increment the backend counter with
|
* @param counterValue value to increment the backend counter with
|
||||||
*/
|
*/
|
||||||
protected updateProfileBackendCounterValue(pmcData: IPmcData, conditionId: string, questId: string, counterValue: number): void;
|
protected updateProfileTaskConditionCounterValue(pmcData: IPmcData, conditionId: string, questId: string, counterValue: number): void;
|
||||||
|
/**
|
||||||
|
* Handle /client/game/profile/items/moving - QuestFail
|
||||||
|
* @param pmcData Pmc profile
|
||||||
|
* @param request Fail qeust request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
failQuest(pmcData: IPmcData, request: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
175
types/controllers/RagfairController.d.ts
vendored
175
types/controllers/RagfairController.d.ts
vendored
@ -1,41 +1,44 @@
|
|||||||
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
|
import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator";
|
||||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
|
||||||
import { InventoryHelper } from "../helpers/InventoryHelper";
|
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { PaymentHelper } from "../helpers/PaymentHelper";
|
import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { RagfairHelper } from "../helpers/RagfairHelper";
|
import { RagfairHelper } from "@spt-aki/helpers/RagfairHelper";
|
||||||
import { RagfairOfferHelper } from "../helpers/RagfairOfferHelper";
|
import { RagfairOfferHelper } from "@spt-aki/helpers/RagfairOfferHelper";
|
||||||
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
|
import { RagfairSellHelper } from "@spt-aki/helpers/RagfairSellHelper";
|
||||||
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
|
import { RagfairSortHelper } from "@spt-aki/helpers/RagfairSortHelper";
|
||||||
import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
|
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
|
||||||
import { TraderHelper } from "../helpers/TraderHelper";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader";
|
||||||
import { ITraderAssort } from "../models/eft/common/tables/ITrader";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
import { IAddOfferRequestData, Requirement } from "@spt-aki/models/eft/ragfair/IAddOfferRequestData";
|
||||||
import { IAddOfferRequestData, Requirement } from "../models/eft/ragfair/IAddOfferRequestData";
|
import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOfferRequestData";
|
||||||
import { IExtendOfferRequestData } from "../models/eft/ragfair/IExtendOfferRequestData";
|
import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult";
|
||||||
import { IGetItemPriceResult } from "../models/eft/ragfair/IGetItemPriceResult";
|
import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData";
|
||||||
import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPriceRequestData";
|
import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult";
|
||||||
import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
|
import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest";
|
||||||
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
|
import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
|
||||||
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
|
import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData";
|
||||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||||
import { RagfairServer } from "../servers/RagfairServer";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { RagfairServer } from "@spt-aki/servers/RagfairServer";
|
||||||
import { PaymentService } from "../services/PaymentService";
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
import { RagfairPriceService } from "../services/RagfairPriceService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
|
import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { RagfairRequiredItemsService } from "@spt-aki/services/RagfairRequiredItemsService";
|
||||||
|
import { RagfairTaxService } from "@spt-aki/services/RagfairTaxService";
|
||||||
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
/**
|
/**
|
||||||
* Handle RagfairCallback events
|
* Handle RagfairCallback events
|
||||||
*/
|
*/
|
||||||
@ -50,7 +53,7 @@ export declare class RagfairController {
|
|||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected ragfairSellHelper: RagfairSellHelper;
|
protected ragfairSellHelper: RagfairSellHelper;
|
||||||
protected ragfairTaxHelper: RagfairTaxHelper;
|
protected ragfairTaxService: RagfairTaxService;
|
||||||
protected ragfairSortHelper: RagfairSortHelper;
|
protected ragfairSortHelper: RagfairSortHelper;
|
||||||
protected ragfairOfferHelper: RagfairOfferHelper;
|
protected ragfairOfferHelper: RagfairOfferHelper;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
@ -66,12 +69,19 @@ export declare class RagfairController {
|
|||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected ragfairConfig: IRagfairConfig;
|
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);
|
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, 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, searchRequest: ISearchRequestData): IGetOffersResult;
|
getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult;
|
||||||
|
/**
|
||||||
|
* Handle client/ragfair/offer/findbyid
|
||||||
|
* @param sessionId Player id
|
||||||
|
* @param request Request data
|
||||||
|
* @returns IRagfairOffer
|
||||||
|
*/
|
||||||
|
getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer;
|
||||||
/**
|
/**
|
||||||
* Get offers for the client based on type of search being performed
|
* Get offers for the client based on type of search being performed
|
||||||
* @param searchRequest Client search request data
|
* @param searchRequest Client search request data
|
||||||
* @param itemsToAdd
|
* @param itemsToAdd comes from ragfairHelper.filterCategories()
|
||||||
* @param traderAssorts Trader assorts
|
* @param traderAssorts Trader assorts
|
||||||
* @param pmcProfile Player profile
|
* @param pmcProfile Player profile
|
||||||
* @returns array of offers
|
* @returns array of offers
|
||||||
@ -81,17 +91,9 @@ export declare class RagfairController {
|
|||||||
* Get categories for the type of search being performed, linked/required/all
|
* Get categories for the type of search being performed, linked/required/all
|
||||||
* @param searchRequest Client search request data
|
* @param searchRequest Client search request data
|
||||||
* @param offers ragfair offers to get categories for
|
* @param offers ragfair offers to get categories for
|
||||||
* @returns record with tpls + counts
|
* @returns record with templates + counts
|
||||||
*/
|
*/
|
||||||
protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
|
protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
|
||||||
/**
|
|
||||||
* Add Required offers to offers result
|
|
||||||
* @param searchRequest Client search request data
|
|
||||||
* @param assorts
|
|
||||||
* @param pmcProfile Player profile
|
|
||||||
* @param result Result object being sent back to client
|
|
||||||
*/
|
|
||||||
protected addRequiredOffersToResult(searchRequest: ISearchRequestData, assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData, result: IGetOffersResult): void;
|
|
||||||
/**
|
/**
|
||||||
* Add index to all offers passed in (0-indexed)
|
* Add index to all offers passed in (0-indexed)
|
||||||
* @param offers Offers to add index value to
|
* @param offers Offers to add index value to
|
||||||
@ -110,6 +112,9 @@ export declare class RagfairController {
|
|||||||
protected setTraderOfferStackSize(offer: IRagfairOffer): void;
|
protected setTraderOfferStackSize(offer: IRagfairOffer): void;
|
||||||
protected isLinkedSearch(info: ISearchRequestData): boolean;
|
protected isLinkedSearch(info: ISearchRequestData): boolean;
|
||||||
protected isRequiredSearch(info: ISearchRequestData): boolean;
|
protected isRequiredSearch(info: ISearchRequestData): boolean;
|
||||||
|
/**
|
||||||
|
* Check all profiles and sell player offers / send player money for listing if it sold
|
||||||
|
*/
|
||||||
update(): void;
|
update(): void;
|
||||||
/**
|
/**
|
||||||
* Called when creating an offer on flea, fills values in top right corner
|
* Called when creating an offer on flea, fills values in top right corner
|
||||||
@ -117,10 +122,72 @@ export declare class RagfairController {
|
|||||||
* @returns min/avg/max values for an item based on flea offers available
|
* @returns min/avg/max values for an item based on flea offers available
|
||||||
*/
|
*/
|
||||||
getItemMinAvgMaxFleaPriceValues(getPriceRequest: IGetMarketPriceRequestData): IGetItemPriceResult;
|
getItemMinAvgMaxFleaPriceValues(getPriceRequest: IGetMarketPriceRequestData): IGetItemPriceResult;
|
||||||
addPlayerOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
/**
|
||||||
|
* List item(s) on flea for sale
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param offerRequest Flea list creation offer
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
addPlayerOffer(pmcData: IPmcData, offerRequest: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Charge player a listing fee for using flea, pulls charge from data previously sent by client
|
||||||
|
* @param sessionID Player id
|
||||||
|
* @param rootItem Base item being listed (used when client tax cost not found and must be done on server)
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param requirementsPriceInRub Rouble cost player chose for listing (used when client tax cost not found and must be done on server)
|
||||||
|
* @param itemStackCount How many items were listed in player (used when client tax cost not found and must be done on server)
|
||||||
|
* @param offerRequest Add offer request object from client
|
||||||
|
* @param output IItemEventRouterResponse
|
||||||
|
* @returns True if charging tax to player failed
|
||||||
|
*/
|
||||||
|
protected chargePlayerTaxFee(sessionID: string, rootItem: Item, pmcData: IPmcData, requirementsPriceInRub: number, itemStackCount: number, offerRequest: IAddOfferRequestData, output: IItemEventRouterResponse): boolean;
|
||||||
|
/**
|
||||||
|
* Is the item to be listed on the flea valid
|
||||||
|
* @param offerRequest Client offer request
|
||||||
|
* @param errorMessage message to show to player when offer is invalid
|
||||||
|
* @returns Is offer valid
|
||||||
|
*/
|
||||||
|
protected isValidPlayerOfferRequest(offerRequest: IAddOfferRequestData, errorMessage: string): boolean;
|
||||||
|
/**
|
||||||
|
* Get the handbook price in roubles for the items being listed
|
||||||
|
* @param requirements
|
||||||
|
* @returns Rouble price
|
||||||
|
*/
|
||||||
|
protected calculateRequirementsPriceInRub(requirements: Requirement[]): number;
|
||||||
|
/**
|
||||||
|
* Using item ids from flea offer request, find corresponding items from player inventory and return as array
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param itemIdsFromFleaOfferRequest Ids from request
|
||||||
|
* @returns Array of items from player inventory
|
||||||
|
*/
|
||||||
|
protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): {
|
||||||
|
items: Item[] | null;
|
||||||
|
errorMessage: string | null;
|
||||||
|
};
|
||||||
createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer;
|
createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer;
|
||||||
getAllFleaPrices(): Record<string, number>;
|
getAllFleaPrices(): Record<string, number>;
|
||||||
getStaticPrices(): Record<string, number>;
|
getStaticPrices(): Record<string, number>;
|
||||||
removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse;
|
/**
|
||||||
extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
* User requested removal of the offer, actually reduces the time to 71 seconds,
|
||||||
|
* allowing for the possibility of extending the auction before it's end time
|
||||||
|
* @param removeRequest Remove offer request
|
||||||
|
* @param sessionId Players id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
removeOffer(removeRequest: IRemoveOfferRequestData, sessionId: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Extend a ragfair offers listing time
|
||||||
|
* @param extendRequest Extend offer request
|
||||||
|
* @param sessionId Players id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
extendOffer(extendRequest: IExtendOfferRequestData, sessionId: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Create a basic trader request object with price and currency type
|
||||||
|
* @param currency What currency: RUB, EURO, USD
|
||||||
|
* @param value Amount of currency
|
||||||
|
* @returns IProcessBuyTradeRequestData
|
||||||
|
*/
|
||||||
|
protected createBuyTradeRequestObject(currency: string, value: number): IProcessBuyTradeRequestData;
|
||||||
}
|
}
|
||||||
|
28
types/controllers/RepairController.d.ts
vendored
28
types/controllers/RepairController.d.ts
vendored
@ -1,16 +1,16 @@
|
|||||||
import { QuestHelper } from "../helpers/QuestHelper";
|
import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
|
||||||
import { RepairHelper } from "../helpers/RepairHelper";
|
import { RepairHelper } from "@spt-aki/helpers/RepairHelper";
|
||||||
import { TraderHelper } from "../helpers/TraderHelper";
|
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionDataRequest";
|
import { IRepairActionDataRequest } from "@spt-aki/models/eft/repair/IRepairActionDataRequest";
|
||||||
import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest";
|
import { ITraderRepairActionDataRequest } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest";
|
||||||
import { IRepairConfig } from "../models/spt/config/IRepairConfig";
|
import { IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { PaymentService } from "../services/PaymentService";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
import { RepairService } from "../services/RepairService";
|
import { RepairService } from "@spt-aki/services/RepairService";
|
||||||
export declare class RepairController {
|
export declare class RepairController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
@ -23,6 +23,7 @@ export declare class RepairController {
|
|||||||
protected repairConfig: IRepairConfig;
|
protected repairConfig: IRepairConfig;
|
||||||
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService);
|
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService);
|
||||||
/**
|
/**
|
||||||
|
* Handle TraderRepair event
|
||||||
* Repair with trader
|
* Repair with trader
|
||||||
* @param sessionID session id
|
* @param sessionID session id
|
||||||
* @param body endpoint request data
|
* @param body endpoint request data
|
||||||
@ -31,6 +32,7 @@ export declare class RepairController {
|
|||||||
*/
|
*/
|
||||||
traderRepair(sessionID: string, body: ITraderRepairActionDataRequest, pmcData: IPmcData): IItemEventRouterResponse;
|
traderRepair(sessionID: string, body: ITraderRepairActionDataRequest, pmcData: IPmcData): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle Repair event
|
||||||
* Repair with repair kit
|
* Repair with repair kit
|
||||||
* @param sessionID session id
|
* @param sessionID session id
|
||||||
* @param body endpoint request data
|
* @param body endpoint request data
|
||||||
|
248
types/controllers/RepeatableQuestController.d.ts
vendored
248
types/controllers/RepeatableQuestController.d.ts
vendored
@ -1,83 +1,47 @@
|
|||||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
import { RepeatableQuestGenerator } from "@spt-aki/generators/RepeatableQuestGenerator";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { PresetHelper } from "../helpers/PresetHelper";
|
import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper";
|
||||||
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
|
import { RepeatableQuestHelper } from "@spt-aki/helpers/RepeatableQuestHelper";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { Exit } from "../models/eft/common/ILocationBase";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests";
|
||||||
import { TraderInfo } from "../models/eft/common/tables/IBotBase";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPmcDataRepeatableQuest, IRepeatableQuest, IReward, IRewards } from "../models/eft/common/tables/IRepeatableQuests";
|
import { IRepeatableQuestChangeRequest } from "@spt-aki/models/eft/quests/IRepeatableQuestChangeRequest";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
import { IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool";
|
||||||
import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { ELocationName } from "../models/enums/ELocationName";
|
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||||
import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
import { ItemFilterService } from "../services/ItemFilterService";
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { ObjectId } from "@spt-aki/utils/ObjectId";
|
||||||
import { PaymentService } from "../services/PaymentService";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
import { ProfileFixerService } from "../services/ProfileFixerService";
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
|
||||||
import { MathUtil } from "../utils/MathUtil";
|
|
||||||
import { ObjectId } from "../utils/ObjectId";
|
|
||||||
import { ProbabilityObject, ProbabilityObjectArray, RandomUtil } from "../utils/RandomUtil";
|
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
|
||||||
export interface IQuestTypePool {
|
|
||||||
types: string[];
|
|
||||||
pool: IQuestPool;
|
|
||||||
}
|
|
||||||
export interface IQuestPool {
|
|
||||||
Exploration: IExplorationPool;
|
|
||||||
Elimination: IEliminationPool;
|
|
||||||
}
|
|
||||||
export interface IExplorationPool {
|
|
||||||
locations: Partial<Record<ELocationName, string[]>>;
|
|
||||||
}
|
|
||||||
export interface IEliminationPool {
|
|
||||||
targets: IEliminationTargetPool;
|
|
||||||
}
|
|
||||||
export interface IEliminationTargetPool {
|
|
||||||
Savage?: ITargetLocation;
|
|
||||||
AnyPmc?: ITargetLocation;
|
|
||||||
bossBully?: ITargetLocation;
|
|
||||||
bossGluhar?: ITargetLocation;
|
|
||||||
bossKilla?: ITargetLocation;
|
|
||||||
bossSanitar?: ITargetLocation;
|
|
||||||
bossTagilla?: ITargetLocation;
|
|
||||||
bossKojaniy?: ITargetLocation;
|
|
||||||
}
|
|
||||||
export interface ITargetLocation {
|
|
||||||
locations: string[];
|
|
||||||
}
|
|
||||||
export declare class RepeatableQuestController {
|
export declare class RepeatableQuestController {
|
||||||
protected timeUtil: TimeUtil;
|
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
|
protected databaseServer: DatabaseServer;
|
||||||
|
protected timeUtil: TimeUtil;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected mathUtil: MathUtil;
|
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
|
||||||
protected itemHelper: ItemHelper;
|
|
||||||
protected presetHelper: PresetHelper;
|
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected profileFixerService: ProfileFixerService;
|
protected profileFixerService: ProfileFixerService;
|
||||||
protected handbookHelper: HandbookHelper;
|
|
||||||
protected ragfairServerHelper: RagfairServerHelper;
|
protected ragfairServerHelper: RagfairServerHelper;
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
protected localisationService: LocalisationService;
|
|
||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected objectId: ObjectId;
|
protected objectId: ObjectId;
|
||||||
protected itemFilterService: ItemFilterService;
|
protected repeatableQuestGenerator: RepeatableQuestGenerator;
|
||||||
|
protected repeatableQuestHelper: RepeatableQuestHelper;
|
||||||
|
protected questHelper: QuestHelper;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected questConfig: IQuestConfig;
|
protected questConfig: IQuestConfig;
|
||||||
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);
|
constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint
|
* Handle client/repeatalbeQuests/activityPeriods
|
||||||
* Returns an array of objects in the format of repeatable quests to the client.
|
* Returns an array of objects in the format of repeatable quests to the client.
|
||||||
* repeatableQuestObject = {
|
* repeatableQuestObject = {
|
||||||
* id: Unique Id,
|
* id: Unique Id,
|
||||||
@ -97,11 +61,19 @@ export declare class RepeatableQuestController {
|
|||||||
* (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards)
|
* (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards)
|
||||||
* The new quests generated are again persisted in profile.RepeatableQuests
|
* The new quests generated are again persisted in profile.RepeatableQuests
|
||||||
*
|
*
|
||||||
|
* @param {string} _info Request from client
|
||||||
|
* @param {string} sessionID Player's session id
|
||||||
*
|
*
|
||||||
* @param {string} sessionId Player's session id
|
* @returns {array} Array of "repeatableQuestObjects" as descibed above
|
||||||
* @returns {array} array of "repeatableQuestObjects" as descibed above
|
|
||||||
*/
|
*/
|
||||||
getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[];
|
getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[];
|
||||||
|
/**
|
||||||
|
* Get the number of quests to generate - takes into account charisma state of player
|
||||||
|
* @param repeatableConfig Config
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @returns Quest count
|
||||||
|
*/
|
||||||
|
protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number;
|
||||||
/**
|
/**
|
||||||
* Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists
|
* Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists
|
||||||
* @param repeatableConfig daily/weekly config
|
* @param repeatableConfig daily/weekly config
|
||||||
@ -109,148 +81,24 @@ export declare class RepeatableQuestController {
|
|||||||
* @returns IPmcDataRepeatableQuest
|
* @returns IPmcDataRepeatableQuest
|
||||||
*/
|
*/
|
||||||
protected getRepeatableQuestSubTypeFromProfile(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): 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
|
|
||||||
*/
|
|
||||||
generateRepeatableQuest(pmcLevel: number, pmcTraderInfo: Record<string, TraderInfo>, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
|
|
||||||
/**
|
/**
|
||||||
* Just for debug reasons. Draws dailies a random assort of dailies extracted from dumps
|
* Just for debug reasons. Draws dailies a random assort of dailies extracted from dumps
|
||||||
*/
|
*/
|
||||||
generateDebugDailies(dailiesPool: any, factory: any, number: number): 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, side: string): IRepeatableQuest;
|
|
||||||
/**
|
|
||||||
* Generates a valid Exploration quest
|
|
||||||
*
|
|
||||||
* @param {integer} pmcLevel player's level for reward generation
|
|
||||||
* @param {string} traderId trader from which the quest will be provided
|
|
||||||
* @param {object} questTypePool Pools for quests (used to avoid redundant quests)
|
|
||||||
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
|
|
||||||
* @returns {object} object of quest type format for "Exploration" (see assets/database/templates/repeatableQuests.json)
|
|
||||||
*/
|
|
||||||
generateExplorationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IExploration;
|
|
||||||
/**
|
|
||||||
* Generates a valid Completion quest
|
|
||||||
*
|
|
||||||
* @param {integer} pmcLevel player's level for requested items and reward generation
|
|
||||||
* @param {string} traderId trader from which the quest will be provided
|
|
||||||
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
|
|
||||||
* @returns {object} object of quest type format for "Completion" (see assets/database/templates/repeatableQuests.json)
|
|
||||||
*/
|
|
||||||
generateCompletionQuest(pmcLevel: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): ICompletion;
|
|
||||||
/**
|
|
||||||
* Generates a valid Elimination quest
|
|
||||||
*
|
|
||||||
* @param {integer} pmcLevel player's level for requested items and reward generation
|
|
||||||
* @param {string} traderId trader from which the quest will be provided
|
|
||||||
* @param {object} questTypePool Pools for quests (used to avoid redundant quests)
|
|
||||||
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
|
|
||||||
* @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
|
|
||||||
*
|
|
||||||
* @param {string} exit The exit name to generate the condition for
|
|
||||||
* @returns {object} Exit condition
|
|
||||||
*/
|
|
||||||
generateExplorationExitCondition(exit: Exit): IExplorationCondition;
|
|
||||||
/**
|
|
||||||
* A repeatable quest, besides some more or less static components, exists of reward and condition (see assets/database/templates/repeatableQuests.json)
|
|
||||||
* This is a helper method for GenerateCompletionQuest to create a completion condition (of which a completion quest theoretically can have many)
|
|
||||||
*
|
|
||||||
* @param {string} targetItemId id of the item to request
|
|
||||||
* @param {integer} value amount of items of this specific type to request
|
|
||||||
* @returns {object} object of "Completion"-condition
|
|
||||||
*/
|
|
||||||
generateCompletionAvailableForFinish(targetItemId: string, value: number): ICompletionAvailableFor;
|
|
||||||
/**
|
|
||||||
* A repeatable quest, besides some more or less static components, exists of reward and condition (see assets/database/templates/repeatableQuests.json)
|
|
||||||
* This is a helper method for GenerateEliminationQuest to create a location condition.
|
|
||||||
*
|
|
||||||
* @param {string} location the location on which to fulfill the elimination quest
|
|
||||||
* @returns {object} object of "Elimination"-location-subcondition
|
|
||||||
*/
|
|
||||||
generateEliminationLocation(location: string[]): IEliminationCondition;
|
|
||||||
/**
|
|
||||||
* A repeatable quest, besides some more or less static components, exists of reward and condition (see assets/database/templates/repeatableQuests.json)
|
|
||||||
* This is a helper method for GenerateEliminationQuest to create a kill condition.
|
|
||||||
*
|
|
||||||
* @param {string} target array of target npcs e.g. "AnyPmc", "Savage"
|
|
||||||
* @param {array} bodyParts array of body parts with which to kill e.g. ["stomach", "thorax"]
|
|
||||||
* @param {number} distance distance from which to kill (currently only >= supported)
|
|
||||||
* @returns {object} object of "Elimination"-kill-subcondition
|
|
||||||
*/
|
|
||||||
generateEliminationCondition(target: string, bodyPart: string[], distance: number): IEliminationCondition;
|
|
||||||
/**
|
/**
|
||||||
* Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently
|
* Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently
|
||||||
* narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests
|
* narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests
|
||||||
* where you have to e.g. kill scavs in same locations.
|
* where you have to e.g. kill scavs in same locations.
|
||||||
*
|
* @param repeatableConfig main repeatable quest config
|
||||||
* @returns {object} the quest pool
|
* @param pmcLevel level of pmc generating quest pool
|
||||||
|
* @returns IQuestTypePool
|
||||||
*/
|
*/
|
||||||
generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool;
|
protected generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool;
|
||||||
/**
|
protected createBaseQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool;
|
||||||
* Generate the reward for a mission. A reward can consist of
|
|
||||||
* - Experience
|
|
||||||
* - Money
|
|
||||||
* - Items
|
|
||||||
* - Trader Reputation
|
|
||||||
*
|
|
||||||
* The reward is dependent on the player level as given by the wiki. The exact mapping of pmcLevel to
|
|
||||||
* experience / money / items / trader reputation can be defined in QuestConfig.js
|
|
||||||
*
|
|
||||||
* There's also a random variation of the reward the spread of which can be also defined in the config.
|
|
||||||
*
|
|
||||||
* Additonaly, a scaling factor w.r.t. quest difficulty going from 0.2...1 can be used
|
|
||||||
*
|
|
||||||
* @param {integer} pmcLevel player's level
|
|
||||||
* @param {number} difficulty a reward scaling factor goint from 0.2 to 1
|
|
||||||
* @param {string} traderId the trader for reputation gain (and possible in the future filtering of reward item type based on trader)
|
|
||||||
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
|
|
||||||
* @returns {object} object of "Reward"-type that can be given for a repeatable mission
|
|
||||||
*/
|
|
||||||
generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards;
|
|
||||||
/**
|
|
||||||
* Helper to create a reward item structured as required by the client
|
|
||||||
*
|
|
||||||
* @param {string} tpl itemId of the rewarded item
|
|
||||||
* @param {integer} value amount of items to give
|
|
||||||
* @param {integer} index all rewards will be appended to a list, for unkown reasons the client wants the index
|
|
||||||
* @returns {object} object of "Reward"-item-type
|
|
||||||
*/
|
|
||||||
generateRewardItem(tpl: string, value: number, index: number, preset?: any): IReward;
|
|
||||||
debugLogRepeatableQuestIds(pmcData: IPmcData): void;
|
debugLogRepeatableQuestIds(pmcData: IPmcData): void;
|
||||||
probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>;
|
|
||||||
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)
|
* Handle RepeatableQuestChange event
|
||||||
* @param repeatableQuestConfig config file
|
|
||||||
* @returns a list of rewardable items [[_tpl, itemTemplate],...]
|
|
||||||
*/
|
*/
|
||||||
protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [string, ITemplateItem][];
|
changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
|
||||||
* 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 {string} tpl template id of item to check
|
|
||||||
* @returns boolean: true if item is valid reward
|
|
||||||
*/
|
|
||||||
isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean;
|
|
||||||
}
|
}
|
||||||
|
108
types/controllers/TradeController.d.ts
vendored
108
types/controllers/TradeController.d.ts
vendored
@ -1,31 +1,99 @@
|
|||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { TradeHelper } from "../helpers/TradeHelper";
|
import { TradeHelper } from "@spt-aki/helpers/TradeHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
|
||||||
import { Upd } from "../models/eft/common/tables/IItem";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
|
import { ITraderBase } from "@spt-aki/models/eft/common/tables/ITrader";
|
||||||
import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IProcessBaseTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBaseTradeRequestData";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { IOfferRequest, IProcessRagfairTradeRequestData } from "@spt-aki/models/eft/trade/IProcessRagfairTradeRequestData";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ISellScavItemsToFenceRequestData } from "@spt-aki/models/eft/trade/ISellScavItemsToFenceRequestData";
|
||||||
import { RagfairServer } from "../servers/RagfairServer";
|
import { Traders } from "@spt-aki/models/enums/Traders";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
|
||||||
declare class TradeController {
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
|
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||||
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
|
import { RagfairServer } from "@spt-aki/servers/RagfairServer";
|
||||||
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
|
export declare class TradeController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
|
protected databaseServer: DatabaseServer;
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
protected tradeHelper: TradeHelper;
|
protected tradeHelper: TradeHelper;
|
||||||
|
protected timeUtil: TimeUtil;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
|
protected hashUtil: HashUtil;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
|
protected traderHelper: TraderHelper;
|
||||||
|
protected jsonUtil: JsonUtil;
|
||||||
protected ragfairServer: RagfairServer;
|
protected ragfairServer: RagfairServer;
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
|
protected mailSendService: MailSendService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected roubleTpl: string;
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer);
|
protected traderConfig: ITraderConfig;
|
||||||
confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse;
|
constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer);
|
||||||
confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
/** Handle TradingConfirm event */
|
||||||
|
confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle RagFairBuyOffer event */
|
||||||
|
confirmRagfairTrading(pmcData: IPmcData, request: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Buy an item off the flea sold by a trader
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param fleaOffer Offer being purchased
|
||||||
|
* @param requestOffer request data from client
|
||||||
|
* @param output Output to send back to client
|
||||||
|
*/
|
||||||
|
protected buyTraderItemFromRagfair(sessionId: string, pmcData: IPmcData, fleaOffer: IRagfairOffer, requestOffer: IOfferRequest, output: IItemEventRouterResponse): void;
|
||||||
|
/**
|
||||||
|
* Buy an item off the flea sold by a PMC
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param fleaOffer Offer being purchased
|
||||||
|
* @param requestOffer Request data from client
|
||||||
|
* @param output Output to send back to client
|
||||||
|
*/
|
||||||
|
protected buyPmcItemFromRagfair(sessionId: string, pmcData: IPmcData, fleaOffer: IRagfairOffer, requestOffer: IOfferRequest, output: IItemEventRouterResponse): void;
|
||||||
|
/**
|
||||||
|
* Does Player have necessary trader loyalty to purchase flea offer
|
||||||
|
* @param sellerIsTrader is seller trader
|
||||||
|
* @param fleaOffer FLea offer being bought
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @returns True if player can buy offer
|
||||||
|
*/
|
||||||
|
protected playerLacksTraderLoyaltyLevelToBuyOffer(fleaOffer: IRagfairOffer, pmcData: IPmcData): boolean;
|
||||||
|
/** Handle SellAllFromSavage event */
|
||||||
|
sellScavItemsToFence(pmcData: IPmcData, request: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Send the specified rouble total to player as mail
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param trader Trader to sell items to
|
||||||
|
* @param output IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
protected mailMoneyToPlayer(sessionId: string, roublesToSend: number, trader: Traders): void;
|
||||||
|
/**
|
||||||
|
* Looks up an items children and gets total handbook price for them
|
||||||
|
* @param parentItemId parent item that has children we want to sum price of
|
||||||
|
* @param items All items (parent + children)
|
||||||
|
* @param handbookPrices Prices of items from handbook
|
||||||
|
* @param traderDetails Trader being sold to to perform buy category check against
|
||||||
|
* @returns Rouble price
|
||||||
|
*/
|
||||||
|
protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record<string, number>, traderDetails: ITraderBase): number;
|
||||||
}
|
}
|
||||||
export { TradeController };
|
|
||||||
|
30
types/controllers/TraderController.d.ts
vendored
30
types/controllers/TraderController.d.ts
vendored
@ -1,28 +1,26 @@
|
|||||||
import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator";
|
import { FenceBaseAssortGenerator } from "@spt-aki/generators/FenceBaseAssortGenerator";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { TraderAssortHelper } from "../helpers/TraderAssortHelper";
|
import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper";
|
||||||
import { TraderHelper } from "../helpers/TraderHelper";
|
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
|
||||||
import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
|
import { ITraderAssort, ITraderBase } from "@spt-aki/models/eft/common/tables/ITrader";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { FenceService } from "../services/FenceService";
|
import { FenceService } from "@spt-aki/services/FenceService";
|
||||||
import { TraderAssortService } from "../services/TraderAssortService";
|
import { TraderAssortService } from "@spt-aki/services/TraderAssortService";
|
||||||
import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService";
|
import { TraderPurchasePersisterService } from "@spt-aki/services/TraderPurchasePersisterService";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
|
||||||
export declare class TraderController {
|
export declare class TraderController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected traderAssortHelper: TraderAssortHelper;
|
protected traderAssortHelper: TraderAssortHelper;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected traderHelper: TraderHelper;
|
protected traderHelper: TraderHelper;
|
||||||
protected timeUtil: TimeUtil;
|
|
||||||
protected traderAssortService: TraderAssortService;
|
protected traderAssortService: TraderAssortService;
|
||||||
protected traderPurchasePersisterService: TraderPurchasePersisterService;
|
protected traderPurchasePersisterService: TraderPurchasePersisterService;
|
||||||
protected fenceService: FenceService;
|
protected fenceService: FenceService;
|
||||||
protected fenceBaseAssortGenerator: FenceBaseAssortGenerator;
|
protected fenceBaseAssortGenerator: FenceBaseAssortGenerator;
|
||||||
protected jsonUtil: JsonUtil;
|
protected 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);
|
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil);
|
||||||
/**
|
/**
|
||||||
* Runs when onLoad event is fired
|
* Runs when onLoad event is fired
|
||||||
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
|
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
|
||||||
@ -37,6 +35,7 @@ export declare class TraderController {
|
|||||||
*/
|
*/
|
||||||
update(): boolean;
|
update(): boolean;
|
||||||
/**
|
/**
|
||||||
|
* Handle client/trading/api/traderSettings
|
||||||
* Return an array of all traders
|
* Return an array of all traders
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
* @returns array if ITraderBase objects
|
* @returns array if ITraderBase objects
|
||||||
@ -49,7 +48,8 @@ export declare class TraderController {
|
|||||||
* @returns 1,-1 or 0
|
* @returns 1,-1 or 0
|
||||||
*/
|
*/
|
||||||
protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number;
|
protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number;
|
||||||
|
/** Handle client/trading/api/getTrader */
|
||||||
getTrader(sessionID: string, traderID: string): ITraderBase;
|
getTrader(sessionID: string, traderID: string): ITraderBase;
|
||||||
|
/** Handle client/trading/api/getTraderAssort */
|
||||||
getAssort(sessionId: string, traderId: string): ITraderAssort;
|
getAssort(sessionId: string, traderId: string): ITraderAssort;
|
||||||
getPurchasesData(sessionID: string, traderID: string): Record<string, IBarterScheme[][]>;
|
|
||||||
}
|
}
|
||||||
|
11
types/controllers/WeatherController.d.ts
vendored
11
types/controllers/WeatherController.d.ts
vendored
@ -1,14 +1,15 @@
|
|||||||
import { WeatherGenerator } from "../generators/WeatherGenerator";
|
import { WeatherGenerator } from "@spt-aki/generators/WeatherGenerator";
|
||||||
import { IWeatherData } from "../models/eft/weather/IWeatherData";
|
import { IWeatherData } from "@spt-aki/models/eft/weather/IWeatherData";
|
||||||
import { IWeatherConfig } from "../models/spt/config/IWeatherConfig";
|
import { IWeatherConfig } from "@spt-aki/models/spt/config/IWeatherConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
export declare class WeatherController {
|
export declare class WeatherController {
|
||||||
protected weatherGenerator: WeatherGenerator;
|
protected weatherGenerator: WeatherGenerator;
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected weatherConfig: IWeatherConfig;
|
protected weatherConfig: IWeatherConfig;
|
||||||
constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer);
|
constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer);
|
||||||
|
/** Handle client/weather */
|
||||||
generate(): IWeatherData;
|
generate(): IWeatherData;
|
||||||
/**
|
/**
|
||||||
* Get the current in-raid time (MUST HAVE PLAYER LOGGED INTO CLIENT TO WORK)
|
* Get the current in-raid time (MUST HAVE PLAYER LOGGED INTO CLIENT TO WORK)
|
||||||
|
10
types/controllers/WishlistController.d.ts
vendored
10
types/controllers/WishlistController.d.ts
vendored
@ -1,10 +1,12 @@
|
|||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IWishlistActionData } from "@spt-aki/models/eft/wishlist/IWishlistActionData";
|
||||||
import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData";
|
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||||
export declare class WishlistController {
|
export declare class WishlistController {
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
constructor(eventOutputHolder: EventOutputHolder);
|
constructor(eventOutputHolder: EventOutputHolder);
|
||||||
|
/** Handle AddToWishList */
|
||||||
addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle RemoveFromWishList event */
|
||||||
removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
12
types/di/Router.d.ts
vendored
12
types/di/Router.d.ts
vendored
@ -1,11 +1,11 @@
|
|||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
export declare class Router {
|
export declare class Router {
|
||||||
private handledRoutes;
|
protected handledRoutes: HandledRoute[];
|
||||||
getTopLevelRoute(): string;
|
getTopLevelRoute(): string;
|
||||||
protected getHandledRoutes(): HandledRoute[];
|
protected getHandledRoutes(): HandledRoute[];
|
||||||
private getInternalHandledRoutes;
|
protected getInternalHandledRoutes(): HandledRoute[];
|
||||||
canHandle(url: string, partialMatch?: boolean): boolean;
|
canHandle(url: string, partialMatch?: boolean): boolean;
|
||||||
}
|
}
|
||||||
export declare class StaticRouter extends Router {
|
export declare class StaticRouter extends Router {
|
||||||
@ -21,11 +21,9 @@ export declare class DynamicRouter extends Router {
|
|||||||
getHandledRoutes(): HandledRoute[];
|
getHandledRoutes(): HandledRoute[];
|
||||||
}
|
}
|
||||||
export declare class ItemEventRouterDefinition extends Router {
|
export declare class ItemEventRouterDefinition extends Router {
|
||||||
constructor();
|
|
||||||
handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse;
|
handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
export declare class SaveLoadRouter extends Router {
|
export declare class SaveLoadRouter extends Router {
|
||||||
constructor();
|
|
||||||
handleLoad(profile: IAkiProfile): IAkiProfile;
|
handleLoad(profile: IAkiProfile): IAkiProfile;
|
||||||
}
|
}
|
||||||
export declare class HandledRoute {
|
export declare class HandledRoute {
|
||||||
|
2
types/di/Serializer.d.ts
vendored
2
types/di/Serializer.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
/// <reference types="node" />
|
/// <reference types="node" />
|
||||||
import { IncomingMessage, ServerResponse } from "http";
|
import { IncomingMessage, ServerResponse } from "node:http";
|
||||||
export declare class Serializer {
|
export declare class Serializer {
|
||||||
serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void;
|
serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void;
|
||||||
canHandle(something: string): boolean;
|
canHandle(something: string): boolean;
|
||||||
|
153
types/generators/BotEquipmentModGenerator.d.ts
vendored
153
types/generators/BotEquipmentModGenerator.d.ts
vendored
@ -1,24 +1,31 @@
|
|||||||
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper";
|
||||||
import { BotHelper } from "../helpers/BotHelper";
|
import { BotHelper } from "@spt-aki/helpers/BotHelper";
|
||||||
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
|
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { ProbabilityHelper } from "../helpers/ProbabilityHelper";
|
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProbabilityHelper } from "@spt-aki/helpers/ProbabilityHelper";
|
||||||
import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
|
||||||
import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem";
|
import { IPreset } from "@spt-aki/models/eft/common/IGlobals";
|
||||||
import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig";
|
import { Mods, ModsChances } from "@spt-aki/models/eft/common/tables/IBotType";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ITemplateItem, Slot } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ModSpawn } from "@spt-aki/models/enums/ModSpawn";
|
||||||
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
|
import { IChooseRandomCompatibleModResult } from "@spt-aki/models/spt/bots/IChooseRandomCompatibleModResult";
|
||||||
import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
|
import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
|
||||||
import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { ItemFilterService } from "../services/ItemFilterService";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { BotEquipmentFilterService } from "@spt-aki/services/BotEquipmentFilterService";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { BotEquipmentModPoolService } from "@spt-aki/services/BotEquipmentModPoolService";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { BotModLimits, BotWeaponModLimitService } from "@spt-aki/services/BotWeaponModLimitService";
|
||||||
|
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||||
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
|
import { IGenerateEquipmentProperties } from "./BotInventoryGenerator";
|
||||||
|
import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult";
|
||||||
export declare class BotEquipmentModGenerator {
|
export declare class BotEquipmentModGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
@ -34,45 +41,54 @@ export declare class BotEquipmentModGenerator {
|
|||||||
protected botHelper: BotHelper;
|
protected botHelper: BotHelper;
|
||||||
protected botGeneratorHelper: BotGeneratorHelper;
|
protected botGeneratorHelper: BotGeneratorHelper;
|
||||||
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
||||||
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
|
protected presetHelper: PresetHelper;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected botEquipmentModPoolService: BotEquipmentModPoolService;
|
protected botEquipmentModPoolService: BotEquipmentModPoolService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected botConfig: IBotConfig;
|
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);
|
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, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Check mods are compatible and add to array
|
* Check mods are compatible and add to array
|
||||||
* @param equipment Equipment item to add mods to
|
* @param equipment Equipment item to add mods to
|
||||||
* @param modPool Mod list to choose frm
|
* @param modPool Mod list to choose frm
|
||||||
* @param parentId parentid of item to add mod to
|
* @param parentId parentid of item to add mod to
|
||||||
* @param parentTemplate template objet of item to add mods 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
|
* @param forceSpawn should this mod be forced to spawn
|
||||||
* @returns Item + compatible mods as an array
|
* @returns Item + compatible mods as an array
|
||||||
*/
|
*/
|
||||||
generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, botRole: string, forceSpawn?: boolean): Item[];
|
generateModsForEquipment(equipment: Item[], parentId: string, parentTemplate: ITemplateItem, settings: IGenerateEquipmentProperties, shouldForceSpawn?: boolean): Item[];
|
||||||
|
/**
|
||||||
|
* Filter a bots plate pool based on its current level
|
||||||
|
* @param settings Bot equipment generation settings
|
||||||
|
* @param modSlot Armor slot being filtered
|
||||||
|
* @param existingPlateTplPool Plates tpls to choose from
|
||||||
|
* @param armorItem
|
||||||
|
* @returns Array of plate tpls to choose from
|
||||||
|
*/
|
||||||
|
protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult;
|
||||||
/**
|
/**
|
||||||
* Add mods to a weapon using the provided mod pool
|
* Add mods to a weapon using the provided mod pool
|
||||||
* @param sessionId session id
|
* @param sessionId session id
|
||||||
* @param weapon Weapon to add mods to
|
* @param weapon Weapon to add mods to
|
||||||
* @param modPool Pool of compatible mods to attach to weapon
|
* @param modPool Pool of compatible mods to attach to weapon
|
||||||
* @param weaponParentId parentId of weapon
|
* @param weaponId parentId of weapon
|
||||||
* @param parentTemplate Weapon which mods will be generated on
|
* @param parentTemplate Weapon which mods will be generated on
|
||||||
* @param modSpawnChances Mod spawn chances
|
* @param modSpawnChances Mod spawn chances
|
||||||
* @param ammoTpl Ammo tpl to use when generating magazines/cartridges
|
* @param ammoTpl Ammo tpl to use when generating magazines/cartridges
|
||||||
* @param botRole Role of bot weapon is generated for
|
* @param botRole Role of bot weapon is generated for
|
||||||
* @param botLevel lvel of the bot weapon is being generated for
|
* @param botLevel Level of the bot weapon is being generated for
|
||||||
* @param modLimits limits placed on certian mod types per gun
|
* @param modLimits limits placed on certain mod types per gun
|
||||||
* @param botEquipmentRole role of bot when accessing bot.json equipment config settings
|
* @param botEquipmentRole role of bot when accessing bot.json equipment config settings
|
||||||
* @returns Weapon + mods array
|
* @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[];
|
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[];
|
||||||
/**
|
/**
|
||||||
* Is this modslot a front or rear sight
|
* Is this modslot a front or rear sight
|
||||||
* @param modSlot Slot to check
|
* @param modSlot Slot to check
|
||||||
* @returns true if it's a front/rear sight
|
* @returns true if it's a front/rear sight
|
||||||
*/
|
*/
|
||||||
protected modIsFrontOrRearSight(modSlot: string): boolean;
|
protected modIsFrontOrRearSight(modSlot: string, tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Does the provided mod details show the mod can hold a scope
|
* Does the provided mod details show the mod can hold a scope
|
||||||
* @param modSlot e.g. mod_scope, mod_mount
|
* @param modSlot e.g. mod_scope, mod_mount
|
||||||
@ -81,10 +97,11 @@ export declare class BotEquipmentModGenerator {
|
|||||||
*/
|
*/
|
||||||
protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean;
|
protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Set all scope mod chances to 100%
|
* Set mod spawn chances to defined amount
|
||||||
* @param modSpawnChances Chances objet to update
|
* @param modSpawnChances Chance dictionary to update
|
||||||
*/
|
*/
|
||||||
protected setScopeSpawnChancesToFull(modSpawnChances: ModsChances): void;
|
protected adjustSlotSpawnChances(modSpawnChances: ModsChances, modSlotsToAdjust: string[], newChancePercent: number): void;
|
||||||
|
protected modSlotCanHoldMuzzleDevices(modSlot: string, modsParentId: string): boolean;
|
||||||
protected sortModKeys(unsortedKeys: string[]): string[];
|
protected sortModKeys(unsortedKeys: string[]): string[];
|
||||||
/**
|
/**
|
||||||
* Get a Slot property for an item (chamber/cartridge/slot)
|
* Get a Slot property for an item (chamber/cartridge/slot)
|
||||||
@ -92,18 +109,17 @@ export declare class BotEquipmentModGenerator {
|
|||||||
* @param parentTemplate item template
|
* @param parentTemplate item template
|
||||||
* @returns Slot item
|
* @returns Slot item
|
||||||
*/
|
*/
|
||||||
protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot;
|
protected getModItemSlotFromDb(modSlot: string, parentTemplate: ITemplateItem): Slot;
|
||||||
/**
|
/**
|
||||||
* randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo 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 itemSlot slot the item sits in
|
||||||
* @param modSlot slot the mod sits in
|
* @param modSlot slot the mod sits in
|
||||||
* @param modSpawnChances Chances for various mod spawns
|
* @param modSpawnChances Chances for various mod spawns
|
||||||
* @returns boolean true if it should spawn
|
* @param botEquipConfig Various config settings for generating this type of bot
|
||||||
|
* @returns ModSpawn.SPAWN when mod should be spawned, ModSpawn.DEFAULT_MOD when default mod should spawn, ModSpawn.SKIP when mod is skipped
|
||||||
*/
|
*/
|
||||||
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean;
|
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param modSlot Slot mod will fit into
|
* @param modSlot Slot mod will fit into
|
||||||
* @param isRandomisableSlot Will generate a randomised mod pool if true
|
* @param isRandomisableSlot Will generate a randomised mod pool if true
|
||||||
* @param modsParent Parent slot the item will be a part of
|
* @param modsParent Parent slot the item will be a part of
|
||||||
@ -112,16 +128,46 @@ export declare class BotEquipmentModGenerator {
|
|||||||
* @param weapon array with only weapon tpl in it, ready for mods to be added
|
* @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 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
|
* @param parentTemplate Parent item the mod will go into
|
||||||
* @returns ITemplateItem
|
* @returns itemHelper.getItem() result
|
||||||
*/
|
*/
|
||||||
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record<string, string[]>, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem];
|
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record<string, string[]>, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem, modSpawnResult: ModSpawn): [boolean, ITemplateItem];
|
||||||
|
protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult;
|
||||||
|
/**
|
||||||
|
* Filter mod pool down based on various criteria:
|
||||||
|
* Is slot flagged as randomisable
|
||||||
|
* Is slot required
|
||||||
|
* Is slot flagged as default mod only
|
||||||
|
* @param itemModPool Existing pool of mods to choose
|
||||||
|
* @param modSpawnResult outcome of random roll to select if mod should be added
|
||||||
|
* @param parentTemplate Mods parent
|
||||||
|
* @param weaponTemplate Mods root parent (weapon/equipment)
|
||||||
|
* @param modSlot name of mod slot to choose for
|
||||||
|
* @param botEquipBlacklist
|
||||||
|
* @param isRandomisableSlot is flagged as a randomisable slot
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
protected getModPoolForSlot(itemModPool: Record<string, string[]>, modSpawnResult: ModSpawn, parentTemplate: ITemplateItem, weaponTemplate: ITemplateItem, modSlot: string, botEquipBlacklist: EquipmentFilterDetails, isRandomisableSlot: boolean): string[];
|
||||||
|
/**
|
||||||
|
* Get default preset for weapon, get specific weapon presets for edge cases (mp5/silenced dvl)
|
||||||
|
* @param weaponTemplate
|
||||||
|
* @param parentItemTpl
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset;
|
||||||
|
/**
|
||||||
|
* Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible
|
||||||
|
* @param weapon Weapon
|
||||||
|
* @param modTpl Mod to check compatibility with weapon
|
||||||
|
* @returns True if incompatible
|
||||||
|
*/
|
||||||
|
protected weaponModComboIsIncompatible(weapon: Item[], modTpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Create a mod item with parameters as properties
|
* Create a mod item with parameters as properties
|
||||||
* @param modId _id
|
* @param modId _id
|
||||||
* @param modTpl _tpl
|
* @param modTpl _tpl
|
||||||
* @param parentId parentId
|
* @param parentId parentId
|
||||||
* @param modSlot slotId
|
* @param modSlot slotId
|
||||||
* @param modTemplate Used to add additional properites in the upd object
|
* @param modTemplate Used to add additional properties in the upd object
|
||||||
* @returns Item object
|
* @returns Item object
|
||||||
*/
|
*/
|
||||||
protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item;
|
protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item;
|
||||||
@ -134,21 +180,22 @@ export declare class BotEquipmentModGenerator {
|
|||||||
/**
|
/**
|
||||||
* Get a random mod from an items compatible mods Filter array
|
* Get a random mod from an items compatible mods Filter array
|
||||||
* @param modTpl ???? default value to return if nothing found
|
* @param modTpl ???? default value to return if nothing found
|
||||||
* @param parentSlot item mod will go into, used to get combatible items
|
* @param parentSlot item mod will go into, used to get compatible items
|
||||||
* @param modSlot Slot to get mod to fill
|
* @param modSlot Slot to get mod to fill
|
||||||
* @param items items to ensure picked mod is compatible with
|
* @param items items to ensure picked mod is compatible with
|
||||||
* @returns item tpl
|
* @returns item tpl
|
||||||
*/
|
*/
|
||||||
protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
|
protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
|
||||||
/**
|
/**
|
||||||
* Log errors if mod is not compatible with slot
|
* Log errors if mod is not compatible with slot
|
||||||
* @param modToAdd template of mod to check
|
* @param modToAdd template of mod to check
|
||||||
* @param itemSlot slot the item will be placed in
|
* @param slotAddedToTemplate slot the item will be placed in
|
||||||
* @param modSlot slot the mod will fill
|
* @param modSlot slot the mod will fill
|
||||||
* @param parentTemplate template of the mods parent item
|
* @param parentTemplate template of the mods being added
|
||||||
|
* @param botRole
|
||||||
* @returns true if valid
|
* @returns true if valid
|
||||||
*/
|
*/
|
||||||
protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean;
|
protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Find mod tpls of a provided type and add to modPool
|
* 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 desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope)
|
||||||
@ -178,23 +225,25 @@ export declare class BotEquipmentModGenerator {
|
|||||||
* Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
|
* 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"
|
* 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 items The items where the CylinderMagazine's camora are appended to
|
||||||
* @param modPool modPool which should include available cartrigdes
|
* @param modPool modPool which should include available cartridges
|
||||||
* @param parentId The CylinderMagazine's UID
|
* @param parentId The CylinderMagazine's UID
|
||||||
* @param parentTemplate The CylinderMagazine's template
|
* @param parentTemplate The CylinderMagazine's template
|
||||||
*/
|
*/
|
||||||
protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
|
protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
|
||||||
/**
|
/**
|
||||||
* Take a record of camoras and merge the compatable shells into one array
|
* Take a record of camoras and merge the compatible shells into one array
|
||||||
* @param camorasWithShells camoras we want to merge into one array
|
* @param camorasWithShells camoras we want to merge into one array
|
||||||
* @returns string array of shells fro luitple camora sources
|
* @returns string array of shells for multiple camora sources
|
||||||
*/
|
*/
|
||||||
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
|
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
|
||||||
/**
|
/**
|
||||||
* Filter out non-whitelisted weapon scopes
|
* Filter out non-whitelisted weapon scopes
|
||||||
|
* Controlled by bot.json weaponSightWhitelist
|
||||||
|
* e.g. filter out rifle scopes from SMGs
|
||||||
* @param weapon Weapon scopes will be added to
|
* @param weapon Weapon scopes will be added to
|
||||||
* @param scopes Full scope pool
|
* @param scopes Full scope pool
|
||||||
* @param botWeaponSightWhitelist whitelist of scope types by weapon base type
|
* @param botWeaponSightWhitelist Whitelist of scope types by weapon base type
|
||||||
* @returns array of scope tpls that have been filtered
|
* @returns Array of scope tpls that have been filtered to just ones allowed for that weapon type
|
||||||
*/
|
*/
|
||||||
protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record<string, string[]>): string[];
|
protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record<string, string[]>): string[];
|
||||||
}
|
}
|
||||||
|
81
types/generators/BotGenerator.d.ts
vendored
81
types/generators/BotGenerator.d.ts
vendored
@ -1,25 +1,29 @@
|
|||||||
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
|
import { BotInventoryGenerator } from "@spt-aki/generators/BotInventoryGenerator";
|
||||||
import { BotHelper } from "../helpers/BotHelper";
|
import { BotLevelGenerator } from "@spt-aki/generators/BotLevelGenerator";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { BotDifficultyHelper } from "@spt-aki/helpers/BotDifficultyHelper";
|
||||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
import { BotHelper } from "@spt-aki/helpers/BotHelper";
|
||||||
import { Health as PmcHealth, IBotBase, Info, Skills } from "../models/eft/common/tables/IBotBase";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { Health, IBotType } from "../models/eft/common/tables/IBotType";
|
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
|
||||||
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
|
import { Health as PmcHealth, IBaseJsonSkills, IBaseSkill, IBotBase, Info, Skills as botSkills } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { Appearance, Health, IBotType } from "@spt-aki/models/eft/common/tables/IBotType";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { BotGenerationDetails } from "@spt-aki/models/spt/bots/BotGenerationDetails";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
|
||||||
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { BotEquipmentFilterService } from "@spt-aki/services/BotEquipmentFilterService";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
import { BotInventoryGenerator } from "./BotInventoryGenerator";
|
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||||
import { BotLevelGenerator } from "./BotLevelGenerator";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
export declare class BotGenerator {
|
export declare class BotGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
|
protected timeUtil: TimeUtil;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
@ -30,9 +34,11 @@ export declare class BotGenerator {
|
|||||||
protected botHelper: BotHelper;
|
protected botHelper: BotHelper;
|
||||||
protected botDifficultyHelper: BotDifficultyHelper;
|
protected botDifficultyHelper: BotDifficultyHelper;
|
||||||
protected seasonalEventService: SeasonalEventService;
|
protected seasonalEventService: SeasonalEventService;
|
||||||
|
protected localisationService: LocalisationService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected botConfig: IBotConfig;
|
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, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
|
protected pmcConfig: IPmcConfig;
|
||||||
|
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Generate a player scav bot object
|
* Generate a player scav bot object
|
||||||
* @param role e.g. assault / pmcbot
|
* @param role e.g. assault / pmcbot
|
||||||
@ -42,12 +48,12 @@ export declare class BotGenerator {
|
|||||||
*/
|
*/
|
||||||
generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase;
|
generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase;
|
||||||
/**
|
/**
|
||||||
* Create x number of bots of the type/side/difficulty defined in botGenerationDetails
|
* Create 1 bots of the type/side/difficulty defined in botGenerationDetails
|
||||||
* @param sessionId Session id
|
* @param sessionId Session id
|
||||||
* @param botGenerationDetails details on how to generate bots
|
* @param botGenerationDetails details on how to generate bots
|
||||||
* @returns array of bots
|
* @returns constructed bot
|
||||||
*/
|
*/
|
||||||
prepareAndGenerateBots(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[];
|
prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase;
|
||||||
/**
|
/**
|
||||||
* Get a clone of the database\bots\base.json file
|
* Get a clone of the database\bots\base.json file
|
||||||
* @returns IBotBase object
|
* @returns IBotBase object
|
||||||
@ -62,14 +68,21 @@ export declare class BotGenerator {
|
|||||||
* @returns IBotBase object
|
* @returns IBotBase object
|
||||||
*/
|
*/
|
||||||
protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase;
|
protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase;
|
||||||
|
/**
|
||||||
|
* Choose various appearance settings for a bot using weights
|
||||||
|
* @param bot Bot to adjust
|
||||||
|
* @param appearance Appearance settings to choose from
|
||||||
|
* @param botGenerationDetails Generation details
|
||||||
|
*/
|
||||||
|
protected setBotAppearance(bot: IBotBase, appearance: Appearance, botGenerationDetails: BotGenerationDetails): void;
|
||||||
/**
|
/**
|
||||||
* Create a bot nickname
|
* Create a bot nickname
|
||||||
* @param botJsonTemplate x.json from database
|
* @param botJsonTemplate x.json from database
|
||||||
* @param isPlayerScav Will bot be player scav
|
* @param botGenerationDetails
|
||||||
* @param botRole role of bot e.g. assault
|
* @param botRole role of bot e.g. assault
|
||||||
* @returns Nickname for bot
|
* @returns Nickname for bot
|
||||||
*/
|
*/
|
||||||
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string;
|
protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string;
|
||||||
/**
|
/**
|
||||||
* Log the number of PMCs generated to the debug console
|
* Log the number of PMCs generated to the debug console
|
||||||
* @param output Generated bot array, ready to send to client
|
* @param output Generated bot array, ready to send to client
|
||||||
@ -82,14 +95,26 @@ export declare class BotGenerator {
|
|||||||
* @returns PmcHealth object
|
* @returns PmcHealth object
|
||||||
*/
|
*/
|
||||||
protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth;
|
protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth;
|
||||||
protected generateSkills(skillsObj: Skills): Skills;
|
/**
|
||||||
|
* Get a bots skills with randomsied progress value between the min and max values
|
||||||
|
* @param botSkills Skills that should have their progress value randomised
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
protected generateSkills(botSkills: IBaseJsonSkills): botSkills;
|
||||||
|
/**
|
||||||
|
* Randomise the progress value of passed in skills based on the min/max value
|
||||||
|
* @param skills Skills to randomise
|
||||||
|
* @param isCommonSkills Are the skills 'common' skills
|
||||||
|
* @returns Skills with randomised progress values as an array
|
||||||
|
*/
|
||||||
|
protected getSkillsWithRandomisedProgressValue(skills: Record<string, IBaseSkill>, isCommonSkills: boolean): IBaseSkill[];
|
||||||
/**
|
/**
|
||||||
* Generate a random Id for a bot and apply to bots _id and aid value
|
* Generate a random Id for a bot and apply to bots _id and aid value
|
||||||
* @param bot bot to update
|
* @param bot bot to update
|
||||||
* @returns updated IBotBase object
|
* @returns updated IBotBase object
|
||||||
*/
|
*/
|
||||||
protected generateId(bot: IBotBase): IBotBase;
|
protected generateId(bot: IBotBase): void;
|
||||||
protected generateInventoryID(profile: IBotBase): IBotBase;
|
protected generateInventoryID(profile: IBotBase): void;
|
||||||
/**
|
/**
|
||||||
* Randomise a bots game version and account category
|
* Randomise a bots game version and account category
|
||||||
* Chooses from all the game versions (standard, eod etc)
|
* Chooses from all the game versions (standard, eod etc)
|
||||||
@ -102,5 +127,5 @@ export declare class BotGenerator {
|
|||||||
* @param bot bot to add dogtag to
|
* @param bot bot to add dogtag to
|
||||||
* @returns Bot with dogtag added
|
* @returns Bot with dogtag added
|
||||||
*/
|
*/
|
||||||
protected generateDogtag(bot: IBotBase): IBotBase;
|
protected addDogtagToBot(bot: IBotBase): void;
|
||||||
}
|
}
|
||||||
|
88
types/generators/BotInventoryGenerator.d.ts
vendored
88
types/generators/BotInventoryGenerator.d.ts
vendored
@ -1,20 +1,21 @@
|
|||||||
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
import { BotEquipmentModGenerator } from "@spt-aki/generators/BotEquipmentModGenerator";
|
||||||
import { BotHelper } from "../helpers/BotHelper";
|
import { BotLootGenerator } from "@spt-aki/generators/BotLootGenerator";
|
||||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
import { BotWeaponGenerator } from "@spt-aki/generators/BotWeaponGenerator";
|
||||||
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
|
import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper";
|
||||||
import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType";
|
import { BotHelper } from "@spt-aki/helpers/BotHelper";
|
||||||
import { EquipmentSlots } from "../models/enums/EquipmentSlots";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { EquipmentFilterDetails, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
|
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { Inventory as PmcInventory } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { Chances, Generation, IBotType, Inventory, Mods } from "@spt-aki/models/eft/common/tables/IBotType";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { EquipmentSlots } from "@spt-aki/models/enums/EquipmentSlots";
|
||||||
import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
|
import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt-aki/models/spt/config/IBotConfig";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
|
import { BotEquipmentModPoolService } from "@spt-aki/services/BotEquipmentModPoolService";
|
||||||
import { BotLootGenerator } from "./BotLootGenerator";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
import { BotWeaponGenerator } from "./BotWeaponGenerator";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
export declare class BotInventoryGenerator {
|
export declare class BotInventoryGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
@ -25,16 +26,17 @@ export declare class BotInventoryGenerator {
|
|||||||
protected botGeneratorHelper: BotGeneratorHelper;
|
protected botGeneratorHelper: BotGeneratorHelper;
|
||||||
protected botHelper: BotHelper;
|
protected botHelper: BotHelper;
|
||||||
protected weightedRandomHelper: WeightedRandomHelper;
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
|
protected itemHelper: ItemHelper;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected botEquipmentModPoolService: BotEquipmentModPoolService;
|
protected botEquipmentModPoolService: BotEquipmentModPoolService;
|
||||||
protected botEquipmentModGenerator: BotEquipmentModGenerator;
|
protected botEquipmentModGenerator: BotEquipmentModGenerator;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
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);
|
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Add equipment/weapons/loot to bot
|
* Add equipment/weapons/loot to bot
|
||||||
* @param sessionId Session id
|
* @param sessionId Session id
|
||||||
* @param botJsonTemplate bot/x.json data from db
|
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||||
* @param botRole Role bot has (assault/pmcBot)
|
* @param botRole Role bot has (assault/pmcBot)
|
||||||
* @param isPmc Is bot being converted into a pmc
|
* @param isPmc Is bot being converted into a pmc
|
||||||
* @param botLevel Level of bot being generated
|
* @param botLevel Level of bot being generated
|
||||||
@ -49,26 +51,31 @@ export declare class BotInventoryGenerator {
|
|||||||
/**
|
/**
|
||||||
* Add equipment to a bot
|
* Add equipment to a bot
|
||||||
* @param templateInventory bot/x.json data from db
|
* @param templateInventory bot/x.json data from db
|
||||||
* @param equipmentChances Chances items will be added to bot
|
* @param wornItemChances Chances items will be added to bot
|
||||||
* @param botRole Role bot has (assault/pmcBot)
|
* @param botRole Role bot has (assault/pmcBot)
|
||||||
* @param botInventory Inventory to add equipment to
|
* @param botInventory Inventory to add equipment to
|
||||||
* @param botLevel Level of bot
|
* @param botLevel Level of bot
|
||||||
*/
|
*/
|
||||||
protected generateAndAddEquipmentToBot(templateInventory: Inventory, equipmentChances: Chances, botRole: string, botInventory: PmcInventory, botLevel: number): void;
|
protected generateAndAddEquipmentToBot(templateInventory: Inventory, wornItemChances: Chances, botRole: string, botInventory: PmcInventory, botLevel: number): void;
|
||||||
|
/**
|
||||||
|
* Remove non-armored rigs from parameter data
|
||||||
|
* @param templateInventory
|
||||||
|
*/
|
||||||
|
protected filterRigsToThoseWithProtection(templateInventory: Inventory): void;
|
||||||
|
/**
|
||||||
|
* Remove armored rigs from parameter data
|
||||||
|
* @param templateInventory
|
||||||
|
*/
|
||||||
|
protected filterRigsToThoseWithoutProtection(templateInventory: Inventory): void;
|
||||||
/**
|
/**
|
||||||
* Add a piece of equipment with mods to inventory from the provided pools
|
* Add a piece of equipment with mods to inventory from the provided pools
|
||||||
* @param equipmentSlot Slot to select an item for
|
* @param settings Values to adjust how item is chosen and added to bot
|
||||||
* @param equipmentPool Possible items to choose from
|
* @returns true when item added
|
||||||
* @param modPool Possible mods to apply to item chosen
|
|
||||||
* @param spawnChances Chances items will be chosen to be added
|
|
||||||
* @param botRole Role of bot e.g. assault
|
|
||||||
* @param inventory Inventory to add item into
|
|
||||||
* @param randomisationDetails settings from bot.json to adjust how item is generated
|
|
||||||
*/
|
*/
|
||||||
protected generateEquipment(equipmentSlot: string, equipmentPool: Record<string, number>, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory, randomisationDetails: RandomisationDetails): void;
|
protected generateEquipment(settings: IGenerateEquipmentProperties): boolean;
|
||||||
/**
|
/**
|
||||||
* Get all possible mods for item and filter down based on equipment blacklist from bot.json config
|
* 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 itemTpl Item mod pool is being retrieved and filtered
|
||||||
* @param equipmentBlacklist blacklist to filter mod pool with
|
* @param equipmentBlacklist blacklist to filter mod pool with
|
||||||
* @returns Filtered pool of mods
|
* @returns Filtered pool of mods
|
||||||
*/
|
*/
|
||||||
@ -103,10 +110,27 @@ export declare class BotInventoryGenerator {
|
|||||||
* @param equipmentChances Chances bot can have equipment equipped
|
* @param equipmentChances Chances bot can have equipment equipped
|
||||||
* @param botRole assault/pmcBot/bossTagilla etc
|
* @param botRole assault/pmcBot/bossTagilla etc
|
||||||
* @param isPmc Is the bot being generated as a pmc
|
* @param isPmc Is the bot being generated as a pmc
|
||||||
* @param itemGenerationLimitsMinMax
|
* @param itemGenerationWeights
|
||||||
*/
|
*/
|
||||||
protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: {
|
protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: {
|
||||||
slot: EquipmentSlots;
|
slot: EquipmentSlots;
|
||||||
shouldSpawn: boolean;
|
shouldSpawn: boolean;
|
||||||
}, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void;
|
}, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void;
|
||||||
|
}
|
||||||
|
export interface IGenerateEquipmentProperties {
|
||||||
|
/** Root Slot being generated */
|
||||||
|
rootEquipmentSlot: string;
|
||||||
|
/** Equipment pool for root slot being generated */
|
||||||
|
rootEquipmentPool: Record<string, number>;
|
||||||
|
modPool: Mods;
|
||||||
|
/** Dictionary of mod items and their chance to spawn for this bot type */
|
||||||
|
spawnChances: Chances;
|
||||||
|
/** Role being generated for */
|
||||||
|
botRole: string;
|
||||||
|
/** Level of bot being generated */
|
||||||
|
botLevel: number;
|
||||||
|
inventory: PmcInventory;
|
||||||
|
botEquipmentConfig: EquipmentFilters;
|
||||||
|
/** Settings from bot.json to adjust how item is generated */
|
||||||
|
randomisationDetails: RandomisationDetails;
|
||||||
}
|
}
|
||||||
|
27
types/generators/BotLevelGenerator.d.ts
vendored
27
types/generators/BotLevelGenerator.d.ts
vendored
@ -1,11 +1,11 @@
|
|||||||
import { MinMax } from "../models/common/MinMax";
|
import { MinMax } from "@spt-aki/models/common/MinMax";
|
||||||
import { IRandomisedBotLevelResult } from "../models/eft/bot/IRandomisedBotLevelResult";
|
import { IRandomisedBotLevelResult } from "@spt-aki/models/eft/bot/IRandomisedBotLevelResult";
|
||||||
import { ExpTable } from "../models/eft/common/IGlobals";
|
import { IExpTable } from "@spt-aki/models/eft/common/IGlobals";
|
||||||
import { IBotBase } from "../models/eft/common/tables/IBotBase";
|
import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||||
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
|
import { BotGenerationDetails } from "@spt-aki/models/spt/bots/BotGenerationDetails";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
export declare class BotLevelGenerator {
|
export declare class BotLevelGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
@ -20,10 +20,17 @@ export declare class BotLevelGenerator {
|
|||||||
*/
|
*/
|
||||||
generateBotLevel(levelDetails: MinMax, botGenerationDetails: BotGenerationDetails, bot: IBotBase): IRandomisedBotLevelResult;
|
generateBotLevel(levelDetails: MinMax, botGenerationDetails: BotGenerationDetails, bot: IBotBase): IRandomisedBotLevelResult;
|
||||||
/**
|
/**
|
||||||
* Get the highest level a bot can be relative to the players level, but no futher than the max size from globals.exp_table
|
* Get the highest level a bot can be relative to the players level, but no further than the max size from globals.exp_table
|
||||||
* @param playerLevel Players current level
|
* @param playerLevel Players current level
|
||||||
* @param relativeDeltaMax max delta above player level to go
|
* @param relativeDeltaMax max delta above player level to go
|
||||||
* @returns highest level possible for bot
|
* @returns highest level possible for bot
|
||||||
*/
|
*/
|
||||||
protected getHighestRelativeBotLevel(playerLevel: number, relativeDeltaMax: number, levelDetails: MinMax, expTable: ExpTable[]): number;
|
protected getHighestRelativeBotLevel(playerLevel: number, relativeDeltaMax: number, levelDetails: MinMax, expTable: IExpTable[]): number;
|
||||||
|
/**
|
||||||
|
* Get the lowest level a bot can be relative to the players level, but no lower than 1
|
||||||
|
* @param playerLevel Players current level
|
||||||
|
* @param relativeDeltaMin Min delta below player level to go
|
||||||
|
* @returns lowest level possible for bot
|
||||||
|
*/
|
||||||
|
protected getLowestRelativeBotLevel(playerLevel: number, relativeDeltaMin: number, levelDetails: MinMax, expTable: IExpTable[]): number;
|
||||||
}
|
}
|
||||||
|
136
types/generators/BotLootGenerator.d.ts
vendored
136
types/generators/BotLootGenerator.d.ts
vendored
@ -1,20 +1,23 @@
|
|||||||
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
import { BotWeaponGenerator } from "@spt-aki/generators/BotWeaponGenerator";
|
||||||
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
|
import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper";
|
||||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
|
||||||
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType";
|
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { Inventory as PmcInventory } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||||
import { ITemplateItem, Props } from "../models/eft/common/tables/ITemplateItem";
|
import { IBotType, Inventory, ModsChances } from "@spt-aki/models/eft/common/tables/IBotType";
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { EquipmentSlots } from "@spt-aki/models/enums/EquipmentSlots";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
|
||||||
import { BotLootCacheService } from "../services/BotLootCacheService";
|
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { BotWeaponGenerator } from "./BotWeaponGenerator";
|
import { BotLootCacheService } from "@spt-aki/services/BotLootCacheService";
|
||||||
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
export declare class BotLootGenerator {
|
export declare class BotLootGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
@ -25,64 +28,90 @@ export declare class BotLootGenerator {
|
|||||||
protected botGeneratorHelper: BotGeneratorHelper;
|
protected botGeneratorHelper: BotGeneratorHelper;
|
||||||
protected botWeaponGenerator: BotWeaponGenerator;
|
protected botWeaponGenerator: BotWeaponGenerator;
|
||||||
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
||||||
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
protected botLootCacheService: BotLootCacheService;
|
protected botLootCacheService: BotLootCacheService;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer);
|
protected pmcConfig: IPmcConfig;
|
||||||
|
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Add loot to bots containers
|
* Add loot to bots containers
|
||||||
* @param sessionId Session id
|
* @param sessionId Session id
|
||||||
* @param templateInventory x.json from database/bots
|
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||||
* @param itemCounts Liits on item types to be added as loot
|
|
||||||
* @param isPmc Will bot be a pmc
|
* @param isPmc Will bot be a pmc
|
||||||
* @param botRole Role of bot, e.g. asssult
|
* @param botRole Role of bot, e.g. asssult
|
||||||
* @param botInventory Inventory to add loot to
|
* @param botInventory Inventory to add loot to
|
||||||
* @param equipmentChances
|
|
||||||
* @param botLevel Level of bot
|
* @param botLevel Level of bot
|
||||||
*/
|
*/
|
||||||
generateLoot(sessionId: string, templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances, botLevel: number): void;
|
generateLoot(sessionId: string, botJsonTemplate: IBotType, isPmc: boolean, botRole: string, botInventory: PmcInventory, botLevel: number): void;
|
||||||
|
/**
|
||||||
|
* Get an array of the containers a bot has on them (pockets/backpack/vest)
|
||||||
|
* @param botInventory Bot to check
|
||||||
|
* @returns Array of available slots
|
||||||
|
*/
|
||||||
|
protected getAvailableContainersBotCanStoreItemsIn(botInventory: PmcInventory): EquipmentSlots[];
|
||||||
|
/**
|
||||||
|
* Force healing items onto bot to ensure they can heal in-raid
|
||||||
|
* @param botInventory Inventory to add items to
|
||||||
|
* @param botRole Role of bot (sptBear/sptUsec)
|
||||||
|
*/
|
||||||
|
protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void;
|
||||||
|
/**
|
||||||
|
* Get a biased random number
|
||||||
|
* @param min Smallest size
|
||||||
|
* @param max Biggest size
|
||||||
|
* @param nValue Value to bias choice
|
||||||
|
* @returns Chosen number
|
||||||
|
*/
|
||||||
protected getRandomisedCount(min: number, max: number, nValue: number): number;
|
protected getRandomisedCount(min: number, max: number, nValue: number): number;
|
||||||
/**
|
/**
|
||||||
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached
|
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit or space limit is reached
|
||||||
* @param pool pool of items to pick from
|
* @param pool Pool of items to pick from
|
||||||
* @param equipmentSlots What equality slot will the loot items be added to
|
* @param equipmentSlots What equipment slot will the loot items be added to
|
||||||
* @param totalItemCount Max count of items to add
|
* @param totalItemCount Max count of items to add
|
||||||
* @param inventoryToAddItemsTo bot inventory loot will be added to
|
* @param inventoryToAddItemsTo Bot inventory loot will be added to
|
||||||
* @param botRole role of the bot loot is being generated for (assault/pmcbot)
|
* @param botRole Role of the bot loot is being generated for (assault/pmcbot)
|
||||||
* @param useLimits should item limit counts be used as defined in config/bot.json
|
* @param useLimits Should item limit counts be used as defined in config/bot.json
|
||||||
* @param totalValueLimitRub total value of loot allowed in roubles
|
* @param totalValueLimitRub Total value of loot allowed in roubles
|
||||||
* @param isPmc is the bot being generated for a pmc
|
* @param isPmc Is bot being generated for a pmc
|
||||||
*/
|
*/
|
||||||
protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void;
|
protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void;
|
||||||
|
/**
|
||||||
|
* Some items need child items to function, add them to the itemToAddChildrenTo array
|
||||||
|
* @param itemToAddTemplate Db template of item to check
|
||||||
|
* @param itemToAddChildrenTo Item to add children to
|
||||||
|
* @param isPmc Is the item being generated for a pmc (affects money/ammo stack sizes)
|
||||||
|
*/
|
||||||
|
protected addRequiredChildItemsToParent(itemToAddTemplate: ITemplateItem, itemToAddChildrenTo: Item[], isPmc: boolean): void;
|
||||||
/**
|
/**
|
||||||
* Add generated weapons to inventory as loot
|
* Add generated weapons to inventory as loot
|
||||||
* @param botInventory inventory to add preset to
|
* @param botInventory inventory to add preset to
|
||||||
* @param equipmentSlot slot to place the preset in (backpack)
|
* @param equipmentSlot slot to place the preset in (backpack)
|
||||||
* @param templateInventory bots template, assault.json
|
* @param templateInventory bots template, assault.json
|
||||||
* @param modChances chances for mods to spawn on weapon
|
* @param modChances chances for mods to spawn on weapon
|
||||||
* @param botRole bots role, .e.g. pmcBot
|
* @param botRole bots role .e.g. pmcBot
|
||||||
* @param isPmc are we generating for a pmc
|
* @param isPmc are we generating for a pmc
|
||||||
*/
|
*/
|
||||||
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void;
|
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void;
|
||||||
/**
|
/**
|
||||||
* Get a random item from the pool parameter using the biasedRandomNumber system
|
* Get a random item from the pool parameter using the biasedRandomNumber system
|
||||||
* @param pool pool of items to pick an item from
|
* @param pool Pool of items to pick an item from
|
||||||
* @param isPmc is the bot being created a pmc
|
* @param isPmc Is the bot being created a pmc
|
||||||
* @returns ITemplateItem object
|
* @returns ITemplateItem object
|
||||||
*/
|
*/
|
||||||
protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem;
|
protected getRandomItemFromPoolByBotRole(pool: ITemplateItem[], botRole: string): ITemplateItem;
|
||||||
/**
|
/**
|
||||||
* Get the loot nvalue from botconfig
|
* Get the loot nvalue from botconfig
|
||||||
* @param isPmc if true the pmc nvalue is returned
|
* @param botRole Role of bot e.g. assault/bosstagilla/sptBear
|
||||||
* @returns nvalue as number
|
* @returns nvalue as number
|
||||||
*/
|
*/
|
||||||
protected getBotLootNValue(isPmc: boolean): number;
|
protected getBotLootNValueByRole(botRole: string): number;
|
||||||
/**
|
/**
|
||||||
* Update item limit array to contain items that have a limit
|
* Hydrate item limit array to contain items that have a limit for a specific bot type
|
||||||
* All values are set to 0
|
* All values are set to 0
|
||||||
* @param isPmc is the bot a pmc
|
* @param isPmc Is the bot a pmc
|
||||||
* @param botRole role the bot has
|
* @param botRole Role the bot has
|
||||||
* @param limitCount
|
* @param limitCount
|
||||||
*/
|
*/
|
||||||
protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record<string, number>): void;
|
protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record<string, number>): void;
|
||||||
@ -91,36 +120,23 @@ export declare class BotLootGenerator {
|
|||||||
* @param itemTemplate Item we check to see if its reached spawn limit
|
* @param itemTemplate Item we check to see if its reached spawn limit
|
||||||
* @param botRole Bot type
|
* @param botRole Bot type
|
||||||
* @param isPmc Is bot we're working with a pmc
|
* @param isPmc Is bot we're working with a pmc
|
||||||
* @param limitCount spawn limits for items on bot
|
* @param limitCount Spawn limits for items on bot
|
||||||
* @param itemSpawnLimits the limits this bot is allowed to have
|
* @param itemSpawnLimits The limits this bot is allowed to have
|
||||||
* @returns true if item has reached spawn limit
|
* @returns true if item has reached spawn limit
|
||||||
*/
|
*/
|
||||||
protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record<string, number>, itemSpawnLimits: Record<string, number>): boolean;
|
protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record<string, number>, itemSpawnLimits: Record<string, number>): boolean;
|
||||||
/**
|
|
||||||
* Is the item an ammo box
|
|
||||||
* @param props props of the item to check
|
|
||||||
* @returns true if item is an ammo box
|
|
||||||
*/
|
|
||||||
protected isAmmoBox(props: Props): boolean;
|
|
||||||
/**
|
|
||||||
* Create an object that contains the ammo stack for an ammo box
|
|
||||||
* @param parentId ammo box id
|
|
||||||
* @param props ammo box props
|
|
||||||
* @returns Item object
|
|
||||||
*/
|
|
||||||
protected createAmmoForAmmoBox(parentId: string, props: Props): Item;
|
|
||||||
/**
|
/**
|
||||||
* Randomise the stack size of a money object, uses different values for pmc or scavs
|
* Randomise the stack size of a money object, uses different values for pmc or scavs
|
||||||
* @param isPmc is this a PMC
|
* @param isPmc Is money on a PMC bot
|
||||||
* @param itemTemplate item details
|
* @param itemTemplate item details from db
|
||||||
* @param moneyItem Money stack to randomise
|
* @param moneyItem Money item to randomise
|
||||||
*/
|
*/
|
||||||
protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void;
|
protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void;
|
||||||
/**
|
/**
|
||||||
* Randomise the size of an ammo stack
|
* Randomise the size of an ammo stack
|
||||||
* @param isPmc is this a PMC
|
* @param isPmc Is ammo on a PMC bot
|
||||||
* @param itemTemplate item details
|
* @param itemTemplate item details from db
|
||||||
* @param ammoItem Ammo stack to randomise
|
* @param ammoItem Ammo item to randomise
|
||||||
*/
|
*/
|
||||||
protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void;
|
protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void;
|
||||||
/**
|
/**
|
||||||
|
84
types/generators/BotWeaponGenerator.d.ts
vendored
84
types/generators/BotWeaponGenerator.d.ts
vendored
@ -1,24 +1,26 @@
|
|||||||
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
import { BotEquipmentModGenerator } from "@spt-aki/generators/BotEquipmentModGenerator";
|
||||||
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
|
import { IInventoryMagGen } from "@spt-aki/generators/weapongen/IInventoryMagGen";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper";
|
||||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper";
|
||||||
import { MinMax } from "../models/common/MinMax";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
|
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
|
||||||
import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType";
|
import { Inventory as PmcInventory } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { GenerationData, Inventory, ModsChances } from "@spt-aki/models/eft/common/tables/IBotType";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult";
|
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { GenerateWeaponResult } from "@spt-aki/models/spt/bots/GenerateWeaponResult";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig";
|
||||||
import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { BotWeaponModLimitService } from "@spt-aki/services/BotWeaponModLimitService";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
|
import { RepairService } from "@spt-aki/services/RepairService";
|
||||||
import { IInventoryMagGen } from "./weapongen/IInventoryMagGen";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
export declare class BotWeaponGenerator {
|
export declare class BotWeaponGenerator {
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
@ -33,10 +35,13 @@ export declare class BotWeaponGenerator {
|
|||||||
protected botWeaponModLimitService: BotWeaponModLimitService;
|
protected botWeaponModLimitService: BotWeaponModLimitService;
|
||||||
protected botEquipmentModGenerator: BotEquipmentModGenerator;
|
protected botEquipmentModGenerator: BotEquipmentModGenerator;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
|
protected repairService: RepairService;
|
||||||
protected inventoryMagGenComponents: IInventoryMagGen[];
|
protected inventoryMagGenComponents: IInventoryMagGen[];
|
||||||
protected readonly modMagazineSlotId = "mod_magazine";
|
protected readonly modMagazineSlotId = "mod_magazine";
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
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[]);
|
protected pmcConfig: IPmcConfig;
|
||||||
|
protected repairConfig: IRepairConfig;
|
||||||
|
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, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]);
|
||||||
/**
|
/**
|
||||||
* Pick a random weapon based on weightings and generate a functional weapon
|
* Pick a random weapon based on weightings and generate a functional weapon
|
||||||
* @param equipmentSlot Primary/secondary/holster
|
* @param equipmentSlot Primary/secondary/holster
|
||||||
@ -63,10 +68,18 @@ export declare class BotWeaponGenerator {
|
|||||||
* @param weaponParentId ParentId of the weapon being generated
|
* @param weaponParentId ParentId of the weapon being generated
|
||||||
* @param modChances Dictionary of item types and % chance weapon will have that mod
|
* @param modChances Dictionary of item types and % chance weapon will have that mod
|
||||||
* @param botRole e.g. assault/exusec
|
* @param botRole e.g. assault/exusec
|
||||||
* @param isPmc
|
* @param isPmc Is weapon being generated for a pmc
|
||||||
* @returns GenerateWeaponResult object
|
* @returns GenerateWeaponResult object
|
||||||
*/
|
*/
|
||||||
generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult;
|
generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult;
|
||||||
|
/**
|
||||||
|
* Insert a cartridge(s) into a weapon
|
||||||
|
* Handles all chambers - patron_in_weapon, patron_in_weapon_000 etc
|
||||||
|
* @param weaponWithModsArray Weapon and mods
|
||||||
|
* @param ammoTpl Cartridge to add to weapon
|
||||||
|
* @param chamberSlotIds name of slots to create or add ammo to
|
||||||
|
*/
|
||||||
|
protected addCartridgeToChamber(weaponWithModsArray: Item[], ammoTpl: string, chamberSlotIds: string[]): void;
|
||||||
/**
|
/**
|
||||||
* Create array with weapon base as only element and
|
* Create array with weapon base as only element and
|
||||||
* add additional properties based on weapon type
|
* add additional properties based on weapon type
|
||||||
@ -97,11 +110,11 @@ export declare class BotWeaponGenerator {
|
|||||||
* Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets.
|
* Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets.
|
||||||
* Additionally, adds extra bullets to SecuredContainer
|
* Additionally, adds extra bullets to SecuredContainer
|
||||||
* @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl)
|
* @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl)
|
||||||
* @param magCounts Magazine count to add to inventory
|
* @param magWeights Magazine weights for count to add to inventory
|
||||||
* @param inventory Inventory to add magazines to
|
* @param inventory Inventory to add magazines to
|
||||||
* @param botRole The bot type we're getting generating extra mags for
|
* @param botRole The bot type we're getting generating extra mags for
|
||||||
*/
|
*/
|
||||||
addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void;
|
addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void;
|
||||||
/**
|
/**
|
||||||
* Add Grendaes for UBGL to bots vest and secure container
|
* Add Grendaes for UBGL to bots vest and secure container
|
||||||
* @param weaponMods Weapon array with mods
|
* @param weaponMods Weapon array with mods
|
||||||
@ -140,26 +153,27 @@ export declare class BotWeaponGenerator {
|
|||||||
protected getWeaponCaliber(weaponTemplate: ITemplateItem): string;
|
protected getWeaponCaliber(weaponTemplate: ITemplateItem): string;
|
||||||
/**
|
/**
|
||||||
* Fill existing magazines to full, while replacing their contents with specified ammo
|
* Fill existing magazines to full, while replacing their contents with specified ammo
|
||||||
* @param weaponMods
|
* @param weaponMods Weapon with children
|
||||||
* @param magazine
|
* @param magazine Magazine item
|
||||||
* @param ammoTpl
|
* @param cartridgeTpl Cartridge to insert into magazine
|
||||||
*/
|
*/
|
||||||
protected fillExistingMagazines(weaponMods: Item[], magazine: Item, ammoTpl: string): void;
|
protected fillExistingMagazines(weaponMods: Item[], magazine: Item, cartridgeTpl: string): void;
|
||||||
/**
|
/**
|
||||||
* Add desired ammo tpl as item to weaponmods array, placed as child to UBGL
|
* Add desired ammo tpl as item to weaponmods array, placed as child to UBGL
|
||||||
* @param weaponMods
|
* @param weaponMods Weapon with children
|
||||||
* @param ubglMod
|
* @param ubglMod UBGL item
|
||||||
* @param ubglAmmoTpl
|
* @param ubglAmmoTpl Grenade ammo tpl
|
||||||
*/
|
*/
|
||||||
protected fillUbgl(weaponMods: Item[], ubglMod: Item, ubglAmmoTpl: string): void;
|
protected fillUbgl(weaponMods: Item[], ubglMod: Item, ubglAmmoTpl: string): void;
|
||||||
/**
|
/**
|
||||||
* Add cartridge item to weapon Item array, if it already exists, update
|
* Add cartridge item to weapon Item array, if it already exists, update
|
||||||
* @param weaponMods Weapon items array to amend
|
* @param weaponWithMods Weapon items array to amend
|
||||||
* @param magazine magazine item details we're adding cartridges to
|
* @param magazine magazine item details we're adding cartridges to
|
||||||
* @param chosenAmmo cartridge to put into the magazine
|
* @param chosenAmmoTpl cartridge to put into the magazine
|
||||||
* @param newStackSize how many cartridges should go into the magazine
|
* @param newStackSize how many cartridges should go into the magazine
|
||||||
|
* @param magazineTemplate magazines db template
|
||||||
*/
|
*/
|
||||||
protected addOrUpdateMagazinesChildWithAmmo(weaponMods: Item[], magazine: Item, chosenAmmo: string, newStackSize: number): void;
|
protected addOrUpdateMagazinesChildWithAmmo(weaponWithMods: Item[], magazine: Item, chosenAmmoTpl: string, magazineTemplate: ITemplateItem): void;
|
||||||
/**
|
/**
|
||||||
* Fill each Camora with a bullet
|
* Fill each Camora with a bullet
|
||||||
* @param weaponMods Weapon mods to find and update camora mod(s) from
|
* @param weaponMods Weapon mods to find and update camora mod(s) from
|
||||||
|
35
types/generators/FenceBaseAssortGenerator.d.ts
vendored
35
types/generators/FenceBaseAssortGenerator.d.ts
vendored
@ -1,24 +1,39 @@
|
|||||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { ItemFilterService } from "../services/ItemFilterService";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
|
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||||
|
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
export declare class FenceBaseAssortGenerator {
|
export declare class FenceBaseAssortGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
|
protected hashUtil: HashUtil;
|
||||||
|
protected jsonUtil: JsonUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected handbookHelper: HandbookHelper;
|
protected handbookHelper: HandbookHelper;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
|
protected presetHelper: PresetHelper;
|
||||||
protected itemFilterService: ItemFilterService;
|
protected itemFilterService: ItemFilterService;
|
||||||
|
protected seasonalEventService: SeasonalEventService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected traderConfig: ITraderConfig;
|
protected traderConfig: ITraderConfig;
|
||||||
constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Create base fence assorts dynamically and store in db
|
* Create base fence assorts dynamically and store in memory
|
||||||
*/
|
*/
|
||||||
generateFenceBaseAssorts(): void;
|
generateFenceBaseAssorts(): void;
|
||||||
|
/**
|
||||||
|
* Add soft inserts + armor plates to an armor
|
||||||
|
* @param armor Armor item array to add mods into
|
||||||
|
* @param itemDbDetails Armor items db template
|
||||||
|
*/
|
||||||
|
protected addChildrenToArmorModSlots(armor: Item[], itemDbDetails: ITemplateItem): void;
|
||||||
/**
|
/**
|
||||||
* Check if item is valid for being added to fence assorts
|
* Check if item is valid for being added to fence assorts
|
||||||
* @param item Item to check
|
* @param item Item to check
|
||||||
|
11
types/generators/IFilterPlateModsForSlotByLevelResult.d.ts
vendored
Normal file
11
types/generators/IFilterPlateModsForSlotByLevelResult.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
export interface IFilterPlateModsForSlotByLevelResult {
|
||||||
|
result: Result;
|
||||||
|
plateModTpls: string[];
|
||||||
|
}
|
||||||
|
export declare enum Result {
|
||||||
|
UNKNOWN_FAILURE = -1,
|
||||||
|
SUCCESS = 1,
|
||||||
|
NO_DEFAULT_FILTER = 2,
|
||||||
|
NOT_PLATE_HOLDING_SLOT = 3,
|
||||||
|
LACKS_PLATE_WEIGHTS = 4
|
||||||
|
}
|
141
types/generators/LocationGenerator.d.ts
vendored
141
types/generators/LocationGenerator.d.ts
vendored
@ -1,30 +1,38 @@
|
|||||||
import { ContainerHelper } from "../helpers/ContainerHelper";
|
import { ContainerHelper } from "@spt-aki/helpers/ContainerHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { PresetHelper } from "../helpers/PresetHelper";
|
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||||
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
|
import { IContainerMinMax, IStaticContainer } from "@spt-aki/models/eft/common/ILocation";
|
||||||
import { ILooseLoot, SpawnpointsForced, SpawnpointTemplate } from "../models/eft/common/ILooseLoot";
|
import { ILocationBase } from "@spt-aki/models/eft/common/ILocationBase";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "@spt-aki/models/eft/common/ILooseLoot";
|
||||||
import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
|
import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "@spt-aki/models/eft/common/tables/ILootBase";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
import { MathUtil } from "../utils/MathUtil";
|
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||||
import { ObjectId } from "../utils/ObjectId";
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
|
import { ObjectId } from "@spt-aki/utils/ObjectId";
|
||||||
|
import { ProbabilityObjectArray, RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
export interface IContainerItem {
|
export interface IContainerItem {
|
||||||
items: Item[];
|
items: Item[];
|
||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
}
|
}
|
||||||
|
export interface IContainerGroupCount {
|
||||||
|
/** Containers this group has + probabilty to spawn */
|
||||||
|
containerIdsWithProbability: Record<string, number>;
|
||||||
|
/** How many containers the map should spawn with this group id */
|
||||||
|
chosenCount: number;
|
||||||
|
}
|
||||||
export declare class LocationGenerator {
|
export declare class LocationGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
|
protected databaseServer: DatabaseServer;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
protected objectId: ObjectId;
|
protected objectId: ObjectId;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected ragfairServerHelper: RagfairServerHelper;
|
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected mathUtil: MathUtil;
|
protected mathUtil: MathUtil;
|
||||||
protected seasonalEventService: SeasonalEventService;
|
protected seasonalEventService: SeasonalEventService;
|
||||||
@ -33,8 +41,72 @@ export declare class LocationGenerator {
|
|||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected locationConfig: ILocationConfig;
|
protected locationConfig: ILocationConfig;
|
||||||
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);
|
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
|
||||||
generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerProps;
|
/**
|
||||||
|
* Create an array of container objects with randomised loot
|
||||||
|
* @param locationBase Map base to generate containers for
|
||||||
|
* @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo
|
||||||
|
* @returns Array of container objects
|
||||||
|
*/
|
||||||
|
generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): SpawnpointTemplate[];
|
||||||
|
/**
|
||||||
|
* Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist
|
||||||
|
* @param staticContainers
|
||||||
|
* @returns IStaticContainerData array
|
||||||
|
*/
|
||||||
|
protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[];
|
||||||
|
/**
|
||||||
|
* Get containers with 100% spawn rate or have a type on the randomistion ignore list
|
||||||
|
* @param staticContainersOnMap
|
||||||
|
* @returns IStaticContainerData array
|
||||||
|
*/
|
||||||
|
protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[];
|
||||||
|
/**
|
||||||
|
* Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount
|
||||||
|
* @param groupId Name of the group the containers are being collected for
|
||||||
|
* @param containerData Containers and probability values for a groupId
|
||||||
|
* @returns List of chosen container Ids
|
||||||
|
*/
|
||||||
|
protected getContainersByProbabilty(groupId: string, containerData: IContainerGroupCount): string[];
|
||||||
|
/**
|
||||||
|
* Get a mapping of each groupid and the containers in that group + count of containers to spawn on map
|
||||||
|
* @param containersGroups Container group values
|
||||||
|
* @returns dictionary keyed by groupId
|
||||||
|
*/
|
||||||
|
protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record<string, IContainerMinMax>, staticContainersOnMap: IStaticContainerData[]): Record<string, IContainerGroupCount>;
|
||||||
|
/**
|
||||||
|
* Choose loot to put into a static container based on weighting
|
||||||
|
* Handle forced items + seasonal item removal when not in season
|
||||||
|
* @param staticContainer The container itself we will add loot to
|
||||||
|
* @param staticForced Loot we need to force into the container
|
||||||
|
* @param staticLootDist staticLoot.json
|
||||||
|
* @param staticAmmoDist staticAmmo.json
|
||||||
|
* @param locationName Name of the map to generate static loot for
|
||||||
|
* @returns IStaticContainerProps
|
||||||
|
*/
|
||||||
|
protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerData;
|
||||||
|
/**
|
||||||
|
* Get a 2d grid of a containers item slots
|
||||||
|
* @param containerTpl Tpl id of the container
|
||||||
|
* @returns number[][]
|
||||||
|
*/
|
||||||
|
protected getContainerMapping(containerTpl: string): number[][];
|
||||||
|
/**
|
||||||
|
* Look up a containers itemcountDistribution data and choose an item count based on the found weights
|
||||||
|
* @param containerTypeId Container to get item count for
|
||||||
|
* @param staticLootDist staticLoot.json
|
||||||
|
* @param locationName Map name (to get per-map multiplier for from config)
|
||||||
|
* @returns item count
|
||||||
|
*/
|
||||||
|
protected getWeightedCountOfContainerItems(containerTypeId: string, staticLootDist: Record<string, IStaticLootDetails>, locationName: string): number;
|
||||||
|
/**
|
||||||
|
* Get all possible loot items that can be placed into a container
|
||||||
|
* Do not add seasonal items if found + current date is inside seasonal event
|
||||||
|
* @param containerTypeId Contianer to get possible loot for
|
||||||
|
* @param staticLootDist staticLoot.json
|
||||||
|
* @returns ProbabilityObjectArray of item tpls + probabilty
|
||||||
|
*/
|
||||||
|
protected getPossibleLootItemsForContainer(containerTypeId: string, staticLootDist: Record<string, IStaticLootDetails>): ProbabilityObjectArray<string, number>;
|
||||||
protected getLooseLootMultiplerForLocation(location: string): number;
|
protected getLooseLootMultiplerForLocation(location: string): number;
|
||||||
protected getStaticLootMultiplerForLocation(location: string): number;
|
protected getStaticLootMultiplerForLocation(location: string): number;
|
||||||
/**
|
/**
|
||||||
@ -47,10 +119,31 @@ export declare class LocationGenerator {
|
|||||||
generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): SpawnpointTemplate[];
|
generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): SpawnpointTemplate[];
|
||||||
/**
|
/**
|
||||||
* Add forced spawn point loot into loot parameter array
|
* Add forced spawn point loot into loot parameter array
|
||||||
* @param loot array to add forced loot to
|
* @param lootLocationTemplates array to add forced loot spawn locations to
|
||||||
* @param forcedSpawnPoints forced loot to add
|
* @param forcedSpawnPoints forced Forced loot locations that must be added
|
||||||
* @param name of map currently generating forced loot for
|
* @param locationName Name of map currently having force loot created for
|
||||||
*/
|
*/
|
||||||
protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[], locationName: string): void;
|
protected addForcedLoot(lootLocationTemplates: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[], locationName: string): void;
|
||||||
protected createItem(tpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
|
/**
|
||||||
|
* Create array of item (with child items) and return
|
||||||
|
* @param chosenComposedKey Key we want to look up items for
|
||||||
|
* @param spawnPoint Dynamic spawn point item we want will be placed in
|
||||||
|
* @param staticAmmoDist ammo distributions
|
||||||
|
* @returns IContainerItem
|
||||||
|
*/
|
||||||
|
protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): IContainerItem;
|
||||||
|
/**
|
||||||
|
* Replace the _id value for base item + all children items parentid value
|
||||||
|
* @param itemWithChildren Item with mods to update
|
||||||
|
* @param newId new id to add on chidren of base item
|
||||||
|
*/
|
||||||
|
protected reparentItemAndChildren(itemWithChildren: Item[], newId?: string): void;
|
||||||
|
/**
|
||||||
|
* Find an item in array by its _tpl, handle differently if chosenTpl is a weapon
|
||||||
|
* @param items Items array to search
|
||||||
|
* @param chosenTpl Tpl we want to get item with
|
||||||
|
* @returns Item object
|
||||||
|
*/
|
||||||
|
protected getItemInArray(items: Item[], chosenTpl: string): Item;
|
||||||
|
protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
|
||||||
}
|
}
|
||||||
|
86
types/generators/LootGenerator.d.ts
vendored
86
types/generators/LootGenerator.d.ts
vendored
@ -1,38 +1,58 @@
|
|||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
|
||||||
import { Preset } from "../models/eft/common/IGlobals";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||||
import { LootItem } from "../models/spt/services/LootItem";
|
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
|
||||||
import { LootRequest } from "../models/spt/services/LootRequest";
|
import { IPreset } from "@spt-aki/models/eft/common/IGlobals";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||||
import { ItemFilterService } from "../services/ItemFilterService";
|
import { ISealedAirdropContainerSettings, RewardDetails } from "@spt-aki/models/spt/config/IInventoryConfig";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { LootItem } from "@spt-aki/models/spt/services/LootItem";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { LootRequest } from "@spt-aki/models/spt/services/LootRequest";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
|
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||||
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
|
import { RagfairLinkedItemService } from "@spt-aki/services/RagfairLinkedItemService";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
|
type ItemLimit = {
|
||||||
|
current: number;
|
||||||
|
max: number;
|
||||||
|
};
|
||||||
export declare class LootGenerator {
|
export declare class LootGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
|
protected jsonUtil: JsonUtil;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
|
protected presetHelper: PresetHelper;
|
||||||
|
protected inventoryHelper: InventoryHelper;
|
||||||
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
|
protected ragfairLinkedItemService: RagfairLinkedItemService;
|
||||||
protected itemFilterService: ItemFilterService;
|
protected itemFilterService: ItemFilterService;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService);
|
constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService);
|
||||||
/**
|
/**
|
||||||
* Generate a list of items based on configuration options parameter
|
* Generate a list of items based on configuration options parameter
|
||||||
* @param options parameters to adjust how loot is generated
|
* @param options parameters to adjust how loot is generated
|
||||||
* @returns An array of loot items
|
* @returns An array of loot items
|
||||||
*/
|
*/
|
||||||
createRandomloot(options: LootRequest): LootItem[];
|
createRandomLoot(options: LootRequest): LootItem[];
|
||||||
/**
|
/**
|
||||||
* Construct item limit record to hold max and current item count
|
* Filter armor items by their main plates protection level
|
||||||
|
* @param armor Armor preset
|
||||||
|
* @param options Loot request options
|
||||||
|
* @returns True item passes checks
|
||||||
|
*/
|
||||||
|
protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean;
|
||||||
|
/**
|
||||||
|
* Construct item limit record to hold max and current item count for each item type
|
||||||
* @param limits limits as defined in config
|
* @param limits limits as defined in config
|
||||||
* @returns record, key: item tplId, value: current/max item count allowed
|
* @returns record, key: item tplId, value: current/max item count allowed
|
||||||
*/
|
*/
|
||||||
protected initItemLimitCounter(limits: Record<string, number>): Record<string, {
|
protected initItemLimitCounter(limits: Record<string, number>): Record<string, ItemLimit>;
|
||||||
current: number;
|
|
||||||
max: number;
|
|
||||||
}>;
|
|
||||||
/**
|
/**
|
||||||
* Find a random item in items.json and add to result array
|
* Find a random item in items.json and add to result array
|
||||||
* @param items items to choose from
|
* @param items items to choose from
|
||||||
@ -60,8 +80,36 @@ export declare class LootGenerator {
|
|||||||
* @param result array to add found preset to
|
* @param result array to add found preset to
|
||||||
* @returns true if preset was valid and added to pool
|
* @returns true if preset was valid and added to pool
|
||||||
*/
|
*/
|
||||||
protected findAndAddRandomPresetToLoot(globalDefaultPresets: [string, Preset][], itemTypeCounts: Record<string, {
|
protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record<string, {
|
||||||
current: number;
|
current: number;
|
||||||
max: number;
|
max: number;
|
||||||
}>, itemBlacklist: string[], result: LootItem[]): boolean;
|
}>, itemBlacklist: string[], result: LootItem[]): boolean;
|
||||||
|
/**
|
||||||
|
* Sealed weapon containers have a weapon + associated mods inside them + assortment of other things (food/meds)
|
||||||
|
* @param containerSettings sealed weapon container settings
|
||||||
|
* @returns Array of item with children arrays
|
||||||
|
*/
|
||||||
|
getSealedWeaponCaseLoot(containerSettings: ISealedAirdropContainerSettings): Item[][];
|
||||||
|
/**
|
||||||
|
* Get non-weapon mod rewards for a sealed container
|
||||||
|
* @param containerSettings Sealed weapon container settings
|
||||||
|
* @param weaponDetailsDb Details for the weapon to reward player
|
||||||
|
* @returns Array of item with children arrays
|
||||||
|
*/
|
||||||
|
protected getSealedContainerNonWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, weaponDetailsDb: ITemplateItem): Item[][];
|
||||||
|
/**
|
||||||
|
* Iterate over the container weaponModRewardLimits settings and create an array of weapon mods to reward player
|
||||||
|
* @param containerSettings Sealed weapon container settings
|
||||||
|
* @param linkedItemsToWeapon All items that can be attached/inserted into weapon
|
||||||
|
* @param chosenWeaponPreset The weapon preset given to player as reward
|
||||||
|
* @returns Array of item with children arrays
|
||||||
|
*/
|
||||||
|
protected getSealedContainerWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, linkedItemsToWeapon: ITemplateItem[], chosenWeaponPreset: IPreset): Item[][];
|
||||||
|
/**
|
||||||
|
* Handle event-related loot containers - currently just the halloween jack-o-lanterns that give food rewards
|
||||||
|
* @param rewardContainerDetails
|
||||||
|
* @returns Array of item with children arrays
|
||||||
|
*/
|
||||||
|
getRandomLootContainerLoot(rewardContainerDetails: RewardDetails): Item[][];
|
||||||
}
|
}
|
||||||
|
export {};
|
||||||
|
28
types/generators/PMCLootGenerator.d.ts
vendored
28
types/generators/PMCLootGenerator.d.ts
vendored
@ -1,9 +1,10 @@
|
|||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { ItemFilterService } from "../services/ItemFilterService";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||||
|
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||||
/**
|
/**
|
||||||
* Handle the generation of dynamic PMC loot in pockets and backpacks
|
* Handle the generation of dynamic PMC loot in pockets and backpacks
|
||||||
* and the removal of blacklisted items
|
* and the removal of blacklisted items
|
||||||
@ -15,14 +16,27 @@ export declare class PMCLootGenerator {
|
|||||||
protected itemFilterService: ItemFilterService;
|
protected itemFilterService: ItemFilterService;
|
||||||
protected seasonalEventService: SeasonalEventService;
|
protected seasonalEventService: SeasonalEventService;
|
||||||
protected pocketLootPool: string[];
|
protected pocketLootPool: string[];
|
||||||
|
protected vestLootPool: string[];
|
||||||
protected backpackLootPool: string[];
|
protected backpackLootPool: string[];
|
||||||
protected botConfig: IBotConfig;
|
protected pmcConfig: IPmcConfig;
|
||||||
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService);
|
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService);
|
||||||
/**
|
/**
|
||||||
* Create an array of loot items a PMC can have in their pockets
|
* Create an array of loot items a PMC can have in their pockets
|
||||||
* @returns string array of tpls
|
* @returns string array of tpls
|
||||||
*/
|
*/
|
||||||
generatePMCPocketLootPool(): string[];
|
generatePMCPocketLootPool(): string[];
|
||||||
|
/**
|
||||||
|
* Create an array of loot items a PMC can have in their vests
|
||||||
|
* @returns string array of tpls
|
||||||
|
*/
|
||||||
|
generatePMCVestLootPool(): string[];
|
||||||
|
/**
|
||||||
|
* Check if item has a width/height that lets it fit into a 2x2 slot
|
||||||
|
* 1x1 / 1x2 / 2x1 / 2x2
|
||||||
|
* @param item Item to check size of
|
||||||
|
* @returns true if it fits
|
||||||
|
*/
|
||||||
|
protected itemFitsInto2By2Slot(item: ITemplateItem): boolean;
|
||||||
/**
|
/**
|
||||||
* Create an array of loot items a PMC can have in their backpack
|
* Create an array of loot items a PMC can have in their backpack
|
||||||
* @returns string array of tpls
|
* @returns string array of tpls
|
||||||
|
40
types/generators/PlayerScavGenerator.d.ts
vendored
40
types/generators/PlayerScavGenerator.d.ts
vendored
@ -1,23 +1,23 @@
|
|||||||
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
import { BotGenerator } from "@spt-aki/generators/BotGenerator";
|
||||||
import { BotHelper } from "../helpers/BotHelper";
|
import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper";
|
||||||
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
|
import { BotHelper } from "@spt-aki/helpers/BotHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { Skills, Stats } from "../models/eft/common/tables/IBotBase";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IBotType } from "../models/eft/common/tables/IBotType";
|
import { Skills, Stats } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||||
import { IPlayerScavConfig, KarmaLevel } from "../models/spt/config/IPlayerScavConfig";
|
import { IBotType } from "@spt-aki/models/eft/common/tables/IBotType";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IPlayerScavConfig, KarmaLevel } from "@spt-aki/models/spt/config/IPlayerScavConfig";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { BotLootCacheService } from "../services/BotLootCacheService";
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
import { FenceService } from "../services/FenceService";
|
import { BotLootCacheService } from "@spt-aki/services/BotLootCacheService";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { FenceService } from "@spt-aki/services/FenceService";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
import { BotGenerator } from "./BotGenerator";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
export declare class PlayerScavGenerator {
|
export declare class PlayerScavGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
|
54
types/generators/RagfairAssortGenerator.d.ts
vendored
54
types/generators/RagfairAssortGenerator.d.ts
vendored
@ -1,52 +1,52 @@
|
|||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { Preset } from "../models/eft/common/IGlobals";
|
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { IPreset } from "@spt-aki/models/eft/common/IGlobals";
|
||||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
export declare class RagfairAssortGenerator {
|
export declare class RagfairAssortGenerator {
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
|
protected presetHelper: PresetHelper;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected seasonalEventService: SeasonalEventService;
|
protected seasonalEventService: SeasonalEventService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected generatedAssortItems: Item[];
|
protected generatedAssortItems: Item[][];
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
|
protected ragfairItemInvalidBaseTypes: string[];
|
||||||
|
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Get an array of unique items that can be sold on the flea
|
* Get an array of arrays that can be sold on the flea
|
||||||
* @returns array of unique items
|
* Each sub array contains item + children (if any)
|
||||||
|
* @returns array of arrays
|
||||||
*/
|
*/
|
||||||
getAssortItems(): Item[];
|
getAssortItems(): Item[][];
|
||||||
/**
|
/**
|
||||||
* Check internal generatedAssortItems array has objects
|
* Check internal generatedAssortItems array has objects
|
||||||
* @returns true if array has objects
|
* @returns true if array has objects
|
||||||
*/
|
*/
|
||||||
protected assortsAreGenerated(): boolean;
|
protected assortsAreGenerated(): boolean;
|
||||||
/**
|
/**
|
||||||
* Generate an array of items the flea can sell
|
* Generate an array of arrays (item + children) the flea can sell
|
||||||
* @returns array of unique items
|
* @returns array of arrays (item + children)
|
||||||
*/
|
*/
|
||||||
protected generateRagfairAssortItems(): Item[];
|
protected generateRagfairAssortItems(): Item[][];
|
||||||
/**
|
/**
|
||||||
* Get presets from globals.json
|
* Get presets from globals to add to flea
|
||||||
* @returns Preset object array
|
* ragfairConfig.dynamic.showDefaultPresetsOnly decides if its all presets or just defaults
|
||||||
|
* @returns IPreset array
|
||||||
*/
|
*/
|
||||||
protected getPresets(): Preset[];
|
protected getPresetsToAdd(): IPreset[];
|
||||||
/**
|
|
||||||
* Get default presets from globals.json
|
|
||||||
* @returns Preset object array
|
|
||||||
*/
|
|
||||||
protected getDefaultPresets(): Preset[];
|
|
||||||
/**
|
/**
|
||||||
* Create a base assort item and return it with populated values + 999999 stack count + unlimited count = true
|
* Create a base assort item and return it with populated values + 999999 stack count + unlimited count = true
|
||||||
* @param tplId tplid to add to item
|
* @param tplId tplid to add to item
|
||||||
* @param id id to add to item
|
* @param id id to add to item
|
||||||
* @returns hydrated Item object
|
* @returns Hydrated Item object
|
||||||
*/
|
*/
|
||||||
protected createRagfairAssortItem(tplId: string, id?: string): Item;
|
protected createRagfairAssortRootItem(tplId: string, id?: string): Item;
|
||||||
}
|
}
|
||||||
|
162
types/generators/RagfairOfferGenerator.d.ts
vendored
162
types/generators/RagfairOfferGenerator.d.ts
vendored
@ -1,27 +1,26 @@
|
|||||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
import { RagfairAssortGenerator } from "@spt-aki/generators/RagfairAssortGenerator";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
|
||||||
import { PaymentHelper } from "../helpers/PaymentHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { PresetHelper } from "../helpers/PresetHelper";
|
import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper";
|
||||||
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
|
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { IBarterScheme } from "../models/eft/common/tables/ITrader";
|
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||||
import { IRagfairOffer, OfferRequirement } from "../models/eft/ragfair/IRagfairOffer";
|
import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader";
|
||||||
import { Dynamic, IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
import { IRagfairOffer, OfferRequirement } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { FenceService } from "../services/FenceService";
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { FenceService } from "@spt-aki/services/FenceService";
|
||||||
import { RagfairCategoriesService } from "../services/RagfairCategoriesService";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService";
|
||||||
import { RagfairPriceService } from "../services/RagfairPriceService";
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
import { RagfairAssortGenerator } from "./RagfairAssortGenerator";
|
|
||||||
export declare class RagfairOfferGenerator {
|
export declare class RagfairOfferGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator {
|
|||||||
protected ragfairPriceService: RagfairPriceService;
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected paymentHelper: PaymentHelper;
|
protected paymentHelper: PaymentHelper;
|
||||||
protected ragfairCategoriesService: RagfairCategoriesService;
|
|
||||||
protected fenceService: FenceService;
|
protected fenceService: FenceService;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
@ -47,14 +45,37 @@ export declare class RagfairOfferGenerator {
|
|||||||
tpl: string;
|
tpl: string;
|
||||||
price: number;
|
price: number;
|
||||||
}[];
|
}[];
|
||||||
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer);
|
/** Internal counter to ensure each offer created has a unique value for its intId property */
|
||||||
createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
|
protected offerCounter: number;
|
||||||
|
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer);
|
||||||
|
/**
|
||||||
|
* Create a flea offer and store it in the Ragfair server offers array
|
||||||
|
* @param userID Owner of the offer
|
||||||
|
* @param time Time offer is listed at
|
||||||
|
* @param items Items in the offer
|
||||||
|
* @param barterScheme Cost of item (currency or barter)
|
||||||
|
* @param loyalLevel Loyalty level needed to buy item
|
||||||
|
* @param sellInOnePiece Flags sellInOnePiece to be true
|
||||||
|
* @returns IRagfairOffer
|
||||||
|
*/
|
||||||
|
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
|
||||||
|
/**
|
||||||
|
* Create an offer object ready to send to ragfairOfferService.addOffer()
|
||||||
|
* @param userID Owner of the offer
|
||||||
|
* @param time Time offer is listed at
|
||||||
|
* @param items Items in the offer
|
||||||
|
* @param barterScheme Cost of item (currency or barter)
|
||||||
|
* @param loyalLevel Loyalty level needed to buy item
|
||||||
|
* @param sellInOnePiece Set StackObjectsCount to 1
|
||||||
|
* @returns IRagfairOffer
|
||||||
|
*/
|
||||||
|
protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
|
||||||
/**
|
/**
|
||||||
* Calculate the offer price that's listed on the flea listing
|
* Calculate the offer price that's listed on the flea listing
|
||||||
* @param offerRequirements barter requirements for offer
|
* @param offerRequirements barter requirements for offer
|
||||||
* @returns rouble cost of offer
|
* @returns rouble cost of offer
|
||||||
*/
|
*/
|
||||||
protected calculateOfferListingPrice(offerRequirements: OfferRequirement[]): number;
|
protected convertOfferRequirementsIntoRoubles(offerRequirements: OfferRequirement[]): number;
|
||||||
/**
|
/**
|
||||||
* Get avatar url from trader table in db
|
* Get avatar url from trader table in db
|
||||||
* @param isTrader Is user we're getting avatar for a trader
|
* @param isTrader Is user we're getting avatar for a trader
|
||||||
@ -69,8 +90,18 @@ export declare class RagfairOfferGenerator {
|
|||||||
* @returns count of roubles
|
* @returns count of roubles
|
||||||
*/
|
*/
|
||||||
protected calculateRoublePrice(currencyCount: number, currencyType: string): number;
|
protected calculateRoublePrice(currencyCount: number, currencyType: string): number;
|
||||||
protected getTraderId(userID: string): string;
|
/**
|
||||||
protected getRating(userID: string): number;
|
* Check userId, if its a player, return their pmc _id, otherwise return userId parameter
|
||||||
|
* @param userId Users Id to check
|
||||||
|
* @returns Users Id
|
||||||
|
*/
|
||||||
|
protected getTraderId(userId: string): string;
|
||||||
|
/**
|
||||||
|
* Get a flea trading rating for the passed in user
|
||||||
|
* @param userId User to get flea rating of
|
||||||
|
* @returns Flea rating value
|
||||||
|
*/
|
||||||
|
protected getRating(userId: string): number;
|
||||||
/**
|
/**
|
||||||
* Is the offers user rating growing
|
* Is the offers user rating growing
|
||||||
* @param userID user to check rating of
|
* @param userID user to check rating of
|
||||||
@ -88,16 +119,28 @@ export declare class RagfairOfferGenerator {
|
|||||||
* Create multiple offers for items by using a unique list of items we've generated previously
|
* Create multiple offers for items by using a unique list of items we've generated previously
|
||||||
* @param expiredOffers optional, expired offers to regenerate
|
* @param expiredOffers optional, expired offers to regenerate
|
||||||
*/
|
*/
|
||||||
generateDynamicOffers(expiredOffers?: Item[]): Promise<void>;
|
generateDynamicOffers(expiredOffers?: Item[][]): Promise<void>;
|
||||||
protected createOffersForItems(assortItemIndex: string, assortItemsToProcess: Item[], expiredOffers: Item[], config: Dynamic): Promise<void>;
|
/**
|
||||||
|
* @param assortItemWithChildren Item with its children to process into offers
|
||||||
|
* @param isExpiredOffer is an expired offer
|
||||||
|
* @param config Ragfair dynamic config
|
||||||
|
*/
|
||||||
|
protected createOffersFromAssort(assortItemWithChildren: Item[], isExpiredOffer: boolean, config: Dynamic): Promise<void>;
|
||||||
|
/**
|
||||||
|
* iterate over an items chidren and look for plates above desired level and remove them
|
||||||
|
* @param presetWithChildren preset to check for plates
|
||||||
|
* @param plateSettings Settings
|
||||||
|
* @returns True if plate removed
|
||||||
|
*/
|
||||||
|
protected removeBannedPlatesFromPreset(presetWithChildren: Item[], plateSettings: IArmorPlateBlacklistSettings): boolean;
|
||||||
/**
|
/**
|
||||||
* Create one flea offer for a specific item
|
* Create one flea offer for a specific item
|
||||||
* @param items Item to create offer for
|
* @param itemWithChildren Item to create offer for
|
||||||
* @param isPreset Is item a weapon preset
|
* @param isPreset Is item a weapon preset
|
||||||
* @param itemDetails raw db item details
|
* @param itemDetails raw db item details
|
||||||
* @returns
|
* @returns Item array
|
||||||
*/
|
*/
|
||||||
protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise<Item[]>;
|
protected createSingleOfferForItem(itemWithChildren: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Generate trader offers on flea using the traders assort data
|
* Generate trader offers on flea using the traders assort data
|
||||||
* @param traderID Trader to generate offers for
|
* @param traderID Trader to generate offers for
|
||||||
@ -107,11 +150,10 @@ export declare class RagfairOfferGenerator {
|
|||||||
* Get array of an item with its mods + condition properties (e.g durability)
|
* 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
|
* Apply randomisation adjustments to condition if item base is found in ragfair.json/dynamic/condition
|
||||||
* @param userID id of owner of item
|
* @param userID id of owner of item
|
||||||
* @param itemWithMods Item and mods, get condition of first item (only first array item is used)
|
* @param itemWithMods Item and mods, get condition of first item (only first array item is modified)
|
||||||
* @param itemDetails db details of first item
|
* @param itemDetails db details of first item
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
protected getItemCondition(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[];
|
protected randomiseOfferItemUpdProperties(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): void;
|
||||||
/**
|
/**
|
||||||
* Get the relevant condition id if item tpl matches in ragfair.json/condition
|
* Get the relevant condition id if item tpl matches in ragfair.json/condition
|
||||||
* @param tpl Item to look for matching condition object
|
* @param tpl Item to look for matching condition object
|
||||||
@ -121,30 +163,38 @@ export declare class RagfairOfferGenerator {
|
|||||||
/**
|
/**
|
||||||
* Alter an items condition based on its item base type
|
* Alter an items condition based on its item base type
|
||||||
* @param conditionSettingsId also the parentId of item being altered
|
* @param conditionSettingsId also the parentId of item being altered
|
||||||
* @param item Item to adjust condition details of
|
* @param itemWithMods Item to adjust condition details of
|
||||||
* @param itemDetails db item details of first item in array
|
* @param itemDetails db item details of first item in array
|
||||||
*/
|
*/
|
||||||
protected randomiseItemCondition(conditionSettingsId: string, item: Item, itemDetails: ITemplateItem): void;
|
protected randomiseItemCondition(conditionSettingsId: string, itemWithMods: Item[], itemDetails: ITemplateItem): void;
|
||||||
/**
|
/**
|
||||||
* Adjust an items durability/maxDurability value
|
* Adjust an items durability/maxDurability value
|
||||||
* @param item item (weapon/armor) to adjust
|
* @param item item (weapon/armor) to Adjust
|
||||||
* @param multiplier Value to multiple durability by
|
* @param itemDbDetails Weapon details from db
|
||||||
|
* @param maxMultiplier Value to multiply max durability by
|
||||||
|
* @param currentMultiplier Value to multiply current durability by
|
||||||
*/
|
*/
|
||||||
protected randomiseDurabilityValues(item: Item, multiplier: number): void;
|
protected randomiseWeaponDurability(item: Item, itemDbDetails: ITemplateItem, maxMultiplier: number, currentMultiplier: number): void;
|
||||||
|
/**
|
||||||
|
* Randomise the durabiltiy values for an armors plates and soft inserts
|
||||||
|
* @param armorWithMods Armor item with its child mods
|
||||||
|
* @param currentMultiplier Chosen multipler to use for current durability value
|
||||||
|
* @param maxMultiplier Chosen multipler to use for max durability value
|
||||||
|
*/
|
||||||
|
protected randomiseArmorDurabilityValues(armorWithMods: Item[], currentMultiplier: number, maxMultiplier: number): void;
|
||||||
/**
|
/**
|
||||||
* Add missing conditions to an item if needed
|
* Add missing conditions to an item if needed
|
||||||
* Durabiltiy for repairable items
|
* Durabiltiy for repairable items
|
||||||
* HpResource for medical items
|
* HpResource for medical items
|
||||||
* @param item item to add conditions to
|
* @param item item to add conditions to
|
||||||
* @returns Item with conditions added
|
|
||||||
*/
|
*/
|
||||||
protected addMissingConditions(item: Item): Item;
|
protected addMissingConditions(item: Item): void;
|
||||||
/**
|
/**
|
||||||
* Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based
|
* Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based
|
||||||
* @param offerItems Items for sale in offer
|
* @param offerItems Items for sale in offer
|
||||||
* @returns barter scheme
|
* @returns Barter scheme
|
||||||
*/
|
*/
|
||||||
protected createBarterRequirement(offerItems: Item[]): IBarterScheme[];
|
protected createBarterBarterScheme(offerItems: Item[]): IBarterScheme[];
|
||||||
/**
|
/**
|
||||||
* Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter`
|
* Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter`
|
||||||
* @returns array with tpl/price values
|
* @returns array with tpl/price values
|
||||||
@ -155,20 +205,10 @@ export declare class RagfairOfferGenerator {
|
|||||||
}[];
|
}[];
|
||||||
/**
|
/**
|
||||||
* Create a random currency-based barter scheme for an array of items
|
* Create a random currency-based barter scheme for an array of items
|
||||||
* @param offerItems Items on offer
|
* @param offerWithChildren Items on offer
|
||||||
|
* @param isPackOffer Is the barter scheme being created for a pack offer
|
||||||
|
* @param multipler What to multiply the resulting price by
|
||||||
* @returns Barter scheme for offer
|
* @returns Barter scheme for offer
|
||||||
*/
|
*/
|
||||||
protected createCurrencyRequirement(offerItems: Item[]): IBarterScheme[];
|
protected createCurrencyBarterScheme(offerWithChildren: Item[], isPackOffer: boolean, multipler?: number): IBarterScheme[];
|
||||||
/**
|
|
||||||
* Create a flea offer and store it in the Ragfair server offers array
|
|
||||||
* @param userID owner of the offer
|
|
||||||
* @param time time offer is put up
|
|
||||||
* @param items items in the offer
|
|
||||||
* @param barterScheme cost of item (currency or barter)
|
|
||||||
* @param loyalLevel Loyalty level needed to buy item
|
|
||||||
* @param price price of offer
|
|
||||||
* @param sellInOnePiece
|
|
||||||
* @returns Ragfair offer
|
|
||||||
*/
|
|
||||||
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
|
|
||||||
}
|
}
|
||||||
|
223
types/generators/RepeatableQuestGenerator.d.ts
vendored
Normal file
223
types/generators/RepeatableQuestGenerator.d.ts
vendored
Normal file
@ -0,0 +1,223 @@
|
|||||||
|
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
|
||||||
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
|
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||||
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
|
import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper";
|
||||||
|
import { RepeatableQuestHelper } from "@spt-aki/helpers/RepeatableQuestHelper";
|
||||||
|
import { Exit } from "@spt-aki/models/eft/common/ILocationBase";
|
||||||
|
import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||||
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
|
import { IQuestCondition, IQuestConditionCounterCondition, IQuestReward, IQuestRewards } from "@spt-aki/models/eft/common/tables/IQuest";
|
||||||
|
import { IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests";
|
||||||
|
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||||
|
import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
|
||||||
|
import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool";
|
||||||
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
|
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||||
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
|
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||||
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
|
import { PaymentService } from "@spt-aki/services/PaymentService";
|
||||||
|
import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService";
|
||||||
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||||
|
import { ObjectId } from "@spt-aki/utils/ObjectId";
|
||||||
|
import { ProbabilityObjectArray, RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
|
export declare class RepeatableQuestGenerator {
|
||||||
|
protected timeUtil: TimeUtil;
|
||||||
|
protected logger: ILogger;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
|
protected httpResponse: HttpResponseUtil;
|
||||||
|
protected mathUtil: MathUtil;
|
||||||
|
protected jsonUtil: JsonUtil;
|
||||||
|
protected databaseServer: DatabaseServer;
|
||||||
|
protected itemHelper: ItemHelper;
|
||||||
|
protected presetHelper: PresetHelper;
|
||||||
|
protected profileHelper: ProfileHelper;
|
||||||
|
protected profileFixerService: ProfileFixerService;
|
||||||
|
protected handbookHelper: HandbookHelper;
|
||||||
|
protected ragfairServerHelper: RagfairServerHelper;
|
||||||
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
|
protected localisationService: LocalisationService;
|
||||||
|
protected paymentService: PaymentService;
|
||||||
|
protected objectId: ObjectId;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
|
protected repeatableQuestHelper: RepeatableQuestHelper;
|
||||||
|
protected configServer: ConfigServer;
|
||||||
|
protected questConfig: IQuestConfig;
|
||||||
|
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, repeatableQuestHelper: RepeatableQuestHelper, configServer: ConfigServer);
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
* @param pmcLevel Player's level for requested items and reward generation
|
||||||
|
* @param pmcTraderInfo Players traper standing/rep levels
|
||||||
|
* @param questTypePool Possible quest types pool
|
||||||
|
* @param repeatableConfig Repeatable quest config
|
||||||
|
* @returns IRepeatableQuest
|
||||||
|
*/
|
||||||
|
generateRepeatableQuest(pmcLevel: number, pmcTraderInfo: Record<string, TraderInfo>, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
|
||||||
|
/**
|
||||||
|
* Generate a randomised Elimination quest
|
||||||
|
* @param pmcLevel Player's level for requested items and reward generation
|
||||||
|
* @param traderId Trader from which the quest will be provided
|
||||||
|
* @param questTypePool Pools for quests (used to avoid redundant quests)
|
||||||
|
* @param repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
|
||||||
|
* @returns Object of quest type format for "Elimination" (see assets/database/templates/repeatableQuests.json)
|
||||||
|
*/
|
||||||
|
protected generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
|
||||||
|
/**
|
||||||
|
* Get a number of kills neded to complete elimination quest
|
||||||
|
* @param targetKey Target type desired e.g. anyPmc/bossBully/Savage
|
||||||
|
* @param targetsConfig Config
|
||||||
|
* @param eliminationConfig Config
|
||||||
|
* @returns Number of AI to kill
|
||||||
|
*/
|
||||||
|
protected getEliminationKillCount(targetKey: string, targetsConfig: ProbabilityObjectArray<string, IBossInfo>, eliminationConfig: IEliminationConfig): number;
|
||||||
|
/**
|
||||||
|
* A repeatable quest, besides some more or less static components, exists of reward and condition (see assets/database/templates/repeatableQuests.json)
|
||||||
|
* This is a helper method for GenerateEliminationQuest to create a location condition.
|
||||||
|
*
|
||||||
|
* @param {string} location the location on which to fulfill the elimination quest
|
||||||
|
* @returns {IEliminationCondition} object of "Elimination"-location-subcondition
|
||||||
|
*/
|
||||||
|
protected generateEliminationLocation(location: string[]): IQuestConditionCounterCondition;
|
||||||
|
/**
|
||||||
|
* Create kill condition for an elimination quest
|
||||||
|
* @param target Bot type target of elimination quest e.g. "AnyPmc", "Savage"
|
||||||
|
* @param targetedBodyParts Body parts player must hit
|
||||||
|
* @param distance Distance from which to kill (currently only >= supported
|
||||||
|
* @param allowedWeapon What weapon must be used - undefined = any
|
||||||
|
* @param allowedWeaponCategory What category of weapon must be used - undefined = any
|
||||||
|
* @returns IEliminationCondition object
|
||||||
|
*/
|
||||||
|
protected generateEliminationCondition(target: string, targetedBodyParts: string[], distance: number, allowedWeapon: string, allowedWeaponCategory: string): IQuestConditionCounterCondition;
|
||||||
|
/**
|
||||||
|
* Generates a valid Completion quest
|
||||||
|
*
|
||||||
|
* @param {integer} pmcLevel player's level for requested items and reward generation
|
||||||
|
* @param {string} traderId trader from which the quest will be provided
|
||||||
|
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
|
||||||
|
* @returns {object} object of quest type format for "Completion" (see assets/database/templates/repeatableQuests.json)
|
||||||
|
*/
|
||||||
|
protected generateCompletionQuest(pmcLevel: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
|
||||||
|
/**
|
||||||
|
* A repeatable quest, besides some more or less static components, exists of reward and condition (see assets/database/templates/repeatableQuests.json)
|
||||||
|
* This is a helper method for GenerateCompletionQuest to create a completion condition (of which a completion quest theoretically can have many)
|
||||||
|
*
|
||||||
|
* @param {string} itemTpl id of the item to request
|
||||||
|
* @param {integer} value amount of items of this specific type to request
|
||||||
|
* @returns {object} object of "Completion"-condition
|
||||||
|
*/
|
||||||
|
protected generateCompletionAvailableForFinish(itemTpl: string, value: number): IQuestCondition;
|
||||||
|
/**
|
||||||
|
* Generates a valid Exploration quest
|
||||||
|
*
|
||||||
|
* @param {integer} pmcLevel player's level for reward generation
|
||||||
|
* @param {string} traderId trader from which the quest will be provided
|
||||||
|
* @param {object} questTypePool Pools for quests (used to avoid redundant quests)
|
||||||
|
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
|
||||||
|
* @returns {object} object of quest type format for "Exploration" (see assets/database/templates/repeatableQuests.json)
|
||||||
|
*/
|
||||||
|
protected generateExplorationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
|
||||||
|
/**
|
||||||
|
* Filter a maps exits to just those for the desired side
|
||||||
|
* @param locationKey Map id (e.g. factory4_day)
|
||||||
|
* @param playerSide Scav/Bear
|
||||||
|
* @returns Array of Exit objects
|
||||||
|
*/
|
||||||
|
protected getLocationExitsForSide(locationKey: string, playerSide: string): Exit[];
|
||||||
|
protected generatePickupQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
|
||||||
|
/**
|
||||||
|
* Convert 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
|
||||||
|
*
|
||||||
|
* @param {string} exit The exit name to generate the condition for
|
||||||
|
* @returns {object} Exit condition
|
||||||
|
*/
|
||||||
|
protected generateExplorationExitCondition(exit: Exit): IQuestConditionCounterCondition;
|
||||||
|
/**
|
||||||
|
* Generate the reward for a mission. A reward can consist of
|
||||||
|
* - Experience
|
||||||
|
* - Money
|
||||||
|
* - Items
|
||||||
|
* - Trader Reputation
|
||||||
|
*
|
||||||
|
* The reward is dependent on the player level as given by the wiki. The exact mapping of pmcLevel to
|
||||||
|
* experience / money / items / trader reputation can be defined in QuestConfig.js
|
||||||
|
*
|
||||||
|
* There's also a random variation of the reward the spread of which can be also defined in the config.
|
||||||
|
*
|
||||||
|
* Additionally, a scaling factor w.r.t. quest difficulty going from 0.2...1 can be used
|
||||||
|
*
|
||||||
|
* @param {integer} pmcLevel player's level
|
||||||
|
* @param {number} difficulty a reward scaling factor from 0.2 to 1
|
||||||
|
* @param {string} traderId the trader for reputation gain (and possible in the future filtering of reward item type based on trader)
|
||||||
|
* @param {object} repeatableConfig The configuration for the repeatable kind (daily, weekly) as configured in QuestConfig for the requested quest
|
||||||
|
* @returns {object} object of "Reward"-type that can be given for a repeatable mission
|
||||||
|
*/
|
||||||
|
protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards;
|
||||||
|
protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void;
|
||||||
|
protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number;
|
||||||
|
/**
|
||||||
|
* Should reward item have stack size increased (25% chance)
|
||||||
|
* @param item Item to possibly increase stack size of
|
||||||
|
* @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking
|
||||||
|
* @returns True if it should
|
||||||
|
*/
|
||||||
|
protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean;
|
||||||
|
/**
|
||||||
|
* Get a randomised number a reward items stack size should be based on its handbook price
|
||||||
|
* @param item Reward item to get stack size for
|
||||||
|
* @returns Stack size value
|
||||||
|
*/
|
||||||
|
protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number;
|
||||||
|
/**
|
||||||
|
* Select a number of items that have a colelctive value of the passed in parameter
|
||||||
|
* @param repeatableConfig Config
|
||||||
|
* @param roublesBudget Total value of items to return
|
||||||
|
* @returns Array of reward items that fit budget
|
||||||
|
*/
|
||||||
|
protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[];
|
||||||
|
/**
|
||||||
|
* Helper to create a reward item structured as required by the client
|
||||||
|
*
|
||||||
|
* @param {string} tpl ItemId of the rewarded item
|
||||||
|
* @param {integer} value Amount of items to give
|
||||||
|
* @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index
|
||||||
|
* @returns {object} Object of "Reward"-item-type
|
||||||
|
*/
|
||||||
|
protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward;
|
||||||
|
/**
|
||||||
|
* 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 List of rewardable items [[_tpl, itemTemplate],...]
|
||||||
|
*/
|
||||||
|
protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [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 {string} tpl template id of item to check
|
||||||
|
* @returns True if item is valid reward
|
||||||
|
*/
|
||||||
|
protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean;
|
||||||
|
/**
|
||||||
|
* 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} 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)
|
||||||
|
*/
|
||||||
|
protected generateRepeatableTemplate(type: string, traderId: string, side: string): IRepeatableQuest;
|
||||||
|
}
|
59
types/generators/ScavCaseRewardGenerator.d.ts
vendored
59
types/generators/ScavCaseRewardGenerator.d.ts
vendored
@ -1,43 +1,49 @@
|
|||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { Product } from "../models/eft/common/tables/IBotBase";
|
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase";
|
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||||
import { IScavCaseConfig } from "../models/spt/config/IScavCaseConfig";
|
import { IHideoutScavCase } from "@spt-aki/models/eft/hideout/IHideoutScavCase";
|
||||||
import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "../models/spt/hideout/ScavCaseRewardCountsAndPrices";
|
import { IScavCaseConfig } from "@spt-aki/models/spt/config/IScavCaseConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt-aki/models/spt/hideout/ScavCaseRewardCountsAndPrices";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { ItemFilterService } from "../services/ItemFilterService";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { RagfairPriceService } from "../services/RagfairPriceService";
|
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
/**
|
/**
|
||||||
* Handle the creation of randomised scav case rewards
|
* Handle the creation of randomised scav case rewards
|
||||||
*/
|
*/
|
||||||
export declare class ScavCaseRewardGenerator {
|
export declare class ScavCaseRewardGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
|
protected jsonUtil: JsonUtil;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
|
protected presetHelper: PresetHelper;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected ragfairPriceService: RagfairPriceService;
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected itemFilterService: ItemFilterService;
|
protected itemFilterService: ItemFilterService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected scavCaseConfig: IScavCaseConfig;
|
protected scavCaseConfig: IScavCaseConfig;
|
||||||
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
protected dbItemsCache: ITemplateItem[];
|
||||||
|
protected dbAmmoItemsCache: ITemplateItem[];
|
||||||
|
constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, 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
|
* Create an array of rewards that will be given to the player upon completing their scav case build
|
||||||
* @param recipeId recipe of the scav case craft
|
* @param recipeId recipe of the scav case craft
|
||||||
* @returns Product array
|
* @returns Product array
|
||||||
*/
|
*/
|
||||||
generate(recipeId: string): Product[];
|
generate(recipeId: string): Item[][];
|
||||||
/**
|
/**
|
||||||
* Get all db items that are not blacklisted in scavcase config
|
* Get all db items that are not blacklisted in scavcase config or global blacklist
|
||||||
* @returns filtered array of db items
|
* Store in class field
|
||||||
*/
|
*/
|
||||||
protected getDbItems(): ITemplateItem[];
|
protected cacheDbItems(): void;
|
||||||
/**
|
/**
|
||||||
* Pick a number of items to be rewards, the count is defined by the values in
|
* Pick a number of items to be rewards, the count is defined by the values in `itemFilters` param
|
||||||
* @param items item pool to pick rewards from
|
* @param items item pool to pick rewards from
|
||||||
* @param itemFilters how the rewards should be filtered down (by item count)
|
* @param itemFilters how the rewards should be filtered down (by item count)
|
||||||
* @returns
|
* @returns
|
||||||
@ -69,26 +75,15 @@ export declare class ScavCaseRewardGenerator {
|
|||||||
* @param rewardItems items to convert
|
* @param rewardItems items to convert
|
||||||
* @returns Product array
|
* @returns Product array
|
||||||
*/
|
*/
|
||||||
protected randomiseContainerItemRewards(rewardItems: ITemplateItem[], rarity: string): Product[];
|
protected randomiseContainerItemRewards(rewardItems: ITemplateItem[], rarity: string): Item[][];
|
||||||
/**
|
/**
|
||||||
* Add a randomised stack count to ammo or money items
|
|
||||||
* @param item money or ammo item
|
|
||||||
* @param resultItem money or ammo item with a randomise stack size
|
|
||||||
*/
|
|
||||||
protected addStackCountToAmmoAndMoney(item: ITemplateItem, resultItem: {
|
|
||||||
_id: string;
|
|
||||||
_tpl: string;
|
|
||||||
upd: any;
|
|
||||||
}, rarity: string): void;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param dbItems all items from the items.json
|
* @param dbItems all items from the items.json
|
||||||
* @param itemFilters controls how the dbItems will be filtered and returned (handbook price)
|
* @param itemFilters controls how the dbItems will be filtered and returned (handbook price)
|
||||||
* @returns filtered dbItems array
|
* @returns filtered dbItems array
|
||||||
*/
|
*/
|
||||||
protected getFilteredItemsByPrice(dbItems: ITemplateItem[], itemFilters: RewardCountAndPriceDetails): ITemplateItem[];
|
protected getFilteredItemsByPrice(dbItems: ITemplateItem[], itemFilters: RewardCountAndPriceDetails): ITemplateItem[];
|
||||||
/**
|
/**
|
||||||
* Gathers the reward options from config and scavcase.json into a single object
|
* Gathers the reward min and max count params for each reward quality level from config and scavcase.json into a single object
|
||||||
* @param scavCaseDetails scavcase.json values
|
* @param scavCaseDetails scavcase.json values
|
||||||
* @returns ScavCaseRewardCountsAndPrices object
|
* @returns ScavCaseRewardCountsAndPrices object
|
||||||
*/
|
*/
|
||||||
|
27
types/generators/WeatherGenerator.d.ts
vendored
27
types/generators/WeatherGenerator.d.ts
vendored
@ -1,12 +1,12 @@
|
|||||||
import { ApplicationContext } from "../context/ApplicationContext";
|
import { ApplicationContext } from "@spt-aki/context/ApplicationContext";
|
||||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
|
||||||
import { IWeather, IWeatherData } from "../models/eft/weather/IWeatherData";
|
import { IWeather, IWeatherData } from "@spt-aki/models/eft/weather/IWeatherData";
|
||||||
import { WindDirection } from "../models/enums/WindDirection";
|
import { WindDirection } from "@spt-aki/models/enums/WindDirection";
|
||||||
import { IWeatherConfig } from "../models/spt/config/IWeatherConfig";
|
import { IWeatherConfig } from "@spt-aki/models/spt/config/IWeatherConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
export declare class WeatherGenerator {
|
export declare class WeatherGenerator {
|
||||||
protected weightedRandomHelper: WeightedRandomHelper;
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
@ -15,7 +15,13 @@ export declare class WeatherGenerator {
|
|||||||
protected applicationContext: ApplicationContext;
|
protected applicationContext: ApplicationContext;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected weatherConfig: IWeatherConfig;
|
protected weatherConfig: IWeatherConfig;
|
||||||
|
private serverStartTimestampMS;
|
||||||
constructor(weightedRandomHelper: WeightedRandomHelper, logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, applicationContext: ApplicationContext, configServer: ConfigServer);
|
constructor(weightedRandomHelper: WeightedRandomHelper, logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||||
|
/**
|
||||||
|
* Get current + raid datetime and format into correct BSG format and return
|
||||||
|
* @param data Weather data
|
||||||
|
* @returns IWeatherData
|
||||||
|
*/
|
||||||
calculateGameTime(data: IWeatherData): IWeatherData;
|
calculateGameTime(data: IWeatherData): IWeatherData;
|
||||||
/**
|
/**
|
||||||
* Get server uptime seconds multiplied by a multiplier and add to current time as seconds
|
* Get server uptime seconds multiplied by a multiplier and add to current time as seconds
|
||||||
@ -33,7 +39,7 @@ export declare class WeatherGenerator {
|
|||||||
/**
|
/**
|
||||||
* Get current time formatted to fit BSGs requirement
|
* Get current time formatted to fit BSGs requirement
|
||||||
* @param date date to format into bsg style
|
* @param date date to format into bsg style
|
||||||
* @returns
|
* @returns Time formatted in BSG format
|
||||||
*/
|
*/
|
||||||
protected getBSGFormattedTime(date: Date): string;
|
protected getBSGFormattedTime(date: Date): string;
|
||||||
/**
|
/**
|
||||||
@ -47,6 +53,7 @@ export declare class WeatherGenerator {
|
|||||||
*/
|
*/
|
||||||
protected setCurrentDateTime(weather: IWeather): void;
|
protected setCurrentDateTime(weather: IWeather): void;
|
||||||
protected getWeightedWindDirection(): WindDirection;
|
protected getWeightedWindDirection(): WindDirection;
|
||||||
|
protected getWeightedClouds(): number;
|
||||||
protected getWeightedWindSpeed(): number;
|
protected getWeightedWindSpeed(): number;
|
||||||
protected getWeightedFog(): number;
|
protected getWeightedFog(): number;
|
||||||
protected getWeightedRain(): number;
|
protected getWeightedRain(): number;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { InventoryMagGen } from "./InventoryMagGen";
|
import { InventoryMagGen } from "@spt-aki/generators/weapongen/InventoryMagGen";
|
||||||
export interface IInventoryMagGen {
|
export interface IInventoryMagGen {
|
||||||
getPriority(): number;
|
getPriority(): number;
|
||||||
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
|
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
|
||||||
|
10
types/generators/weapongen/InventoryMagGen.d.ts
vendored
10
types/generators/weapongen/InventoryMagGen.d.ts
vendored
@ -1,14 +1,14 @@
|
|||||||
import { MinMax } from "../../models/common/MinMax";
|
import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||||
import { Inventory } from "../../models/eft/common/tables/IBotBase";
|
import { GenerationData } from "@spt-aki/models/eft/common/tables/IBotType";
|
||||||
import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem";
|
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||||
export declare class InventoryMagGen {
|
export declare class InventoryMagGen {
|
||||||
private magCounts;
|
private magCounts;
|
||||||
private magazineTemplate;
|
private magazineTemplate;
|
||||||
private weaponTemplate;
|
private weaponTemplate;
|
||||||
private ammoTemplate;
|
private ammoTemplate;
|
||||||
private pmcInventory;
|
private pmcInventory;
|
||||||
constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory);
|
constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory);
|
||||||
getMagCount(): MinMax;
|
getMagCount(): GenerationData;
|
||||||
getMagazineTemplate(): ITemplateItem;
|
getMagazineTemplate(): ITemplateItem;
|
||||||
getWeaponTemplate(): ITemplateItem;
|
getWeaponTemplate(): ITemplateItem;
|
||||||
getAmmoTemplate(): ITemplateItem;
|
getAmmoTemplate(): ITemplateItem;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper";
|
import { IInventoryMagGen } from "@spt-aki/generators/weapongen/IInventoryMagGen";
|
||||||
import { RandomUtil } from "../../../utils/RandomUtil";
|
import { InventoryMagGen } from "@spt-aki/generators/weapongen/InventoryMagGen";
|
||||||
import { IInventoryMagGen } from "../IInventoryMagGen";
|
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper";
|
||||||
import { InventoryMagGen } from "../InventoryMagGen";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
export declare class BarrelInventoryMagGen implements IInventoryMagGen {
|
export declare class BarrelInventoryMagGen implements IInventoryMagGen {
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
||||||
|
@ -1,16 +1,25 @@
|
|||||||
import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper";
|
import { IInventoryMagGen } from "@spt-aki/generators/weapongen/IInventoryMagGen";
|
||||||
import { ItemHelper } from "../../../helpers/ItemHelper";
|
import { InventoryMagGen } from "@spt-aki/generators/weapongen/InventoryMagGen";
|
||||||
import { ILogger } from "../../../models/spt/utils/ILogger";
|
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper";
|
||||||
import { LocalisationService } from "../../../services/LocalisationService";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { IInventoryMagGen } from "../IInventoryMagGen";
|
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||||
import { InventoryMagGen } from "../InventoryMagGen";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
export declare class ExternalInventoryMagGen implements IInventoryMagGen {
|
export declare class ExternalInventoryMagGen implements IInventoryMagGen {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
||||||
constructor(logger: ILogger, itemHelper: ItemHelper, localisationService: LocalisationService, botWeaponGeneratorHelper: BotWeaponGeneratorHelper);
|
protected randomUtil: RandomUtil;
|
||||||
|
constructor(logger: ILogger, itemHelper: ItemHelper, localisationService: LocalisationService, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, randomUtil: RandomUtil);
|
||||||
getPriority(): number;
|
getPriority(): number;
|
||||||
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
|
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
|
||||||
process(inventoryMagGen: InventoryMagGen): void;
|
process(inventoryMagGen: InventoryMagGen): void;
|
||||||
|
/**
|
||||||
|
* Get a random compatible external magazine for a weapon, exclude internal magazines from possible pool
|
||||||
|
* @param weaponTpl Weapon to get mag for
|
||||||
|
* @returns tpl of magazine
|
||||||
|
*/
|
||||||
|
protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper";
|
import { IInventoryMagGen } from "@spt-aki/generators/weapongen/IInventoryMagGen";
|
||||||
import { IInventoryMagGen } from "../IInventoryMagGen";
|
import { InventoryMagGen } from "@spt-aki/generators/weapongen/InventoryMagGen";
|
||||||
import { InventoryMagGen } from "../InventoryMagGen";
|
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper";
|
||||||
export declare class InternalMagazineInventoryMagGen implements IInventoryMagGen {
|
export declare class InternalMagazineInventoryMagGen implements IInventoryMagGen {
|
||||||
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
||||||
constructor(botWeaponGeneratorHelper: BotWeaponGeneratorHelper);
|
constructor(botWeaponGeneratorHelper: BotWeaponGeneratorHelper);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper";
|
import { IInventoryMagGen } from "@spt-aki/generators/weapongen/IInventoryMagGen";
|
||||||
import { IInventoryMagGen } from "../IInventoryMagGen";
|
import { InventoryMagGen } from "@spt-aki/generators/weapongen/InventoryMagGen";
|
||||||
import { InventoryMagGen } from "../InventoryMagGen";
|
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper";
|
||||||
export declare class UbglExternalMagGen implements IInventoryMagGen {
|
export declare class UbglExternalMagGen implements IInventoryMagGen {
|
||||||
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
||||||
constructor(botWeaponGeneratorHelper: BotWeaponGeneratorHelper);
|
constructor(botWeaponGeneratorHelper: BotWeaponGeneratorHelper);
|
||||||
|
39
types/helpers/AssortHelper.d.ts
vendored
39
types/helpers/AssortHelper.d.ts
vendored
@ -1,10 +1,11 @@
|
|||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { ITraderAssort } from "../models/eft/common/tables/ITrader";
|
import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { QuestStatus } from "@spt-aki/models/enums/QuestStatus";
|
||||||
import { ItemHelper } from "./ItemHelper";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { QuestHelper } from "./QuestHelper";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
export declare class AssortHelper {
|
export declare class AssortHelper {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
@ -13,14 +14,24 @@ export declare class AssortHelper {
|
|||||||
protected questHelper: QuestHelper;
|
protected questHelper: QuestHelper;
|
||||||
constructor(logger: ILogger, itemHelper: ItemHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, questHelper: QuestHelper);
|
constructor(logger: ILogger, itemHelper: ItemHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, questHelper: QuestHelper);
|
||||||
/**
|
/**
|
||||||
* Remove assorts from a trader that have not been unlocked yet
|
* Remove assorts from a trader that have not been unlocked yet (via player completing corresponding quest)
|
||||||
* @param pmcProfile player profile
|
* @param pmcProfile Player profile
|
||||||
* @param traderId traders id
|
* @param traderId Traders id the assort belongs to
|
||||||
* @param assort assort items from a trader
|
* @param traderAssorts All assort items from same trader
|
||||||
* @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders
|
* @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders (key = started/failed/complete)
|
||||||
* @returns assort items minus locked quest assorts
|
* @returns Assort items minus locked quest assorts
|
||||||
*/
|
*/
|
||||||
stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record<string, Record<string, string>>, flea?: boolean): ITraderAssort;
|
stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record<string, Record<string, string>>, flea?: boolean): ITraderAssort;
|
||||||
|
/**
|
||||||
|
* Get a quest id + the statuses quest can be in to unlock assort
|
||||||
|
* @param mergedQuestAssorts quest assorts to search for assort id
|
||||||
|
* @param assortId Assort to look for linked quest id
|
||||||
|
* @returns quest id + array of quest status the assort should show for
|
||||||
|
*/
|
||||||
|
protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record<string, Record<string, string>>, assortId: string): {
|
||||||
|
questId: string;
|
||||||
|
status: QuestStatus[];
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* Remove assorts from a trader that have not been unlocked yet
|
* Remove assorts from a trader that have not been unlocked yet
|
||||||
* @param pmcProfile player profile
|
* @param pmcProfile player profile
|
||||||
|
20
types/helpers/BotDifficultyHelper.d.ts
vendored
20
types/helpers/BotDifficultyHelper.d.ts
vendored
@ -1,12 +1,12 @@
|
|||||||
import { Difficulty } from "../models/eft/common/tables/IBotType";
|
import { BotHelper } from "@spt-aki/helpers/BotHelper";
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { Difficulty } from "@spt-aki/models/eft/common/tables/IBotType";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
import { BotHelper } from "./BotHelper";
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
export declare class BotDifficultyHelper {
|
export declare class BotDifficultyHelper {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
@ -15,7 +15,7 @@ export declare class BotDifficultyHelper {
|
|||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected botHelper: BotHelper;
|
protected botHelper: BotHelper;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected botConfig: IBotConfig;
|
protected pmcConfig: IPmcConfig;
|
||||||
constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer);
|
constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer);
|
||||||
getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
|
getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
|
||||||
/**
|
/**
|
||||||
|
44
types/helpers/BotGeneratorHelper.d.ts
vendored
44
types/helpers/BotGeneratorHelper.d.ts
vendored
@ -1,24 +1,29 @@
|
|||||||
import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper";
|
import { ApplicationContext } from "@spt-aki/context/ApplicationContext";
|
||||||
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
|
import { DurabilityLimitsHelper } from "@spt-aki/helpers/DurabilityLimitsHelper";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig";
|
import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IChooseRandomCompatibleModResult } from "@spt-aki/models/spt/bots/IChooseRandomCompatibleModResult";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt-aki/models/spt/config/IBotConfig";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { ItemHelper } from "./ItemHelper";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
export declare class BotGeneratorHelper {
|
export declare class BotGeneratorHelper {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected durabilityLimitsHelper: DurabilityLimitsHelper;
|
protected durabilityLimitsHelper: DurabilityLimitsHelper;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
|
protected applicationContext: ApplicationContext;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, localisationService: LocalisationService, configServer: ConfigServer);
|
protected pmcConfig: IPmcConfig;
|
||||||
|
constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Adds properties to an item
|
* Adds properties to an item
|
||||||
* e.g. Repairable / HasHinge / Foldable / MaxDurability
|
* e.g. Repairable / HasHinge / Foldable / MaxDurability
|
||||||
@ -29,6 +34,13 @@ export declare class BotGeneratorHelper {
|
|||||||
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): {
|
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): {
|
||||||
upd?: Upd;
|
upd?: Upd;
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* Randomize the HpResource for bots e.g (245/400 resources)
|
||||||
|
* @param maxResource Max resource value of medical items
|
||||||
|
* @param randomizationValues Value provided from config
|
||||||
|
* @returns Randomized value from maxHpResource
|
||||||
|
*/
|
||||||
|
protected getRandomizedResourceValue(maxResource: number, randomizationValues: IRandomisedResourceValues): number;
|
||||||
/**
|
/**
|
||||||
* Get the chance for the weapon attachment or helmet equipment to be set as activated
|
* Get the chance for the weapon attachment or helmet equipment to be set as activated
|
||||||
* @param botRole role of bot with weapon/helmet
|
* @param botRole role of bot with weapon/helmet
|
||||||
@ -51,17 +63,15 @@ export declare class BotGeneratorHelper {
|
|||||||
* @returns Repairable object
|
* @returns Repairable object
|
||||||
*/
|
*/
|
||||||
protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable;
|
protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable;
|
||||||
|
isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult;
|
||||||
/**
|
/**
|
||||||
* Can item be added to another item without conflict
|
* Can item be added to another item without conflict
|
||||||
* @param items Items to check compatibilities with
|
* @param itemsEquipped Items to check compatibilities with
|
||||||
* @param tplToCheck Tpl of the item to check for incompatibilities
|
* @param tplToCheck Tpl of the item to check for incompatibilities
|
||||||
* @param equipmentSlot Slot the item will be placed into
|
* @param equipmentSlot Slot the item will be placed into
|
||||||
* @returns false if no incompatibilities, also has incompatibility reason
|
* @returns false if no incompatibilities, also has incompatibility reason
|
||||||
*/
|
*/
|
||||||
isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): {
|
isItemIncompatibleWithCurrentItems(itemsEquipped: Item[], tplToCheck: string, equipmentSlot: string): IChooseRandomCompatibleModResult;
|
||||||
incompatible: boolean;
|
|
||||||
reason: string;
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* Convert a bots role to the equipment role used in config/bot.json
|
* Convert a bots role to the equipment role used in config/bot.json
|
||||||
* @param botRole Role to convert
|
* @param botRole Role to convert
|
||||||
|
22
types/helpers/BotHelper.d.ts
vendored
22
types/helpers/BotHelper.d.ts
vendored
@ -1,12 +1,13 @@
|
|||||||
import { MinMax } from "../models/common/MinMax";
|
import { MinMax } from "@spt-aki/models/common/MinMax";
|
||||||
import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType";
|
import { Difficulty, IBotType } from "@spt-aki/models/eft/common/tables/IBotType";
|
||||||
import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
|
import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt-aki/models/spt/config/IBotConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
export declare class BotHelper {
|
export declare class BotHelper {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
@ -15,6 +16,7 @@ export declare class BotHelper {
|
|||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
|
protected pmcConfig: IPmcConfig;
|
||||||
constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer);
|
constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Get a template object for the specified botRole from bots.types db
|
* Get a template object for the specified botRole from bots.types db
|
||||||
@ -70,7 +72,7 @@ export declare class BotHelper {
|
|||||||
*/
|
*/
|
||||||
getBotRandomizationDetails(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
|
* Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec
|
||||||
* @returns pmc role
|
* @returns pmc role
|
||||||
*/
|
*/
|
||||||
getRandomizedPmcRole(): string;
|
getRandomizedPmcRole(): string;
|
||||||
|
63
types/helpers/BotWeaponGeneratorHelper.d.ts
vendored
63
types/helpers/BotWeaponGeneratorHelper.d.ts
vendored
@ -1,16 +1,18 @@
|
|||||||
import { MinMax } from "../models/common/MinMax";
|
import { ContainerHelper } from "@spt-aki/helpers/ContainerHelper";
|
||||||
import { Inventory } from "../models/eft/common/tables/IBotBase";
|
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
|
||||||
import { EquipmentSlots } from "../models/enums/EquipmentSlots";
|
import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { GenerationData } from "@spt-aki/models/eft/common/tables/IBotType";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { Grid, ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { EquipmentSlots } from "@spt-aki/models/enums/EquipmentSlots";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { ItemAddedResult } from "@spt-aki/models/enums/ItemAddedResult";
|
||||||
import { ContainerHelper } from "./ContainerHelper";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { InventoryHelper } from "./InventoryHelper";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { ItemHelper } from "./ItemHelper";
|
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
|
||||||
export declare class BotWeaponGeneratorHelper {
|
export declare class BotWeaponGeneratorHelper {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
@ -18,22 +20,23 @@ export declare class BotWeaponGeneratorHelper {
|
|||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected inventoryHelper: InventoryHelper;
|
protected inventoryHelper: InventoryHelper;
|
||||||
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected containerHelper: ContainerHelper;
|
protected containerHelper: ContainerHelper;
|
||||||
constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper);
|
constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper);
|
||||||
/**
|
/**
|
||||||
* Get a randomized 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 magCounts Weights of magazines
|
||||||
* @param magTemplate magazine to generate bullet count for
|
* @param magTemplate magazine to generate bullet count for
|
||||||
* @returns bullet count number
|
* @returns bullet count number
|
||||||
*/
|
*/
|
||||||
getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number;
|
getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number;
|
||||||
/**
|
/**
|
||||||
* Get a randomized count of magazines
|
* Get a randomized count of magazines
|
||||||
* @param magCounts min and max value returned value can be between
|
* @param magCounts min and max value returned value can be between
|
||||||
* @returns numerical value of magazine count
|
* @returns numerical value of magazine count
|
||||||
*/
|
*/
|
||||||
getRandomizedMagazineCount(magCounts: MinMax): number;
|
getRandomizedMagazineCount(magCounts: GenerationData): number;
|
||||||
/**
|
/**
|
||||||
* Is this magazine cylinder related (revolvers and grenade launchers)
|
* Is this magazine cylinder related (revolvers and grenade launchers)
|
||||||
* @param magazineParentName the name of the magazines parent
|
* @param magazineParentName the name of the magazines parent
|
||||||
@ -47,7 +50,7 @@ export declare class BotWeaponGeneratorHelper {
|
|||||||
* @param magTemplate template object of magazine
|
* @param magTemplate template object of magazine
|
||||||
* @returns Item array
|
* @returns Item array
|
||||||
*/
|
*/
|
||||||
createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[];
|
createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[];
|
||||||
/**
|
/**
|
||||||
* Add a specific number of cartridges to a bots inventory (defaults to vest and pockets)
|
* 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 ammoTpl Ammo tpl to add to vest/pockets
|
||||||
@ -65,19 +68,19 @@ export declare class BotWeaponGeneratorHelper {
|
|||||||
/**
|
/**
|
||||||
* TODO - move into BotGeneratorHelper, this is not the class for it
|
* TODO - move into BotGeneratorHelper, this is not the class for it
|
||||||
* Adds an item with all its children into specified equipmentSlots, wherever it fits.
|
* Adds an item with all its children into specified equipmentSlots, wherever it fits.
|
||||||
* @param equipmentSlots
|
* @param equipmentSlots Slot to add item+children into
|
||||||
* @param parentId
|
* @param rootItemId Root item id to use as mod items parentid
|
||||||
* @param parentTpl
|
* @param rootItemTplId Root itms tpl id
|
||||||
* @param itemWithChildren
|
* @param itemWithChildren Item to add
|
||||||
* @param inventory
|
* @param inventory Inventory to add item+children into
|
||||||
* @returns a `boolean` indicating item was added
|
* @returns ItemAddedResult result object
|
||||||
*/
|
*/
|
||||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): boolean;
|
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult;
|
||||||
/**
|
/**
|
||||||
* is the provided item allowed inside a container
|
* Is the provided item allowed inside a container
|
||||||
* @param slot location item wants to be placed in
|
* @param slotGrid Items sub-grid we want to place item inside
|
||||||
* @param itemTpl item being placed
|
* @param itemTpl Item tpl being placed
|
||||||
* @returns true if allowed
|
* @returns True if allowed
|
||||||
*/
|
*/
|
||||||
protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean;
|
protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean;
|
||||||
}
|
}
|
||||||
|
31
types/helpers/ContainerHelper.d.ts
vendored
31
types/helpers/ContainerHelper.d.ts
vendored
@ -6,7 +6,34 @@ export declare class FindSlotResult {
|
|||||||
constructor(success?: boolean, x?: any, y?: any, rotation?: boolean);
|
constructor(success?: boolean, x?: any, y?: any, rotation?: boolean);
|
||||||
}
|
}
|
||||||
export declare class ContainerHelper {
|
export declare class ContainerHelper {
|
||||||
protected locateSlot(container2D: number[][], containerX: number, containerY: number, x: number, y: number, itemW: number, itemH: number): boolean;
|
/**
|
||||||
|
* Finds a slot for an item in a given 2D container map
|
||||||
|
* @param container2D Array of container with slots filled/free
|
||||||
|
* @param itemWidth Width of item
|
||||||
|
* @param itemHeight Height of item
|
||||||
|
* @returns Location to place item in container
|
||||||
|
*/
|
||||||
findSlotForItem(container2D: number[][], itemWidth: number, itemHeight: number): FindSlotResult;
|
findSlotForItem(container2D: number[][], itemWidth: number, itemHeight: number): FindSlotResult;
|
||||||
fillContainerMapWithItem(container2D: number[][], x: number, y: number, itemW: number, itemH: number, rotate: boolean): any;
|
/**
|
||||||
|
* Find a slot inside a container an item can be placed in
|
||||||
|
* @param container2D Container to find space in
|
||||||
|
* @param containerX Container x size
|
||||||
|
* @param containerY Container y size
|
||||||
|
* @param x ???
|
||||||
|
* @param y ???
|
||||||
|
* @param itemW Items width
|
||||||
|
* @param itemH Items height
|
||||||
|
* @returns True - slot found
|
||||||
|
*/
|
||||||
|
protected locateSlot(container2D: number[][], containerX: number, containerY: number, x: number, y: number, itemW: number, itemH: number): boolean;
|
||||||
|
/**
|
||||||
|
* Find a free slot for an item to be placed at
|
||||||
|
* @param container2D Container to place item in
|
||||||
|
* @param x Container x size
|
||||||
|
* @param y Container y size
|
||||||
|
* @param itemW Items width
|
||||||
|
* @param itemH Items height
|
||||||
|
* @param rotate is item rotated
|
||||||
|
*/
|
||||||
|
fillContainerMapWithItem(container2D: number[][], x: number, y: number, itemW: number, itemH: number, rotate: boolean): void;
|
||||||
}
|
}
|
||||||
|
8
types/helpers/Dialogue/Commando/ICommandoCommand.d.ts
vendored
Normal file
8
types/helpers/Dialogue/Commando/ICommandoCommand.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||||
|
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
|
export interface ICommandoCommand {
|
||||||
|
getCommandPrefix(): string;
|
||||||
|
getCommandHelp(command: string): string;
|
||||||
|
getCommands(): Set<string>;
|
||||||
|
handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||||
|
}
|
15
types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts
vendored
Normal file
15
types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand";
|
||||||
|
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||||
|
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||||
|
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
|
export declare class SptCommandoCommands implements ICommandoCommand {
|
||||||
|
protected configServer: ConfigServer;
|
||||||
|
protected sptCommands: ISptCommand[];
|
||||||
|
constructor(configServer: ConfigServer, sptCommands: ISptCommand[]);
|
||||||
|
registerSptCommandoCommand(command: ISptCommand): void;
|
||||||
|
getCommandHelp(command: string): string;
|
||||||
|
getCommandPrefix(): string;
|
||||||
|
getCommands(): Set<string>;
|
||||||
|
handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||||
|
}
|
21
types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts
vendored
Normal file
21
types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||||
|
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||||
|
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||||
|
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||||
|
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
|
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||||
|
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||||
|
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||||
|
export declare class GiveSptCommand implements ISptCommand {
|
||||||
|
protected logger: ILogger;
|
||||||
|
protected itemHelper: ItemHelper;
|
||||||
|
protected hashUtil: HashUtil;
|
||||||
|
protected jsonUtil: JsonUtil;
|
||||||
|
protected presetHelper: PresetHelper;
|
||||||
|
protected mailSendService: MailSendService;
|
||||||
|
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService);
|
||||||
|
getCommand(): string;
|
||||||
|
getCommandHelp(): string;
|
||||||
|
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user