Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
ab4cc9ce36 | |||
c39472066d | |||
9a3706d0a3 | |||
5b68c471e9 | |||
948f63c111 | |||
46be556143 |
@ -37,6 +37,41 @@
|
||||
{
|
||||
"description": "Throwables",
|
||||
"id": "5b5f7a2386f774093f2ed3c4"
|
||||
},
|
||||
{
|
||||
"description": "Armor vests",
|
||||
"id": "5b5f701386f774093f2ecf0f"
|
||||
},
|
||||
{
|
||||
"description": "Backpacks",
|
||||
"id": "5b5f6f6c86f774093f2ecf0b",
|
||||
"forceCustomBackgroundColours": true,
|
||||
"useSlotsBasedBackgroundColours": true
|
||||
},
|
||||
{
|
||||
"description": "Facecovers",
|
||||
"id": "5b47574386f77428ca22b32f"
|
||||
},
|
||||
{
|
||||
"description": "Gear components",
|
||||
"id": "5b5f704686f77447ec5d76d7"
|
||||
},
|
||||
{
|
||||
"description": "Headsets",
|
||||
"id": "5b5f6f3c86f774094242ef87"
|
||||
},
|
||||
{
|
||||
"description": "Headwear & helmets",
|
||||
"id": "5b47574386f77428ca22b330"
|
||||
},
|
||||
{
|
||||
"description": "Tactical rigs",
|
||||
"id": "5b5f6f8786f77447ed563642",
|
||||
"useSlotsBasedBackgroundColours": false
|
||||
},
|
||||
{
|
||||
"description": "Visors",
|
||||
"id": "5b47574386f77428ca22b331"
|
||||
}
|
||||
]
|
||||
}
|
32
config.json
32
config.json
@ -75,5 +75,37 @@
|
||||
"maxValue": 100000000,
|
||||
"colour": "violet"
|
||||
}
|
||||
],
|
||||
"inventorySlotBackgroundColours": [
|
||||
{
|
||||
"minValue": 0,
|
||||
"maxValue": 12,
|
||||
"colour": "orange"
|
||||
},
|
||||
{
|
||||
"minValue": 13,
|
||||
"maxValue": 19,
|
||||
"colour": "red"
|
||||
},
|
||||
{
|
||||
"minValue": 20,
|
||||
"maxValue": 29,
|
||||
"colour": "yellow"
|
||||
},
|
||||
{
|
||||
"minValue": 30,
|
||||
"maxValue": 34,
|
||||
"colour": "green"
|
||||
},
|
||||
{
|
||||
"minValue": 35,
|
||||
"maxValue": 39,
|
||||
"colour": "blue"
|
||||
},
|
||||
{
|
||||
"minValue": 40,
|
||||
"maxValue": 999,
|
||||
"colour": "violet"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "EyesOfATrader",
|
||||
"version": "1.2.1",
|
||||
"name": "Eyes Of A Trader",
|
||||
"version": "1.3.1",
|
||||
"main": "src/mod.js",
|
||||
"license": "MIT",
|
||||
"license": "GPLv3",
|
||||
"author": "Platinum",
|
||||
"akiVersion": "3.5.0",
|
||||
"akiVersion": "3.7.*",
|
||||
"scripts": {
|
||||
"setup": "npm i",
|
||||
"build": "node ./packageBuild.ts"
|
||||
|
85
src/mod.ts
85
src/mod.ts
@ -23,10 +23,11 @@ import { ILocaleBase } from "@spt-aki/models/spt/server/ILocaleBase";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { Category, HandbookItem } from "@spt-aki/models/eft/common/tables/IHandbookBase";
|
||||
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
||||
import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables";
|
||||
|
||||
import config from "../config.json";
|
||||
import categoryConfig from "../categories.json";
|
||||
import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables";
|
||||
import { Props } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||
|
||||
class EyesOfATraderMod implements IPostDBLoadMod {
|
||||
private logger: ILogger;
|
||||
@ -35,8 +36,7 @@ class EyesOfATraderMod implements IPostDBLoadMod {
|
||||
private modName = "[Eyes of a Trader]";
|
||||
|
||||
// We want to cache all (sub)categories of the Handbook that we have enabled our mod for otherwise we'll recursively search thousands of times.
|
||||
private enabledCategories: Category[] = [];
|
||||
private enabledCategoriesWithoutCustomBackground: Category[] = [];
|
||||
private categoryConfigs: CategoryConfig[] = [];
|
||||
|
||||
public postDBLoad(container: DependencyContainer): void {
|
||||
this.container = container;
|
||||
@ -65,7 +65,10 @@ class EyesOfATraderMod implements IPostDBLoadMod {
|
||||
const itemProps = item._props;
|
||||
const isValidItem = itemProps.Name && itemProps.Name !== "Dog tag" && !itemProps.QuestItem;
|
||||
|
||||
if (this.isCategoryEnabled(handbookItem) && isValidItem) {
|
||||
// If a categoryConfig exists for this handbook item, it means we want to display prices for this item!
|
||||
const categoryConfig = this.categoryConfigs.find(category => category.id === handbookItem.ParentId);
|
||||
|
||||
if (categoryConfig && isValidItem) {
|
||||
const pricing = new Pricing(
|
||||
this.getApproxTraderPrice(handbookItems, itemId),
|
||||
this.getApproxFleaPrice(itemId),
|
||||
@ -74,10 +77,18 @@ class EyesOfATraderMod implements IPostDBLoadMod {
|
||||
|
||||
pricingMap.set(itemId, pricing);
|
||||
|
||||
// Disables custom background colours if disabled globally or per category.
|
||||
if (config.useCustomBackgroundColours && !this.enabledCategoriesWithoutCustomBackground.some(category => category.Id === handbookItem.ParentId)) {
|
||||
const customColour = this.getCustomBackgroundColour(pricing);
|
||||
if (customColour && (config.updateVioletItemBackground || itemProps.BackgroundColor !== "violet")) {
|
||||
// Display custom background colours if forced via category configs or
|
||||
// Disable custom background colours if disabled globally or per category.
|
||||
if (
|
||||
categoryConfig.forceCustomBackgroundColours ||
|
||||
config.useCustomBackgroundColours &&
|
||||
!categoryConfig.disableCustomBackgroundColours
|
||||
) {
|
||||
const customColour = categoryConfig.useSlotsBasedBackgroundColours
|
||||
? this.getCustomBackgroundColourBasedOnInventorySlots(itemProps)
|
||||
: this.getCustomBackgroundColourBasedOnPrice(pricing);
|
||||
|
||||
if (customColour && (categoryConfig.forceCustomBackgroundColours || config.updateVioletItemBackground || itemProps.BackgroundColor !== "violet")) {
|
||||
itemProps.BackgroundColor = customColour;
|
||||
}
|
||||
}
|
||||
@ -90,37 +101,31 @@ class EyesOfATraderMod implements IPostDBLoadMod {
|
||||
}
|
||||
|
||||
private cacheEnabledCategories(handbookCategories: Category[]): void {
|
||||
if (this.enabledCategories.length === 0) {
|
||||
categoryConfig.enabledCategories.forEach(categoryConfig => {
|
||||
if (this.categoryConfigs.length === 0) {
|
||||
categoryConfig.enabledCategories.forEach((categoryConfig: CategoryConfig) => {
|
||||
// We gotta add the parent categories first
|
||||
const handbookCategory = handbookCategories.find(category => category.Id === categoryConfig.id);
|
||||
this.categoryConfigs.push(categoryConfig);
|
||||
|
||||
if (categoryConfig.disableCustomBackgroundColours) {
|
||||
this.enabledCategoriesWithoutCustomBackground.push(handbookCategory);
|
||||
}
|
||||
this.enabledCategories.push(handbookCategory)
|
||||
|
||||
this.addSubCategoriesRecursively(handbookCategories, categoryConfig.id, categoryConfig.disableCustomBackgroundColours)
|
||||
this.addSubCategoriesRecursively(handbookCategories, categoryConfig)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private addSubCategoriesRecursively(allCategories: Category[], categoryId: string, disableCustomBackgroundColours = false): void {
|
||||
const subCategories = allCategories.filter(category => category.ParentId === categoryId);
|
||||
private addSubCategoriesRecursively(allCategories: Category[], categoryConfig: CategoryConfig): void {
|
||||
const subCategories = allCategories.filter(category => category.ParentId === categoryConfig.id);
|
||||
if (subCategories.length) {
|
||||
if (disableCustomBackgroundColours) {
|
||||
this.enabledCategoriesWithoutCustomBackground = this.enabledCategoriesWithoutCustomBackground.concat(subCategories);
|
||||
}
|
||||
this.enabledCategories = this.enabledCategories.concat(subCategories);
|
||||
const subCategoryConfigs = subCategories.map((subCategory): CategoryConfig => ({
|
||||
id: subCategory.Id,
|
||||
disableCustomBackgroundColours: categoryConfig.disableCustomBackgroundColours,
|
||||
forceCustomBackgroundColours: categoryConfig.forceCustomBackgroundColours,
|
||||
useSlotsBasedBackgroundColours: categoryConfig.useSlotsBasedBackgroundColours
|
||||
}));
|
||||
this.categoryConfigs = this.categoryConfigs.concat(subCategoryConfigs);
|
||||
|
||||
subCategories.forEach(category => this.addSubCategoriesRecursively(allCategories, category.Id, disableCustomBackgroundColours));
|
||||
subCategoryConfigs.forEach(categoryConfig => this.addSubCategoriesRecursively(allCategories, categoryConfig));
|
||||
}
|
||||
}
|
||||
|
||||
private isCategoryEnabled(handbookItem: HandbookItem): boolean {
|
||||
return this.enabledCategories.some(category => category.Id === handbookItem.ParentId);
|
||||
}
|
||||
|
||||
private getApproxTraderPrice(handbookItems: HandbookItem[], itemId: string): number {
|
||||
const fullPrice = handbookItems.find(item => item.Id === itemId)?.Price;
|
||||
if (!fullPrice) {
|
||||
@ -132,12 +137,24 @@ class EyesOfATraderMod implements IPostDBLoadMod {
|
||||
|
||||
private getApproxFleaPrice(itemId: string): number {
|
||||
const ragfairService = this.container.resolve<RagfairPriceService>("RagfairPriceService");
|
||||
// This seems to be the AVG EST flea price ingame.
|
||||
const dynamicPrice = ragfairService.getDynamicPriceForItem(itemId);
|
||||
return dynamicPrice * config.fleaPriceMultiplier;
|
||||
}
|
||||
|
||||
private getCustomBackgroundColour({ perSlotTraderPrice, perSlotFleaPrice, traderPrice, fleaPrice }: Pricing): string {
|
||||
private getCustomBackgroundColourBasedOnInventorySlots({ Grids }: Props): string {
|
||||
const totalSlots = Grids.reduce((totalSlots, grid) => {
|
||||
const horizontal = grid._props.cellsH;
|
||||
const vertical = grid._props.cellsV;
|
||||
const slots = horizontal * vertical;
|
||||
|
||||
return totalSlots += slots;
|
||||
}, 0);
|
||||
|
||||
const colourConfig = config.inventorySlotBackgroundColours.find(({ minValue, maxValue }) => totalSlots >= minValue && totalSlots <= maxValue);
|
||||
return colourConfig?.colour;
|
||||
}
|
||||
|
||||
private getCustomBackgroundColourBasedOnPrice({ perSlotTraderPrice, perSlotFleaPrice, traderPrice, fleaPrice }: Pricing): string {
|
||||
const { usePerSlotPricingForBackgrounds, useFleaPricesForBackground, fleaValueBackgroundColours, traderValueBackgroundColours, autoUseFleaPricing } = config;
|
||||
const overrideWithFleaPrice = autoUseFleaPricing.enabled && (perSlotFleaPrice / perSlotTraderPrice) > autoUseFleaPricing.fleaToTraderValueThresholdRatio;
|
||||
const useFleaPrices = useFleaPricesForBackground || overrideWithFleaPrice;
|
||||
@ -194,4 +211,12 @@ class Pricing {
|
||||
}
|
||||
}
|
||||
|
||||
interface CategoryConfig {
|
||||
id: string;
|
||||
description?: string;
|
||||
disableCustomBackgroundColours?: boolean;
|
||||
forceCustomBackgroundColours?: boolean;
|
||||
useSlotsBasedBackgroundColours?: boolean;
|
||||
}
|
||||
|
||||
module.exports = { mod: new EyesOfATraderMod() };
|
||||
|
1
types/callbacks/BotCallbacks.d.ts
vendored
1
types/callbacks/BotCallbacks.d.ts
vendored
@ -10,6 +10,7 @@ export declare class BotCallbacks {
|
||||
constructor(botController: BotController, httpResponse: HttpResponseUtil);
|
||||
/**
|
||||
* Handle singleplayer/settings/bot/limit
|
||||
* Is called by client to define each bot roles wave limit
|
||||
* @returns string
|
||||
*/
|
||||
getBotLimit(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||
|
3
types/callbacks/BundleCallbacks.d.ts
vendored
3
types/callbacks/BundleCallbacks.d.ts
vendored
@ -13,6 +13,9 @@ export declare class BundleCallbacks {
|
||||
protected httpConfig: IHttpConfig;
|
||||
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer);
|
||||
sendBundle(sessionID: string, req: any, resp: any, body: any): any;
|
||||
/**
|
||||
* Handle singleplayer/bundles
|
||||
*/
|
||||
getBundles(url: string, info: any, sessionID: string): string;
|
||||
getBundle(url: string, info: any, sessionID: string): string;
|
||||
}
|
||||
|
12
types/callbacks/CustomizationCallbacks.d.ts
vendored
12
types/callbacks/CustomizationCallbacks.d.ts
vendored
@ -15,15 +15,21 @@ export declare class CustomizationCallbacks {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
constructor(customizationController: CustomizationController, saveServer: SaveServer, httpResponse: HttpResponseUtil);
|
||||
/**
|
||||
* Handles client/trading/customization/storage
|
||||
* @returns
|
||||
* Handle client/trading/customization/storage
|
||||
* @returns IGetSuitsResponse
|
||||
*/
|
||||
getSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetSuitsResponse>;
|
||||
/**
|
||||
* Handles client/trading/customization
|
||||
* Handle client/trading/customization
|
||||
* @returns ISuit[]
|
||||
*/
|
||||
getTraderSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISuit[]>;
|
||||
/**
|
||||
* Handle CustomizationWear event
|
||||
*/
|
||||
wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle CustomizationBuy event
|
||||
*/
|
||||
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
||||
|
27
types/callbacks/DataCallbacks.d.ts
vendored
27
types/callbacks/DataCallbacks.d.ts
vendored
@ -4,7 +4,6 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IGlobals } from "../models/eft/common/IGlobals";
|
||||
import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem";
|
||||
import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase";
|
||||
import { IQuest } from "../models/eft/common/tables/IQuest";
|
||||
import { IGetItemPricesResponse } from "../models/eft/game/IGetItemPricesResponse";
|
||||
import { IHideoutArea } from "../models/eft/hideout/IHideoutArea";
|
||||
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
|
||||
@ -24,42 +23,54 @@ export declare class DataCallbacks {
|
||||
protected hideoutController: HideoutController;
|
||||
constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController);
|
||||
/**
|
||||
* Handles client/settings
|
||||
* Handle client/settings
|
||||
* @returns ISettingsBase
|
||||
*/
|
||||
getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISettingsBase>;
|
||||
/**
|
||||
* Handles client/globals
|
||||
* Handle client/globals
|
||||
* @returns IGlobals
|
||||
*/
|
||||
getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGlobals>;
|
||||
/**
|
||||
* Handles client/items
|
||||
* Handle client/items
|
||||
* @returns string
|
||||
*/
|
||||
getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||
/**
|
||||
* Handles client/handbook/templates
|
||||
* Handle client/handbook/templates
|
||||
* @returns IHandbookBase
|
||||
*/
|
||||
getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHandbookBase>;
|
||||
/**
|
||||
* Handles client/customization
|
||||
* Handle client/customization
|
||||
* @returns Record<string, ICustomizationItem
|
||||
*/
|
||||
getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, ICustomizationItem>>;
|
||||
/**
|
||||
* Handles client/account/customization
|
||||
* Handle client/account/customization
|
||||
* @returns 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>;
|
||||
getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutArea[]>;
|
||||
gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutProduction[]>;
|
||||
getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutScavCase[]>;
|
||||
/**
|
||||
* Handle client/languages
|
||||
*/
|
||||
getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, string>>;
|
||||
/**
|
||||
* Handle client/menu/locale
|
||||
*/
|
||||
getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
||||
/**
|
||||
* Handle client/locale
|
||||
*/
|
||||
getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||
/**
|
||||
* Handle client/hideout/qte/list
|
||||
|
52
types/callbacks/DialogueCallbacks.d.ts
vendored
52
types/callbacks/DialogueCallbacks.d.ts
vendored
@ -1,8 +1,12 @@
|
||||
import { DialogueController } from "../controllers/DialogueController";
|
||||
import { OnUpdate } from "../di/OnUpdate";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IAcceptFriendRequestData, ICancelFriendRequestData } from "../models/eft/dialog/IAcceptFriendRequestData";
|
||||
import { IChatServer } from "../models/eft/dialog/IChatServer";
|
||||
import { IClearMailMessageRequest } from "../models/eft/dialog/IClearMailMessageRequest";
|
||||
import { IDeleteFriendRequest } from "../models/eft/dialog/IDeleteFriendRequest";
|
||||
import { IFriendRequestData } from "../models/eft/dialog/IFriendRequestData";
|
||||
import { IFriendRequestSendResponse } from "../models/eft/dialog/IFriendRequestSendResponse";
|
||||
import { IGetAllAttachmentsRequestData } from "../models/eft/dialog/IGetAllAttachmentsRequestData";
|
||||
import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse";
|
||||
import { IGetChatServerListRequestData } from "../models/eft/dialog/IGetChatServerListRequestData";
|
||||
@ -13,6 +17,7 @@ import { IGetMailDialogViewRequestData } from "../models/eft/dialog/IGetMailDial
|
||||
import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDialogViewResponseData";
|
||||
import { IPinDialogRequestData } from "../models/eft/dialog/IPinDialogRequestData";
|
||||
import { IRemoveDialogRequestData } from "../models/eft/dialog/IRemoveDialogRequestData";
|
||||
import { IRemoveMailMessageRequest } from "../models/eft/dialog/IRemoveMailMessageRequest";
|
||||
import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest";
|
||||
import { ISetDialogReadRequestData } from "../models/eft/dialog/ISetDialogReadRequestData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
@ -28,31 +33,66 @@ export declare class DialogueCallbacks implements OnUpdate {
|
||||
protected dialogueController: DialogueController;
|
||||
constructor(hashUtil: HashUtil, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, dialogueController: DialogueController);
|
||||
/**
|
||||
* Handles client/friend/list
|
||||
* Handle client/friend/list
|
||||
* @returns IGetFriendListDataResponse
|
||||
*/
|
||||
getFriendList(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetFriendListDataResponse>;
|
||||
/**
|
||||
* Handles client/chatServer/list
|
||||
* @returns
|
||||
* Handle client/chatServer/list
|
||||
* @returns IChatServer[]
|
||||
*/
|
||||
getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData<IChatServer[]>;
|
||||
/** Handle client/mail/dialog/list */
|
||||
getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo[]>;
|
||||
/** Handle client/mail/dialog/view */
|
||||
getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData<IGetMailDialogViewResponseData>;
|
||||
/** Handle client/mail/dialog/info */
|
||||
getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo>;
|
||||
/** Handle client/mail/dialog/remove */
|
||||
removeDialog(url: string, info: IRemoveDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||
/** Handle client/mail/dialog/pin */
|
||||
pinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||
/** Handle client/mail/dialog/unpin */
|
||||
unpinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||
/** Handle client/mail/dialog/read */
|
||||
setRead(url: string, info: ISetDialogReadRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||
/**
|
||||
* Handles client/mail/dialog/getAllAttachments
|
||||
* Handle client/mail/dialog/getAllAttachments
|
||||
* @returns 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[]>;
|
||||
/**
|
||||
* Handle client/friend/request/list/inbox
|
||||
*/
|
||||
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): any;
|
||||
/** Handle client/friend/ignore/remove */
|
||||
unIgnoreFriend(url: string, request: {
|
||||
uid: string;
|
||||
}, sessionID: string): any;
|
||||
clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]>;
|
||||
removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]>;
|
||||
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
||||
getRoute(): string;
|
||||
}
|
||||
|
21
types/callbacks/GameCallbacks.d.ts
vendored
21
types/callbacks/GameCallbacks.d.ts
vendored
@ -1,6 +1,8 @@
|
||||
import { GameController } from "../controllers/GameController";
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
|
||||
import { ICurrentGroupResponse } from "../models/eft/game/ICurrentGroupResponse";
|
||||
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
|
||||
import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData";
|
||||
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
|
||||
@ -11,13 +13,17 @@ import { IServerDetails } from "../models/eft/game/IServerDetails";
|
||||
import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { Watermark } from "../utils/Watermark";
|
||||
declare class GameCallbacks {
|
||||
declare class GameCallbacks implements OnLoad {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected watermark: Watermark;
|
||||
protected saveServer: SaveServer;
|
||||
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
|
||||
* @returns INullResponseData
|
||||
@ -30,6 +36,7 @@ declare class GameCallbacks {
|
||||
gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameStartResponse>;
|
||||
/**
|
||||
* Handle client/game/logout
|
||||
* Save profiles on game close
|
||||
* @returns IGameLogoutResponseData
|
||||
*/
|
||||
gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameLogoutResponseData>;
|
||||
@ -38,7 +45,17 @@ declare class GameCallbacks {
|
||||
* @returns IGameConfigResponse
|
||||
*/
|
||||
getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData<IGameConfigResponse>;
|
||||
/**
|
||||
* Handle client/server/list
|
||||
*/
|
||||
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>;
|
||||
/**
|
||||
* Handle client/game/keepalive
|
||||
|
14
types/callbacks/HideoutCallbacks.d.ts
vendored
14
types/callbacks/HideoutCallbacks.d.ts
vendored
@ -23,11 +23,11 @@ export declare class HideoutCallbacks implements OnUpdate {
|
||||
constructor(hideoutController: HideoutController, // TODO: delay needed
|
||||
configServer: ConfigServer);
|
||||
/**
|
||||
* Handle HideoutUpgrade
|
||||
* Handle HideoutUpgrade event
|
||||
*/
|
||||
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutUpgradeComplete
|
||||
* Handle HideoutUpgradeComplete event
|
||||
*/
|
||||
upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
@ -35,19 +35,19 @@ export declare class HideoutCallbacks implements OnUpdate {
|
||||
*/
|
||||
putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutTakeItemsFromAreaSlots
|
||||
* Handle HideoutTakeItemsFromAreaSlots event
|
||||
*/
|
||||
takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutToggleArea
|
||||
* Handle HideoutToggleArea event
|
||||
*/
|
||||
toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutSingleProductionStart
|
||||
* Handle HideoutSingleProductionStart event
|
||||
*/
|
||||
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutScavCaseProductionStart
|
||||
* Handle HideoutScavCaseProductionStart event
|
||||
*/
|
||||
scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
@ -55,7 +55,7 @@ export declare class HideoutCallbacks implements OnUpdate {
|
||||
*/
|
||||
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutTakeProduction
|
||||
* Handle HideoutTakeProduction event
|
||||
*/
|
||||
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
|
1
types/callbacks/InraidCallbacks.d.ts
vendored
1
types/callbacks/InraidCallbacks.d.ts
vendored
@ -12,6 +12,7 @@ export declare class InraidCallbacks {
|
||||
constructor(inraidController: InraidController, httpResponse: HttpResponseUtil);
|
||||
/**
|
||||
* Handle client/location/getLocalloot
|
||||
* Store active map in profile + applicationContext
|
||||
* @param url
|
||||
* @param info register player request
|
||||
* @param sessionID Session id
|
||||
|
2
types/callbacks/InsuranceCallbacks.d.ts
vendored
2
types/callbacks/InsuranceCallbacks.d.ts
vendored
@ -23,7 +23,7 @@ export declare class InsuranceCallbacks implements OnUpdate {
|
||||
*/
|
||||
getInsuranceCost(url: string, info: IGetInsuranceCostRequestData, sessionID: string): IGetBodyResponseData<IGetInsuranceCostResponseData>;
|
||||
/**
|
||||
* Handle Insure
|
||||
* Handle Insure event
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
|
7
types/callbacks/InventoryCallbacks.d.ts
vendored
7
types/callbacks/InventoryCallbacks.d.ts
vendored
@ -21,21 +21,28 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout
|
||||
export declare class InventoryCallbacks {
|
||||
protected inventoryController: InventoryController;
|
||||
constructor(inventoryController: InventoryController);
|
||||
/** Handle Move event */
|
||||
moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle Remove event */
|
||||
removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle Split event */
|
||||
splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle Swap */
|
||||
swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle ReadEncyclopedia */
|
||||
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle ApplyInventoryChanges */
|
||||
sortInventory(pmcData: IPmcData, body: 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;
|
||||
/** Handle OpenRandomLootContainer */
|
||||
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
||||
|
2
types/callbacks/LauncherCallbacks.d.ts
vendored
2
types/callbacks/LauncherCallbacks.d.ts
vendored
@ -24,5 +24,7 @@ declare class LauncherCallbacks {
|
||||
ping(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||
removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string;
|
||||
getCompatibleTarkovVersion(): string;
|
||||
getLoadedServerMods(): string;
|
||||
getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string;
|
||||
}
|
||||
export { LauncherCallbacks };
|
||||
|
3
types/callbacks/LocationCallbacks.d.ts
vendored
3
types/callbacks/LocationCallbacks.d.ts
vendored
@ -9,7 +9,10 @@ export declare class LocationCallbacks {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected locationController: LocationController;
|
||||
constructor(httpResponse: HttpResponseUtil, locationController: LocationController);
|
||||
/** Handle client/locations */
|
||||
getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILocationsGenerateAllResponse>;
|
||||
/** Handle client/location/getLocalloot */
|
||||
getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData<ILocationBase>;
|
||||
/** Handle client/location/getAirdropLoot */
|
||||
getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||
}
|
||||
|
37
types/callbacks/MatchCallbacks.d.ts
vendored
37
types/callbacks/MatchCallbacks.d.ts
vendored
@ -3,6 +3,9 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
||||
import { IAcceptGroupInviteRequest } from "../models/eft/match/IAcceptGroupInviteRequest";
|
||||
import { IAcceptGroupInviteResponse } from "../models/eft/match/IAcceptGroupInviteResponse";
|
||||
import { ICancelGroupInviteRequest } from "../models/eft/match/ICancelGroupInviteRequest";
|
||||
import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData";
|
||||
import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData";
|
||||
import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData";
|
||||
@ -11,6 +14,9 @@ import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidCo
|
||||
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
|
||||
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
|
||||
import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData";
|
||||
import { IRemovePlayerFromGroupRequest } from "../models/eft/match/IRemovePlayerFromGroupRequest";
|
||||
import { ISendGroupInviteRequest } from "../models/eft/match/ISendGroupInviteRequest";
|
||||
import { ITransferGroupRequest } from "../models/eft/match/ITransferGroupRequest";
|
||||
import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
@ -21,26 +27,47 @@ export declare class MatchCallbacks {
|
||||
protected matchController: MatchController;
|
||||
protected databaseServer: DatabaseServer;
|
||||
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer);
|
||||
/** Handle client/match/updatePing */
|
||||
updatePing(url: string, info: IUpdatePingRequestData, 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;
|
||||
startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||
stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||
sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData;
|
||||
acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData;
|
||||
cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData;
|
||||
/** Handle client/match/group/invite/send */
|
||||
sendGroupInvite(url: string, info: ISendGroupInviteRequest, sessionID: string): IGetBodyResponseData<string>;
|
||||
/** 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;
|
||||
/** Handle raid/profile/list */
|
||||
getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
||||
serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any> | IGetBodyResponseData<true>;
|
||||
joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData<IJoinMatchResult[]>;
|
||||
serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/** 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>;
|
||||
/**
|
||||
* @deprecated - not called on raid start/end or game start/exit
|
||||
* Handle client/match/group/status
|
||||
* @returns
|
||||
*/
|
||||
getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||
/** Handle client/match/group/create */
|
||||
createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||
/** Handle client/match/group/delete */
|
||||
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;
|
||||
/** Handle client/raid/configuration */
|
||||
getRaidConfiguration(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData;
|
||||
}
|
||||
|
3
types/callbacks/NoteCallbacks.d.ts
vendored
3
types/callbacks/NoteCallbacks.d.ts
vendored
@ -5,7 +5,10 @@ import { INoteActionData } from "../models/eft/notes/INoteActionData";
|
||||
export declare class NoteCallbacks {
|
||||
protected noteController: NoteController;
|
||||
constructor(noteController: NoteController);
|
||||
/** Handle AddNote event */
|
||||
addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle EditNote event */
|
||||
editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle DeleteNote event */
|
||||
deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
||||
|
7
types/callbacks/NotifierCallbacks.d.ts
vendored
7
types/callbacks/NotifierCallbacks.d.ts
vendored
@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier";
|
||||
import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData";
|
||||
import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class NotifierCallbacks {
|
||||
protected httpServerHelper: HttpServerHelper;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
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
|
||||
* 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.
|
||||
*/
|
||||
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[]>;
|
||||
/** Handle client/notifier/channel/create */
|
||||
createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<INotifierChannel>;
|
||||
/**
|
||||
* Handle client/game/profile/select
|
||||
|
18
types/callbacks/PresetBuildCallbacks.d.ts
vendored
18
types/callbacks/PresetBuildCallbacks.d.ts
vendored
@ -4,13 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData";
|
||||
import { WeaponBuild } from "../models/eft/profile/IAkiProfile";
|
||||
import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData";
|
||||
import { IUserBuilds } from "../models/eft/profile/IAkiProfile";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class PresetBuildCallbacks {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected presetBuildController: PresetBuildController;
|
||||
constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController);
|
||||
getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<WeaponBuild[]>;
|
||||
saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle client/handbook/builds/my/list */
|
||||
getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IUserBuilds>;
|
||||
/** Handle SaveWeaponBuild event */
|
||||
saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle removeBuild event*/
|
||||
removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RemoveWeaponBuild event*/
|
||||
removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle SaveEquipmentBuild event */
|
||||
saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RemoveEquipmentBuild event*/
|
||||
removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
||||
|
44
types/callbacks/ProfileCallbacks.d.ts
vendored
44
types/callbacks/ProfileCallbacks.d.ts
vendored
@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyRespons
|
||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
||||
import { IGetMiniProfileRequestData } from "../models/eft/launcher/IGetMiniProfileRequestData";
|
||||
import { GetProfileStatusResponseData } from "../models/eft/profile/GetProfileStatusResponseData";
|
||||
import { IGetProfileSettingsRequest } from "../models/eft/profile/IGetProfileSettingsRequest";
|
||||
import { IProfileChangeNicknameRequestData } from "../models/eft/profile/IProfileChangeNicknameRequestData";
|
||||
import { IProfileChangeVoiceRequestData } from "../models/eft/profile/IProfileChangeVoiceRequestData";
|
||||
import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateRequestData";
|
||||
@ -19,16 +20,17 @@ export declare class ProfileCallbacks {
|
||||
protected timeUtil: TimeUtil;
|
||||
protected profileController: ProfileController;
|
||||
constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, profileController: ProfileController);
|
||||
/**
|
||||
* Handle client/game/profile/create
|
||||
*/
|
||||
createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||
/**
|
||||
* Handle client/game/profile/list
|
||||
* 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[]>;
|
||||
/**
|
||||
* Handle client/game/profile/savage/regenerate
|
||||
* 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
|
||||
* @param url
|
||||
@ -39,32 +41,40 @@ export declare class ProfileCallbacks {
|
||||
regenerateScav(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
* Handle client/game/profile/nickname/change event
|
||||
* 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>;
|
||||
/**
|
||||
* Handle client/game/profile/nickname/validate
|
||||
*/
|
||||
validateNickname(url: string, info: IValidateNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||
/**
|
||||
* Handle client/game/profile/nickname/reserved
|
||||
*/
|
||||
getReservedNickname(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
||||
/**
|
||||
* Handle client/profile/status
|
||||
* 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>;
|
||||
/**
|
||||
* 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[]>;
|
||||
/**
|
||||
* Handle launcher/profile/info
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
19
types/callbacks/QuestCallbacks.d.ts
vendored
19
types/callbacks/QuestCallbacks.d.ts
vendored
@ -17,17 +17,28 @@ export declare class QuestCallbacks {
|
||||
protected questController: QuestController;
|
||||
protected repeatableQuestController: RepeatableQuestController;
|
||||
constructor(httpResponse: HttpResponseUtil, questController: QuestController, repeatableQuestController: RepeatableQuestController);
|
||||
/**
|
||||
* Handle RepeatableQuestChange event
|
||||
*/
|
||||
changeRepeatableQuest(pmcData: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle QuestAccept event
|
||||
*/
|
||||
acceptQuest(pmcData: IPmcData, body: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle QuestComplete event
|
||||
*/
|
||||
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle QuestHandover event
|
||||
*/
|
||||
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle client/quest/list
|
||||
* @param url
|
||||
* @param info
|
||||
* @param sessionID
|
||||
* @returns
|
||||
*/
|
||||
listQuests(url: string, info: IListQuestsRequestData, sessionID: string): IGetBodyResponseData<IQuest[]>;
|
||||
/**
|
||||
* Handle client/repeatalbeQuests/activityPeriods
|
||||
*/
|
||||
activityPeriods(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcDataRepeatableQuest[]>;
|
||||
}
|
||||
|
17
types/callbacks/RagfairCallbacks.d.ts
vendored
17
types/callbacks/RagfairCallbacks.d.ts
vendored
@ -14,9 +14,11 @@ import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
|
||||
import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData";
|
||||
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
|
||||
import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData";
|
||||
import { IStorePlayerOfferTaxAmountRequestData } from "../models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
|
||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { RagfairServer } from "../servers/RagfairServer";
|
||||
import { RagfairTaxService } from "../services/RagfairTaxService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
/**
|
||||
@ -27,21 +29,32 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected ragfairServer: RagfairServer;
|
||||
protected ragfairController: RagfairController;
|
||||
protected ragfairTaxService: RagfairTaxService;
|
||||
protected configServer: ConfigServer;
|
||||
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>;
|
||||
getRoute(): string;
|
||||
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
||||
/**
|
||||
* Handle client/ragfair/search
|
||||
* Handle client/ragfair/find
|
||||
*/
|
||||
search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData<IGetOffersResult>;
|
||||
/** Handle client/ragfair/itemMarketPrice */
|
||||
getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData<IGetItemPriceResult>;
|
||||
/** Handle RagFairAddOffer event */
|
||||
addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** \Handle RagFairRemoveOffer event */
|
||||
removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RagFairRenewOffer event */
|
||||
extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle /client/items/prices
|
||||
* Called when clicking an item to list on flea
|
||||
*/
|
||||
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;
|
||||
storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData;
|
||||
}
|
||||
|
22
types/callbacks/RepairCallbacks.d.ts
vendored
22
types/callbacks/RepairCallbacks.d.ts
vendored
@ -7,19 +7,21 @@ export declare class RepairCallbacks {
|
||||
protected repairController: RepairController;
|
||||
constructor(repairController: RepairController);
|
||||
/**
|
||||
* Handle TraderRepair event
|
||||
* use trader to repair item
|
||||
* @param pmcData
|
||||
* @param body
|
||||
* @param sessionID
|
||||
* @returns
|
||||
* @param pmcData Player profile
|
||||
* @param traderRepairRequest Request object
|
||||
* @param sessionID Session id
|
||||
* @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
|
||||
* @param pmcData
|
||||
* @param body
|
||||
* @param sessionID
|
||||
* @returns
|
||||
* @param pmcData Player profile
|
||||
* @param repairRequest Request object
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
repair(pmcData: IPmcData, body: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
|
||||
repair(pmcData: IPmcData, repairRequest: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
||||
|
6
types/callbacks/SaveCallbacks.d.ts
vendored
6
types/callbacks/SaveCallbacks.d.ts
vendored
@ -1,9 +1,13 @@
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
import { OnUpdate } from "../di/OnUpdate";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
export declare class SaveCallbacks implements OnLoad, OnUpdate {
|
||||
protected saveServer: SaveServer;
|
||||
constructor(saveServer: SaveServer);
|
||||
protected configServer: ConfigServer;
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(saveServer: SaveServer, configServer: ConfigServer);
|
||||
onLoad(): Promise<void>;
|
||||
getRoute(): string;
|
||||
onUpdate(secondsSinceLastRun: number): Promise<boolean>;
|
||||
|
6
types/callbacks/TradeCallbacks.d.ts
vendored
6
types/callbacks/TradeCallbacks.d.ts
vendored
@ -3,12 +3,16 @@ import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
|
||||
import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
|
||||
import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData";
|
||||
export declare class TradeCallbacks {
|
||||
protected 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;
|
||||
/** Handle RagFairBuyOffer event */
|
||||
processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle SellAllFromSavage event */
|
||||
sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
||||
|
10
types/callbacks/TraderCallbacks.d.ts
vendored
10
types/callbacks/TraderCallbacks.d.ts
vendored
@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad";
|
||||
import { OnUpdate } from "../di/OnUpdate";
|
||||
import { TraderController } from "../controllers/TraderController";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
|
||||
import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class TraderCallbacks implements OnLoad, OnUpdate {
|
||||
@ -12,12 +12,10 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate {
|
||||
onLoad(): Promise<void>;
|
||||
onUpdate(): Promise<boolean>;
|
||||
getRoute(): string;
|
||||
/** Handle client/trading/api/traderSettings */
|
||||
getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]>;
|
||||
/**
|
||||
* Handle client/trading/api/getUserAssortPrice/trader
|
||||
* @returns
|
||||
*/
|
||||
getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, IBarterScheme[][]>>;
|
||||
/** Handle client/trading/api/getTrader */
|
||||
getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase>;
|
||||
/** Handle client/trading/api/getTraderAssort */
|
||||
getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>;
|
||||
}
|
||||
|
2
types/callbacks/WishlistCallbacks.d.ts
vendored
2
types/callbacks/WishlistCallbacks.d.ts
vendored
@ -5,6 +5,8 @@ import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"
|
||||
export declare class WishlistCallbacks {
|
||||
protected wishlistController: WishlistController;
|
||||
constructor(wishlistController: WishlistController);
|
||||
/** Handle AddToWishList event */
|
||||
addToWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RemoveFromWishList event */
|
||||
removeFromWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
||||
|
2
types/context/ApplicationContext.d.ts
vendored
2
types/context/ApplicationContext.d.ts
vendored
@ -8,6 +8,8 @@ export declare class ApplicationContext {
|
||||
*
|
||||
* const registerPlayerInfo = this.applicationContext.getLatestValue(ContextVariableType.REGISTER_PLAYER_REQUEST).getValue<IRegisterPlayerRequestData>();
|
||||
*
|
||||
* const activePlayerSessionId = this.applicationContext.getLatestValue(ContextVariableType.SESSION_ID).getValue<string>();
|
||||
*
|
||||
* const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.MATCH_INFO).getValue<IStartOfflineRaidRequestData>();
|
||||
* @param type
|
||||
* @returns
|
||||
|
9
types/controllers/BotController.d.ts
vendored
9
types/controllers/BotController.d.ts
vendored
@ -8,11 +8,13 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase";
|
||||
import { IBotCore } from "../models/eft/common/tables/IBotCore";
|
||||
import { Difficulty } from "../models/eft/common/tables/IBotType";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { MatchBotDetailsCacheService } from "../services/MatchBotDetailsCacheService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class BotController {
|
||||
protected logger: ILogger;
|
||||
@ -21,14 +23,16 @@ export declare class BotController {
|
||||
protected botHelper: BotHelper;
|
||||
protected botDifficultyHelper: BotDifficultyHelper;
|
||||
protected botGenerationCacheService: BotGenerationCacheService;
|
||||
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected botConfig: IBotConfig;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
static readonly pmcTypeLabel = "PMC";
|
||||
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, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
|
||||
/**
|
||||
* Return the number of bot loadout varieties to be generated
|
||||
* @param type bot Type we want the loadout gen count for
|
||||
@ -36,6 +40,7 @@ export declare class BotController {
|
||||
*/
|
||||
getBotPresetGenerationLimit(type: string): number;
|
||||
/**
|
||||
* Handle singleplayer/settings/bot/difficulty
|
||||
* Get the core.json difficulty settings from database\bots
|
||||
* @returns IBotCore
|
||||
*/
|
||||
@ -67,5 +72,5 @@ export declare class BotController {
|
||||
* @returns cap number
|
||||
*/
|
||||
getBotCap(): number;
|
||||
getPmcBotTypes(): Record<string, Record<string, Record<string, number>>>;
|
||||
getAiBotBrainTypes(): any;
|
||||
}
|
||||
|
52
types/controllers/CustomizationController.d.ts
vendored
52
types/controllers/CustomizationController.d.ts
vendored
@ -1,7 +1,7 @@
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { ISuit } from "../models/eft/common/tables/ITrader";
|
||||
import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothingRequestData";
|
||||
import { ClothingItem, IBuyClothingRequestData } from "../models/eft/customization/IBuyClothingRequestData";
|
||||
import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
@ -16,9 +16,55 @@ export declare class CustomizationController {
|
||||
protected saveServer: SaveServer;
|
||||
protected localisationService: LocalisationService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected readonly clothingIds: {
|
||||
lowerParentId: string;
|
||||
upperParentId: string;
|
||||
};
|
||||
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[];
|
||||
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[];
|
||||
}
|
||||
|
111
types/controllers/DialogueController.d.ts
vendored
111
types/controllers/DialogueController.d.ts
vendored
@ -1,18 +1,43 @@
|
||||
import { DialogueHelper } from "../helpers/DialogueHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse";
|
||||
import { IGetFriendListDataResponse } from "../models/eft/dialog/IGetFriendListDataResponse";
|
||||
import { IGetMailDialogViewRequestData } from "../models/eft/dialog/IGetMailDialogViewRequestData";
|
||||
import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDialogViewResponseData";
|
||||
import { DialogueInfo, Message } from "../models/eft/profile/IAkiProfile";
|
||||
import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest";
|
||||
import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile";
|
||||
import { MessageType } from "../models/enums/MessageType";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { GiftService } from "../services/GiftService";
|
||||
import { MailSendService } from "../services/MailSendService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class DialogueController {
|
||||
protected logger: ILogger;
|
||||
protected saveServer: SaveServer;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
constructor(saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper);
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected mailSendService: MailSendService;
|
||||
protected giftService: GiftService;
|
||||
protected hashUtil: HashUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer);
|
||||
/** Handle onUpdate spt event */
|
||||
update(): void;
|
||||
/**
|
||||
* Handle client/friend/list
|
||||
* @returns IGetFriendListDataResponse
|
||||
*/
|
||||
getFriendList(sessionID: string): IGetFriendListDataResponse;
|
||||
/**
|
||||
* Handle client/mail/dialog/list
|
||||
* Create array holding trader dialogs and mail interactions with player
|
||||
* Set the content of the dialogue on the list tab.
|
||||
* @param sessionID Session Id
|
||||
@ -27,14 +52,37 @@ export declare class DialogueController {
|
||||
*/
|
||||
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
|
||||
* Set the content of the dialogue on the details panel, showing all the messages
|
||||
* for the specified dialogue.
|
||||
* @param dialogueID Dialog id
|
||||
* @param sessionID Session id
|
||||
* @param request Get dialog request
|
||||
* @param sessionId Session id
|
||||
* @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
|
||||
* @param sessionID Session id
|
||||
@ -48,16 +96,39 @@ export declare class DialogueController {
|
||||
* @returns true if uncollected rewards found
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* Handle client/mail/dialog/remove
|
||||
* Remove an entire dialog with an entity (trader/user)
|
||||
* @param dialogueId id of the dialog to remove
|
||||
* @param sessionId Player id
|
||||
*/
|
||||
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
|
||||
* @param dialogueId Dialog to get mail attachments from
|
||||
* @param sessionId Session id
|
||||
* @returns
|
||||
*/
|
||||
getAllAttachments(dialogueID: string, sessionID: string): IGetAllAttachmentsResponse;
|
||||
getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse;
|
||||
/** client/mail/msg/send */
|
||||
sendMessage(sessionId: string, request: ISendMessageRequest): string;
|
||||
/**
|
||||
* Send responses back to player when they communicate with SPT friend on friends list
|
||||
* @param sessionId Session Id
|
||||
* @param request send message request
|
||||
*/
|
||||
protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void;
|
||||
protected getSptFriendData(friendId?: string): IUserDialogInfo;
|
||||
/**
|
||||
* Get messages from a specific dialog that have items not expired
|
||||
* @param sessionId Session id
|
||||
@ -72,8 +143,20 @@ export declare class DialogueController {
|
||||
*/
|
||||
protected getMessagesWithAttachments(messages: Message[]): Message[];
|
||||
/**
|
||||
* Delete expired items. triggers when updating traders.
|
||||
* @param sessionID Session id
|
||||
* Delete expired items from all messages in player profile. triggers when updating traders.
|
||||
* @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;
|
||||
}
|
||||
|
89
types/controllers/GameController.d.ts
vendored
89
types/controllers/GameController.d.ts
vendored
@ -6,27 +6,40 @@ import { PreAkiModLoader } from "../loaders/PreAkiModLoader";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
|
||||
import { ICurrentGroupResponse } from "../models/eft/game/ICurrentGroupResponse";
|
||||
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
|
||||
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
|
||||
import { IServerDetails } from "../models/eft/game/IServerDetails";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
|
||||
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
|
||||
import { ILootConfig } from "../models/spt/config/ILootConfig";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { CustomLocationWaveService } from "../services/CustomLocationWaveService";
|
||||
import { GiftService } from "../services/GiftService";
|
||||
import { ItemBaseClassService } from "../services/ItemBaseClassService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { OpenZoneService } from "../services/OpenZoneService";
|
||||
import { ProfileFixerService } from "../services/ProfileFixerService";
|
||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class GameController {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected preAkiModLoader: PreAkiModLoader;
|
||||
protected httpServerHelper: HttpServerHelper;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected hideoutHelper: HideoutHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected profileFixerService: ProfileFixerService;
|
||||
@ -34,13 +47,64 @@ export declare class GameController {
|
||||
protected customLocationWaveService: CustomLocationWaveService;
|
||||
protected openZoneService: OpenZoneService;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected itemBaseClassService: ItemBaseClassService;
|
||||
protected giftService: GiftService;
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected configServer: ConfigServer;
|
||||
protected os: any;
|
||||
protected httpConfig: IHttpConfig;
|
||||
protected coreConfig: ICoreConfig;
|
||||
protected locationConfig: ILocationConfig;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, 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;
|
||||
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, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
load(): void;
|
||||
/**
|
||||
* Handle client/game/start
|
||||
*/
|
||||
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
|
||||
protected addCustomLooseLootPositions(): void;
|
||||
protected adjustLooseLootSpawnProbabilities(): void;
|
||||
protected setHideoutAreasAndCraftsTo40Secs(): void;
|
||||
/**
|
||||
* 3.7.0 moved AIDs to be numeric, old profiles need to be migrated
|
||||
* We store the old AID value in new field `sessionId`
|
||||
* @param fullProfile Profile to update
|
||||
*/
|
||||
protected fixIncorrectAidValue(fullProfile: IAkiProfile): 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;
|
||||
/**
|
||||
* 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
|
||||
* TODO - add body part HP regen
|
||||
@ -55,16 +119,34 @@ export declare class GameController {
|
||||
* Make Rogues spawn later to allow for scavs to spawn first instead of rogues filling up all spawn positions
|
||||
*/
|
||||
protected fixRoguesSpawningInstantlyOnLighthouse(): void;
|
||||
/**
|
||||
* Send starting gifts to profile after x days
|
||||
* @param pmcProfile Profile to add gifts to
|
||||
*/
|
||||
protected sendPraporGiftsToNewProfiles(pmcProfile: IPmcData): void;
|
||||
/**
|
||||
* Find and split waves with large numbers of bots into smaller waves - BSG appears to reduce the size of these waves to one bot when they're waiting to spawn for too long
|
||||
*/
|
||||
protected splitBotWavesIntoSingleWaves(): void;
|
||||
/**
|
||||
* Get a list of installed mods and save their details to the profile being used
|
||||
* @param fullProfile Profile to add mod details to
|
||||
*/
|
||||
protected saveActiveModsToProfile(fullProfile: IAkiProfile): void;
|
||||
/**
|
||||
* Check for any missing assorts inside each traders assort.json data, checking against traders qeustassort.json
|
||||
*/
|
||||
protected validateQuestAssortUnlocksExist(): void;
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@ -74,7 +156,4 @@ export declare class GameController {
|
||||
*/
|
||||
protected adjustLabsRaiderSpawnRate(): void;
|
||||
protected logProfileDetails(fullProfile: IAkiProfile): void;
|
||||
getGameConfig(sessionID: string): IGameConfigResponse;
|
||||
getServer(): IServerDetails[];
|
||||
getValidGameVersion(): ICheckVersionResponse;
|
||||
}
|
||||
|
33
types/controllers/HealthController.d.ts
vendored
33
types/controllers/HealthController.d.ts
vendored
@ -12,6 +12,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { PaymentService } from "../services/PaymentService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class HealthController {
|
||||
protected logger: ILogger;
|
||||
@ -21,38 +22,42 @@ export declare class HealthController {
|
||||
protected paymentService: PaymentService;
|
||||
protected inventoryHelper: InventoryHelper;
|
||||
protected localisationService: LocalisationService;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
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
|
||||
* @param pmcData Player profile
|
||||
* @param info Request data
|
||||
* @param sessionID
|
||||
* @param sessionID Player id
|
||||
* @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;
|
||||
/**
|
||||
* When healing in menu
|
||||
* @param pmcData
|
||||
* @param body
|
||||
* @param sessionID
|
||||
* @returns
|
||||
* @param pmcData Player profile
|
||||
* @param request Healing request
|
||||
* @param sessionID Player id
|
||||
* @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
|
||||
* @param pmcData Player profile
|
||||
* @param body request Object
|
||||
* @param request Eat request
|
||||
* @param sessionID Session id
|
||||
* @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
|
||||
* @param pmcData player profile
|
||||
* @param healthTreatmentRequest Request data from client
|
||||
* @param sessionID Session id
|
||||
* @returns
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
@ -62,12 +67,4 @@ export declare class HealthController {
|
||||
* @param sessionID
|
||||
*/
|
||||
applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void;
|
||||
/**
|
||||
* Iterate over treatment request diff and find effects to remove from player limbs
|
||||
* @param sessionId
|
||||
* @param profile Profile to update
|
||||
* @param treatmentRequest client request
|
||||
* @param output response to send to client
|
||||
*/
|
||||
protected removeEffectsAfterPostRaidHeal(sessionId: string, profile: IPmcData, treatmentRequest: IHealthTreatmentRequestData, output: IItemEventRouterResponse): void;
|
||||
}
|
||||
|
54
types/controllers/HideoutController.d.ts
vendored
54
types/controllers/HideoutController.d.ts
vendored
@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase";
|
||||
import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData";
|
||||
import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData";
|
||||
import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea";
|
||||
import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
|
||||
import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData";
|
||||
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
|
||||
@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad
|
||||
import { IQteData } from "../models/eft/hideout/IQteData";
|
||||
import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { HideoutAreas } from "../models/enums/HideoutAreas";
|
||||
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
@ -59,6 +61,7 @@ export declare class HideoutController {
|
||||
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);
|
||||
/**
|
||||
* Handle HideoutUpgrade event
|
||||
* Start a hideout area upgrade
|
||||
* @param pmcData Player profile
|
||||
* @param request upgrade start request
|
||||
@ -67,6 +70,7 @@ export declare class HideoutController {
|
||||
*/
|
||||
startUpgrade(pmcData: IPmcData, request: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutUpgradeComplete event
|
||||
* Complete a hideout area upgrade
|
||||
* @param pmcData Player profile
|
||||
* @param request Completed upgrade request
|
||||
@ -74,6 +78,37 @@ export declare class HideoutController {
|
||||
* @returns 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 Objet 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
|
||||
* Create item in hideout slot item array, remove item from player inventory
|
||||
@ -84,6 +119,7 @@ export declare class HideoutController {
|
||||
*/
|
||||
putItemsInAreaSlots(pmcData: IPmcData, addItemToHideoutRequest: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutTakeItemsFromAreaSlots event
|
||||
* Remove item from hideout area and place into player inventory
|
||||
* @param pmcData Player profile
|
||||
* @param request Take item out of area request
|
||||
@ -102,6 +138,7 @@ export declare class HideoutController {
|
||||
*/
|
||||
protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: HideoutArea): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutToggleArea event
|
||||
* Toggle area on/off
|
||||
* @param pmcData Player profile
|
||||
* @param request Toggle area request
|
||||
@ -110,6 +147,7 @@ export declare class HideoutController {
|
||||
*/
|
||||
toggleArea(pmcData: IPmcData, request: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutSingleProductionStart event
|
||||
* Start production for an item from hideout area
|
||||
* @param pmcData Player profile
|
||||
* @param body Start prodution of single item request
|
||||
@ -118,6 +156,7 @@ export declare class HideoutController {
|
||||
*/
|
||||
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutScavCaseProductionStart event
|
||||
* Handles event after clicking 'start' on the scav case hideout page
|
||||
* @param pmcData player profile
|
||||
* @param body client request object
|
||||
@ -137,9 +176,9 @@ export declare class HideoutController {
|
||||
* Add generated scav case rewards to player profile
|
||||
* @param pmcData player profile to add rewards to
|
||||
* @param rewards reward items to add to profile
|
||||
* @param recipieId recipie id to save into Production dict
|
||||
* @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
|
||||
* @param pmcData Player profile
|
||||
@ -149,6 +188,7 @@ export declare class HideoutController {
|
||||
*/
|
||||
continuousProductionStart(pmcData: IPmcData, request: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutTakeProduction event
|
||||
* Take completed item out of hideout area and place into player inventory
|
||||
* @param pmcData Player profile
|
||||
* @param request Remove production from area request
|
||||
@ -157,17 +197,17 @@ export declare class HideoutController {
|
||||
*/
|
||||
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 recipe Completed recipie of item
|
||||
* @param recipe Completed recipe of item
|
||||
* @param pmcData Player profile
|
||||
* @param request Remove production from area request
|
||||
* @param output Output object to update
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handles giving rewards stored in player profile to player after clicking 'get rewards'
|
||||
* Handles generating case rewards and sending to player inventory
|
||||
* @param sessionID Session id
|
||||
* @param pmcData Player profile
|
||||
* @param request Get rewards from scavcase craft request
|
||||
@ -176,7 +216,7 @@ export declare class HideoutController {
|
||||
*/
|
||||
protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Start area production for item
|
||||
* Start area production for item by adding production to profiles' Hideout.Production array
|
||||
* @param pmcData Player profile
|
||||
* @param request Start production request
|
||||
* @param sessionID Session id
|
||||
|
28
types/controllers/InraidController.d.ts
vendored
28
types/controllers/InraidController.d.ts
vendored
@ -10,6 +10,7 @@ import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
|
||||
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
|
||||
import { PlayerRaidEndState } from "../models/enums/PlayerRaidEndState";
|
||||
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
@ -17,6 +18,8 @@ import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { InsuranceService } from "../services/InsuranceService";
|
||||
import { MatchBotDetailsCacheService } from "../services/MatchBotDetailsCacheService";
|
||||
import { PmcChatResponseService } from "../services/PmcChatResponseService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
/**
|
||||
@ -28,6 +31,8 @@ export declare class InraidController {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected pmcChatResponseService: PmcChatResponseService;
|
||||
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
||||
protected questHelper: QuestHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -40,7 +45,7 @@ export declare class InraidController {
|
||||
protected configServer: ConfigServer;
|
||||
protected airdropConfig: IAirdropConfig;
|
||||
protected inraidConfig: IInRaidConfig;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
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, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
/**
|
||||
* Save locationId to active profiles inraid object AND app context
|
||||
* @param sessionID Session id
|
||||
@ -48,6 +53,7 @@ export declare class InraidController {
|
||||
*/
|
||||
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
|
||||
/**
|
||||
* Handle raid/profile/save
|
||||
* Save profile state to disk
|
||||
* Handles pmc/pscav
|
||||
* @param offraidData post-raid request data
|
||||
@ -61,18 +67,18 @@ export declare class InraidController {
|
||||
*/
|
||||
protected savePmcProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
|
||||
/**
|
||||
* Make changes to pmc profile after they left raid dead,
|
||||
* alter bodypart hp, handle insurance, delete inventory items, remove carried quest items
|
||||
* @param postRaidSaveRequest post-raid save request
|
||||
* @param pmcData pmc profile
|
||||
* @param insuranceEnabled is insurance enabled
|
||||
* @param preRaidGear gear player had before raid
|
||||
* Make changes to pmc profile after they've died in raid,
|
||||
* Alter bodypart hp, handle insurance, delete inventory items, remove carried quest items
|
||||
* @param postRaidSaveRequest Post-raid save request
|
||||
* @param pmcData Pmc profile
|
||||
* @param insuranceEnabled Is insurance enabled
|
||||
* @param preRaidGear Gear player had before raid
|
||||
* @param sessionID Session id
|
||||
* @returns Updated profile object
|
||||
*/
|
||||
protected performPostRaidActionsWhenDead(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData, insuranceEnabled: boolean, preRaidGear: Item[], sessionID: string): IPmcData;
|
||||
/**
|
||||
* Adjust player characters bodypart hp if they left raid early
|
||||
* Adjust player characters bodypart hp post-raid
|
||||
* @param postRaidSaveRequest post raid data
|
||||
* @param pmcData player profile
|
||||
*/
|
||||
@ -94,14 +100,12 @@ export declare class InraidController {
|
||||
* @param statusOnExit exit value from offraidData object
|
||||
* @returns true if dead
|
||||
*/
|
||||
protected isPlayerDead(statusOnExit: string): boolean;
|
||||
protected isPlayerDead(statusOnExit: PlayerRaidEndState): boolean;
|
||||
/**
|
||||
* Mark inventory items as FiR if player survived raid, otherwise remove FiR from them
|
||||
* @param offraidData Save Progress Request
|
||||
* @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
|
||||
* @param scavData Scav profile
|
||||
|
134
types/controllers/InsuranceController.d.ts
vendored
134
types/controllers/InsuranceController.d.ts
vendored
@ -1,11 +1,15 @@
|
||||
import { DialogueHelper } from "../helpers/DialogueHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsuranceCostRequestData";
|
||||
import { IGetInsuranceCostResponseData } from "../models/eft/insurance/IGetInsuranceCostResponseData";
|
||||
import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { Insurance } from "../models/eft/profile/IAkiProfile";
|
||||
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
@ -13,6 +17,7 @@ import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { InsuranceService } from "../services/InsuranceService";
|
||||
import { MailSendService } from "../services/MailSendService";
|
||||
import { PaymentService } from "../services/PaymentService";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
@ -26,17 +31,134 @@ export declare class InsuranceController {
|
||||
protected itemHelper: ItemHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected paymentService: PaymentService;
|
||||
protected insuranceService: InsuranceService;
|
||||
protected mailSendService: MailSendService;
|
||||
protected configServer: ConfigServer;
|
||||
protected insuranceConfig: IInsuranceConfig;
|
||||
constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, insuranceService: InsuranceService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, randomUtil: RandomUtil, 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;
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
* Build an array of items to delete from the insured items.
|
||||
*
|
||||
* This method orchestrates several steps:
|
||||
* - Filters items based on their presence in the database and their raid moddability.
|
||||
* - Sorts base and independent child items to consider for deletion.
|
||||
* - Groups child items by their parent for later evaluation.
|
||||
* - Evaluates grouped child items to decide which should be deleted, based on their value and a random roll.
|
||||
*
|
||||
* @param insured - The insured items to build a removal array from.
|
||||
* @returns An array of IDs representing items that should be deleted.
|
||||
*/
|
||||
protected findItemsToDelete(insured: Insurance): string[];
|
||||
/**
|
||||
* Filters an item based on its existence in the database, raid moddability, and slot requirements.
|
||||
*
|
||||
* @param item The item to be filtered.
|
||||
* @param parentItemDbDetails The database details of the parent item, or null if the item has no parent.
|
||||
* @param itemDbDetails A tuple where the first element is a boolean indicating if the item exists in the database,
|
||||
* and the second element is the item details if it does.
|
||||
* @returns true if the item exists in the database and neither of the following conditions are met:
|
||||
* - The item has the RaidModdable property set to false.
|
||||
* - The item is attached to a required slot in its parent item.
|
||||
* Otherwise, returns false.
|
||||
*/
|
||||
protected filterByRaidModdability(item: Item, parentItemDbDetails: ITemplateItem | null, itemDbDetails: [boolean, ITemplateItem]): boolean;
|
||||
/**
|
||||
* Determines if an item is either a base item or a child item that is not equipped to its parent.
|
||||
*
|
||||
* @param item The item to check.
|
||||
* @returns true if the item is a base or an independent child item, otherwise false.
|
||||
*/
|
||||
protected isBaseOrIndependentChild(item: Item): boolean;
|
||||
/**
|
||||
* Makes a roll to determine if a given item should be deleted. If the roll is successful, the item's ID is added
|
||||
* to the `toDelete` array.
|
||||
*
|
||||
* @param item The item for which the roll is made.
|
||||
* @param traderId The ID of the trader to consider in the rollForItemDelete method.
|
||||
* @param toDelete The array accumulating the IDs of items to be deleted.
|
||||
* @returns true if the item is marked for deletion, otherwise false.
|
||||
*/
|
||||
protected makeRollAndMarkForDeletion(item: Item, traderId: string, toDelete: string[]): boolean;
|
||||
/**
|
||||
* Groups child items by their parent IDs in a Map data structure.
|
||||
*
|
||||
* @param item The child item to be grouped by its parent.
|
||||
* @param childrenGroupedByParent The Map that holds arrays of children items grouped by their parent IDs.
|
||||
* @returns void
|
||||
*/
|
||||
protected groupChildrenByParent(item: Item, childrenGroupedByParent: Map<string, Item[]>): void;
|
||||
/**
|
||||
* Sorts the array of children items in descending order by their maximum price. For each child, a roll is made to
|
||||
* determine if it should be deleted. The method then deletes the most valuable children based on the number of
|
||||
* successful rolls made.
|
||||
*
|
||||
* @param children The array of children items to sort and filter.
|
||||
* @param traderId The ID of the trader to consider in the rollForItemDelete method.
|
||||
* @param toDelete The array that accumulates the IDs of the items to be deleted.
|
||||
* @returns void
|
||||
*/
|
||||
protected sortAndFilterChildren(children: Item[], traderId: string, toDelete: 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: 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.
|
||||
* @param noItems Whether or not there are any items to return to the player.
|
||||
* @returns void
|
||||
*/
|
||||
protected sendMail(sessionID: string, insurance: Insurance, noItems: boolean): void;
|
||||
/**
|
||||
* Determines whether a valid insured item should be removed from the player's inventory based on a random roll and
|
||||
* trader-specific return chance.
|
||||
*
|
||||
* @param insuredItem The insured item being evaluated for removal.
|
||||
* @param traderId The ID of the trader who insured the item.
|
||||
* @param itemsBeingDeleted List of items that are already slated for removal.
|
||||
* @returns true if the insured item should be removed from inventory, false otherwise.
|
||||
*/
|
||||
protected rollForItemDelete(insuredItem: Item, traderId: string, itemsBeingDeleted: string[]): boolean;
|
||||
/**
|
||||
* Handle Insure event
|
||||
* Add insurance to an item
|
||||
*
|
||||
* @param pmcData Player profile
|
||||
* @param body Insurance request
|
||||
* @param sessionID Session id
|
||||
@ -44,10 +166,12 @@ export declare class InsuranceController {
|
||||
*/
|
||||
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle client/insurance/items/list/cost
|
||||
* Calculate insurance cost
|
||||
* @param info request object
|
||||
*
|
||||
* @param request request object
|
||||
* @param sessionID session id
|
||||
* @returns IGetInsuranceCostResponseData object to send to client
|
||||
*/
|
||||
cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData;
|
||||
cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData;
|
||||
}
|
||||
|
105
types/controllers/InventoryController.d.ts
vendored
105
types/controllers/InventoryController.d.ts
vendored
@ -1,10 +1,11 @@
|
||||
import { LootGenerator } from "../generators/LootGenerator";
|
||||
import { InventoryHelper } from "../helpers/InventoryHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { PaymentHelper } from "../helpers/PaymentHelper";
|
||||
import { PresetHelper } from "../helpers/PresetHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { QuestHelper } from "../helpers/QuestHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData";
|
||||
import { IInventoryBindRequestData } from "../models/eft/inventory/IInventoryBindRequestData";
|
||||
import { IInventoryCreateMarkerRequestData } from "../models/eft/inventory/IInventoryCreateMarkerRequestData";
|
||||
import { IInventoryDeleteMarkerRequestData } from "../models/eft/inventory/IInventoryDeleteMarkerRequestData";
|
||||
@ -37,19 +38,21 @@ export declare class InventoryController {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected fenceService: FenceService;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected inventoryHelper: InventoryHelper;
|
||||
protected questHelper: QuestHelper;
|
||||
protected ragfairOfferService: RagfairOfferService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected localisationService: LocalisationService;
|
||||
protected lootGenerator: LootGenerator;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
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, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
|
||||
/**
|
||||
* Move Item
|
||||
* change location of item with parentId and slotId
|
||||
@ -61,47 +64,68 @@ export declare class InventoryController {
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
moveItem(pmcData: IPmcData, moveRequest: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Get a event router response with inventory trader message
|
||||
* @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;
|
||||
/**
|
||||
* Handle Remove event
|
||||
* Implements functionality "Discard" from Main menu (Stash etc.)
|
||||
* Removes item from PMC Profile
|
||||
*/
|
||||
discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Split Item
|
||||
* spliting 1 item-stack into 2 separate items ...
|
||||
*/
|
||||
splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
* Split Item
|
||||
* spliting 1 stack into 2
|
||||
* @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile)
|
||||
* @param request Split request
|
||||
* @param sessionID Session/player id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Merge Item
|
||||
* merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with`
|
||||
* Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer')
|
||||
* 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;
|
||||
/**
|
||||
* Transfer item
|
||||
* Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload"
|
||||
*/
|
||||
* TODO: Adds no data to output to send to client, is this by design?
|
||||
* 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;
|
||||
/**
|
||||
* Swap Item
|
||||
* 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;
|
||||
/**
|
||||
* 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;
|
||||
swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handles folding of Weapons
|
||||
*/
|
||||
foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
@ -112,7 +136,14 @@ export declare class InventoryController {
|
||||
* @returns client response object
|
||||
*/
|
||||
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
|
||||
* @param pmcData Player profile
|
||||
* @param bindRequest Reqeust object
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
bindItem(pmcData: IPmcData, bindRequest: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handles examining an item
|
||||
* @param pmcData player profile
|
||||
@ -137,10 +168,38 @@ export declare class InventoryController {
|
||||
* @returns 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)
|
||||
* @param pmcData Profile data
|
||||
* @param body open loot container request data
|
||||
|
30
types/controllers/LauncherController.d.ts
vendored
30
types/controllers/LauncherController.d.ts
vendored
@ -1,22 +1,35 @@
|
||||
import { HttpServerHelper } from "../helpers/HttpServerHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { PreAkiModLoader } from "../loaders/PreAkiModLoader";
|
||||
import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData";
|
||||
import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData";
|
||||
import { IRegisterData } from "../models/eft/launcher/IRegisterData";
|
||||
import { Info } from "../models/eft/profile/IAkiProfile";
|
||||
import { Info, ModDetails } from "../models/eft/profile/IAkiProfile";
|
||||
import { IConnectResponse } from "../models/eft/profile/IConnectResponse";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
export declare class LauncherController {
|
||||
protected hashUtil: HashUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected httpServerHelper: HttpServerHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected localisationService: LocalisationService;
|
||||
protected preAkiModLoader: PreAkiModLoader;
|
||||
protected configServer: ConfigServer;
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, configServer: ConfigServer);
|
||||
connect(): any;
|
||||
constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer);
|
||||
connect(): IConnectResponse;
|
||||
/**
|
||||
* Get descriptive text for each of the profile edtions a player can choose
|
||||
* @returns
|
||||
*/
|
||||
protected getProfileDescriptions(): Record<string, string>;
|
||||
find(sessionIdKey: string): Info;
|
||||
login(info: ILoginRequestData): string;
|
||||
register(info: IRegisterData): string;
|
||||
@ -25,4 +38,15 @@ export declare class LauncherController {
|
||||
changePassword(info: IChangeRequestData): string;
|
||||
wipe(info: IRegisterData): 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[];
|
||||
}
|
||||
|
53
types/controllers/LocationController.d.ts
vendored
53
types/controllers/LocationController.d.ts
vendored
@ -1,19 +1,27 @@
|
||||
import { LocationGenerator } from "../generators/LocationGenerator";
|
||||
import { LootGenerator } from "../generators/LootGenerator";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
||||
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
||||
import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult";
|
||||
import { IGetLocationRequestData } from "../models/eft/location/IGetLocationRequestData";
|
||||
import { AirdropTypeEnum } from "../models/enums/AirdropType";
|
||||
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
||||
import { LootItem } from "../models/spt/services/LootItem";
|
||||
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
|
||||
import { LootRequest } from "../models/spt/services/LootRequest";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class LocationController {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected logger: ILogger;
|
||||
protected locationGenerator: LocationGenerator;
|
||||
protected localisationService: LocalisationService;
|
||||
@ -22,14 +30,45 @@ export declare class LocationController {
|
||||
protected timeUtil: TimeUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected airdropConfig: IAirdropConfig;
|
||||
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
get(location: string): ILocationBase;
|
||||
generate(name: string): ILocationBase;
|
||||
generateAll(): ILocationsGenerateAllResponse;
|
||||
protected locationConfig: ILocationConfig;
|
||||
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
/**
|
||||
* Handle client/location/getLocalloot
|
||||
* Get a location (map) with generated loot data
|
||||
* @param sessionId Player id
|
||||
* @param request Map request to generate
|
||||
* @returns ILocationBase
|
||||
*/
|
||||
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 airdop container
|
||||
* Generates it randomly based on config/airdrop.json values
|
||||
* @returns Array of LootItem
|
||||
* @returns Array of LootItem objects
|
||||
*/
|
||||
getAirdropLoot(): LootItem[];
|
||||
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;
|
||||
}
|
||||
|
39
types/controllers/MatchController.d.ts
vendored
39
types/controllers/MatchController.d.ts
vendored
@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa
|
||||
import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData";
|
||||
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
|
||||
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
||||
import { IMatchConfig } from "../models/spt/config/IMatchConfig";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
@ -32,19 +32,23 @@ export declare class MatchController {
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected matchConfig: IMatchConfig;
|
||||
protected inraidConfig: IInRaidConfig;
|
||||
protected botConfig: IBotConfig;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext);
|
||||
getEnabled(): boolean;
|
||||
/** Handle raid/profile/list */
|
||||
getProfile(info: IGetProfileRequestData): IPmcData[];
|
||||
/** Handle client/match/group/create */
|
||||
createGroup(sessionID: string, info: ICreateGroupRequestData): any;
|
||||
/** Handle client/match/group/delete */
|
||||
deleteGroup(info: any): void;
|
||||
joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[];
|
||||
protected getMatch(location: string): any;
|
||||
/** Handle match/group/start_game */
|
||||
joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult;
|
||||
/** Handle client/match/group/status */
|
||||
getGroupStatus(info: IGetGroupStatusRequestData): any;
|
||||
/**
|
||||
* Handle /client/raid/configuration
|
||||
* @param request
|
||||
* @param sessionID
|
||||
* @param request Raid config request
|
||||
* @param sessionID Session id
|
||||
*/
|
||||
startOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void;
|
||||
/**
|
||||
@ -53,5 +57,26 @@ export declare class MatchController {
|
||||
* @returns bot difficulty
|
||||
*/
|
||||
protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: string): string;
|
||||
endOfflineRaid(info: IEndOfflineRaidRequestData, sessionID: string): void;
|
||||
/** Handle client/match/offline/end */
|
||||
endOfflineRaid(info: IEndOfflineRaidRequestData, sessionId: 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;
|
||||
/**
|
||||
* Update players fence trader standing value in profile
|
||||
* @param pmcData Player profile
|
||||
* @param fenceId Id of fence trader
|
||||
* @param extractName Name of extract used
|
||||
*/
|
||||
protected updateFenceStandingInProfile(pmcData: IPmcData, fenceId: string, extractName: string): void;
|
||||
}
|
||||
|
1
types/controllers/NotifierController.d.ts
vendored
1
types/controllers/NotifierController.d.ts
vendored
@ -18,5 +18,6 @@ export declare class NotifierController {
|
||||
*/
|
||||
notifyAsync(sessionID: string): Promise<unknown>;
|
||||
getServer(sessionID: string): string;
|
||||
/** Handle client/notifier/channel/create */
|
||||
getChannel(sessionID: string): INotifierChannel;
|
||||
}
|
||||
|
28
types/controllers/PresetBuildController.d.ts
vendored
28
types/controllers/PresetBuildController.d.ts
vendored
@ -2,17 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData";
|
||||
import { WeaponBuild } from "../models/eft/profile/IAkiProfile";
|
||||
import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData";
|
||||
import { IUserBuilds } from "../models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class PresetBuildController {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected saveServer: SaveServer;
|
||||
constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer);
|
||||
getUserBuilds(sessionID: string): WeaponBuild[];
|
||||
saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer);
|
||||
/** Handle client/handbook/builds/my/list */
|
||||
getUserBuilds(sessionID: string): IUserBuilds;
|
||||
/** Handle SaveWeaponBuild event */
|
||||
saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse;
|
||||
/** Handle SaveEquipmentBuild event */
|
||||
saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse;
|
||||
/** Handle RemoveWeaponBuild event*/
|
||||
removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RemoveWeaponBuild event*/
|
||||
removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RemoveEquipmentBuild event*/
|
||||
removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
||||
|
59
types/controllers/ProfileController.d.ts
vendored
59
types/controllers/ProfileController.d.ts
vendored
@ -1,46 +1,101 @@
|
||||
import { PlayerScavGenerator } from "../generators/PlayerScavGenerator";
|
||||
import { DialogueHelper } from "../helpers/DialogueHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { QuestHelper } from "../helpers/QuestHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IMiniProfile } from "../models/eft/launcher/IMiniProfile";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { IProfileChangeNicknameRequestData } from "../models/eft/profile/IProfileChangeNicknameRequestData";
|
||||
import { IProfileChangeVoiceRequestData } from "../models/eft/profile/IProfileChangeVoiceRequestData";
|
||||
import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateRequestData";
|
||||
import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData";
|
||||
import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse";
|
||||
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { MailSendService } from "../services/MailSendService";
|
||||
import { ProfileFixerService } from "../services/ProfileFixerService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class ProfileController {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected profileFixerService: ProfileFixerService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected mailSendService: MailSendService;
|
||||
protected playerScavGenerator: PlayerScavGenerator;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected questHelper: QuestHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
constructor(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, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper);
|
||||
/**
|
||||
* Handle /launcher/profiles
|
||||
*/
|
||||
getMiniProfiles(): IMiniProfile[];
|
||||
/**
|
||||
* Handle launcher/profile/info
|
||||
*/
|
||||
getMiniProfile(sessionID: string): any;
|
||||
/**
|
||||
* Handle client/game/profile/list
|
||||
*/
|
||||
getCompleteProfile(sessionID: string): IPmcData[];
|
||||
/**
|
||||
* Handle client/game/profile/create
|
||||
*/
|
||||
createProfile(info: IProfileCreateRequestData, sessionID: string): 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
|
||||
* pmc profile MUST exist first before pscav can be generated
|
||||
* PMC profile MUST exist first before pscav can be generated
|
||||
* @param sessionID
|
||||
* @returns IPmcData object
|
||||
*/
|
||||
generatePlayerScav(sessionID: string): IPmcData;
|
||||
/**
|
||||
* Handle client/game/profile/nickname/validate
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* Handle client/game/profile/voice/change event
|
||||
*/
|
||||
changeVoice(info: IProfileChangeVoiceRequestData, sessionID: string): void;
|
||||
/**
|
||||
* Handle client/game/profile/search
|
||||
*/
|
||||
getFriends(info: ISearchFriendRequestData, sessionID: string): ISearchFriendResponse[];
|
||||
}
|
||||
|
84
types/controllers/QuestController.d.ts
vendored
84
types/controllers/QuestController.d.ts
vendored
@ -3,8 +3,11 @@ import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
|
||||
import { QuestHelper } from "../helpers/QuestHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IQuest, Reward } from "../models/eft/common/tables/IQuest";
|
||||
import { IQuestStatus } from "../models/eft/common/tables/IBotBase";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest";
|
||||
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
|
||||
@ -17,27 +20,35 @@ import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { MailSendService } from "../services/MailSendService";
|
||||
import { PlayerService } from "../services/PlayerService";
|
||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class QuestController {
|
||||
protected logger: ILogger;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected httpResponseUtil: HttpResponseUtil;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected questHelper: QuestHelper;
|
||||
protected questConditionHelper: QuestConditionHelper;
|
||||
protected playerService: PlayerService;
|
||||
protected localeService: LocaleService;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, 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
|
||||
* Exclude quests with incomplete preconditions (level/loyalty)
|
||||
* @param sessionID session id
|
||||
@ -45,12 +56,26 @@ export declare class QuestController {
|
||||
*/
|
||||
getClientQuests(sessionID: string): IQuest[];
|
||||
/**
|
||||
* Is the quest for the opposite side the player is on
|
||||
* @param side player side (usec/bear)
|
||||
* @param questId questId to check
|
||||
* Does a provided quest have a level requirement equal to or below defined level
|
||||
* @param quest Quest 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
|
||||
* Send starting rewards if any to player and
|
||||
* Send start notification if any to player
|
||||
@ -60,13 +85,6 @@ export declare class QuestController {
|
||||
* @returns client response
|
||||
*/
|
||||
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead
|
||||
* @param startedMessageTextId startedMessageText property from IQuest
|
||||
* @param questDescriptionId description property from IQuest
|
||||
* @returns message id
|
||||
*/
|
||||
protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string;
|
||||
/**
|
||||
* Handle the client accepting a repeatable quest and starting it
|
||||
* Send starting rewards if any to player and
|
||||
@ -85,15 +103,23 @@ export declare class QuestController {
|
||||
*/
|
||||
protected getRepeatableQuestFromProfile(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData): IRepeatableQuest;
|
||||
/**
|
||||
* Handle QuestComplete event
|
||||
* Update completed quest in 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 body Completed quest request
|
||||
* @param sessionID Session id
|
||||
* @returns ItemEvent client response
|
||||
*/
|
||||
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* 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
|
||||
* @param sessionID session id
|
||||
@ -116,14 +142,38 @@ export declare class QuestController {
|
||||
*/
|
||||
protected getQuestsFailedByCompletingQuest(completedQuestId: string): IQuest[];
|
||||
/**
|
||||
* Fail the quests provided
|
||||
* Fail the provided quests
|
||||
* Update quest in profile, otherwise add fresh quest object with failed status
|
||||
* @param sessionID session id
|
||||
* @param pmcData player profile
|
||||
* @param questsToFail quests to fail
|
||||
* @param output Client output
|
||||
*/
|
||||
protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void;
|
||||
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void;
|
||||
/**
|
||||
* 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: AvailableForConditions, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Increment a backend counter stored value by an amount,
|
||||
* Create counter if it does not exist
|
||||
|
65
types/controllers/RagfairController.d.ts
vendored
65
types/controllers/RagfairController.d.ts
vendored
@ -8,7 +8,6 @@ import { RagfairHelper } from "../helpers/RagfairHelper";
|
||||
import { RagfairOfferHelper } from "../helpers/RagfairOfferHelper";
|
||||
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
|
||||
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
|
||||
import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
@ -22,6 +21,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric
|
||||
import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
|
||||
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
|
||||
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
|
||||
import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData";
|
||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
@ -34,6 +34,7 @@ import { PaymentService } from "../services/PaymentService";
|
||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
||||
import { RagfairPriceService } from "../services/RagfairPriceService";
|
||||
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
|
||||
import { RagfairTaxService } from "../services/RagfairTaxService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
/**
|
||||
@ -50,7 +51,7 @@ export declare class RagfairController {
|
||||
protected itemHelper: ItemHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected ragfairSellHelper: RagfairSellHelper;
|
||||
protected ragfairTaxHelper: RagfairTaxHelper;
|
||||
protected ragfairTaxService: RagfairTaxService;
|
||||
protected ragfairSortHelper: RagfairSortHelper;
|
||||
protected ragfairOfferHelper: RagfairOfferHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -66,12 +67,12 @@ export declare class RagfairController {
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
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;
|
||||
/**
|
||||
* Get offers for the client based on type of search being performed
|
||||
* @param searchRequest Client search request data
|
||||
* @param itemsToAdd
|
||||
* @param itemsToAdd comes from ragfairHelper.filterCategories()
|
||||
* @param traderAssorts Trader assorts
|
||||
* @param pmcProfile Player profile
|
||||
* @returns array of offers
|
||||
@ -117,10 +118,64 @@ export declare class RagfairController {
|
||||
* @returns min/avg/max values for an item based on flea offers available
|
||||
*/
|
||||
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 corrispnding items from player inventory and return as array
|
||||
* @param pmcData Player profile
|
||||
* @param itemIdsFromFleaOfferRequest Ids from request
|
||||
* @param errorMessage if item is not found, add error message to this parameter
|
||||
* @returns Array of items from player inventory
|
||||
*/
|
||||
protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[], errorMessage: string): Item[];
|
||||
createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer;
|
||||
getAllFleaPrices(): Record<string, number>;
|
||||
getStaticPrices(): Record<string, number>;
|
||||
/**
|
||||
* 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 offerId offer to 'remove'
|
||||
* @param sessionID Players id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse;
|
||||
extendOffer(info: 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;
|
||||
}
|
||||
|
2
types/controllers/RepairController.d.ts
vendored
2
types/controllers/RepairController.d.ts
vendored
@ -23,6 +23,7 @@ export declare class RepairController {
|
||||
protected repairConfig: IRepairConfig;
|
||||
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService);
|
||||
/**
|
||||
* Handle TraderRepair event
|
||||
* Repair with trader
|
||||
* @param sessionID session id
|
||||
* @param body endpoint request data
|
||||
@ -31,6 +32,7 @@ export declare class RepairController {
|
||||
*/
|
||||
traderRepair(sessionID: string, body: ITraderRepairActionDataRequest, pmcData: IPmcData): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle Repair event
|
||||
* Repair with repair kit
|
||||
* @param sessionID session id
|
||||
* @param body endpoint request data
|
||||
|
49
types/controllers/RepeatableQuestController.d.ts
vendored
49
types/controllers/RepeatableQuestController.d.ts
vendored
@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest";
|
||||
import { ELocationName } from "../models/enums/ELocationName";
|
||||
import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig";
|
||||
import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
@ -77,7 +77,7 @@ export declare class RepeatableQuestController {
|
||||
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);
|
||||
/**
|
||||
* 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.
|
||||
* repeatableQuestObject = {
|
||||
* id: Unique Id,
|
||||
@ -113,7 +113,7 @@ export declare class RepeatableQuestController {
|
||||
* 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;
|
||||
protected 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
|
||||
*/
|
||||
@ -128,7 +128,7 @@ export declare class RepeatableQuestController {
|
||||
* @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;
|
||||
protected generateRepeatableTemplate(type: string, traderId: string, side: string): IRepeatableQuest;
|
||||
/**
|
||||
* Generates a valid Exploration quest
|
||||
*
|
||||
@ -138,7 +138,7 @@ export declare class RepeatableQuestController {
|
||||
* @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;
|
||||
protected generateExplorationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IExploration;
|
||||
/**
|
||||
* Generates a valid Completion quest
|
||||
*
|
||||
@ -147,7 +147,7 @@ export declare class RepeatableQuestController {
|
||||
* @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;
|
||||
protected generateCompletionQuest(pmcLevel: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): ICompletion;
|
||||
/**
|
||||
* Generates a valid Elimination quest
|
||||
*
|
||||
@ -157,9 +157,16 @@ export declare class RepeatableQuestController {
|
||||
* @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;
|
||||
protected 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)
|
||||
* Get the relevant elimination config based on the current players PMC level
|
||||
* @param pmcLevel Level of PMC character
|
||||
* @param repeatableConfig Main repeatable config
|
||||
* @returns IEliminationConfig
|
||||
*/
|
||||
protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig;
|
||||
/**
|
||||
* Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567)
|
||||
* @param locationKey e.g factory4_day
|
||||
* @returns guid
|
||||
*/
|
||||
@ -171,7 +178,7 @@ export declare class RepeatableQuestController {
|
||||
* @param {string} exit The exit name to generate the condition for
|
||||
* @returns {object} Exit condition
|
||||
*/
|
||||
generateExplorationExitCondition(exit: Exit): IExplorationCondition;
|
||||
protected 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)
|
||||
@ -180,7 +187,7 @@ export declare class RepeatableQuestController {
|
||||
* @param {integer} value amount of items of this specific type to request
|
||||
* @returns {object} object of "Completion"-condition
|
||||
*/
|
||||
generateCompletionAvailableForFinish(targetItemId: string, value: number): ICompletionAvailableFor;
|
||||
protected 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.
|
||||
@ -188,7 +195,7 @@ export declare class RepeatableQuestController {
|
||||
* @param {string} location the location on which to fulfill the elimination quest
|
||||
* @returns {object} object of "Elimination"-location-subcondition
|
||||
*/
|
||||
generateEliminationLocation(location: string[]): IEliminationCondition;
|
||||
protected 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.
|
||||
@ -198,15 +205,16 @@ export declare class RepeatableQuestController {
|
||||
* @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;
|
||||
protected 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
|
||||
* 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.
|
||||
*
|
||||
* @returns {object} the quest pool
|
||||
* @param repeatableConfig main repeatable quest config
|
||||
* @param pmcLevel level of pmc generating quest pool
|
||||
* @returns IQuestTypePool
|
||||
*/
|
||||
generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool;
|
||||
protected generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool;
|
||||
/**
|
||||
* Generate the reward for a mission. A reward can consist of
|
||||
* - Experience
|
||||
@ -227,7 +235,7 @@ export declare class RepeatableQuestController {
|
||||
* @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;
|
||||
protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards;
|
||||
/**
|
||||
* Helper to create a reward item structured as required by the client
|
||||
*
|
||||
@ -236,9 +244,12 @@ export declare class RepeatableQuestController {
|
||||
* @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;
|
||||
protected generateRewardItem(tpl: string, value: number, index: number, preset?: any): IReward;
|
||||
debugLogRepeatableQuestIds(pmcData: IPmcData): void;
|
||||
probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>;
|
||||
protected probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>;
|
||||
/**
|
||||
* Handle RepeatableQuestChange event
|
||||
*/
|
||||
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)
|
||||
@ -252,5 +263,5 @@ export declare class RepeatableQuestController {
|
||||
* @param {string} tpl template id of item to check
|
||||
* @returns boolean: true if item is valid reward
|
||||
*/
|
||||
isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean;
|
||||
protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean;
|
||||
}
|
||||
|
41
types/controllers/TradeController.d.ts
vendored
41
types/controllers/TradeController.d.ts
vendored
@ -1,31 +1,66 @@
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { TradeHelper } from "../helpers/TradeHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Upd } from "../models/eft/common/tables/IItem";
|
||||
import { Item, Upd } from "../models/eft/common/tables/IItem";
|
||||
import { ITraderBase } from "../models/eft/common/tables/ITrader";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
|
||||
import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
|
||||
import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData";
|
||||
import { Traders } from "../models/enums/Traders";
|
||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { RagfairServer } from "../servers/RagfairServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { RagfairPriceService } from "../services/RagfairPriceService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
declare class TradeController {
|
||||
protected logger: ILogger;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected tradeHelper: TradeHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected ragfairServer: RagfairServer;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected localisationService: LocalisationService;
|
||||
protected ragfairPriceService: RagfairPriceService;
|
||||
protected configServer: ConfigServer;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer);
|
||||
/** Handle TradingConfirm event */
|
||||
confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RagFairBuyOffer event */
|
||||
confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle SellAllFromSavage event */
|
||||
sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Sell all sellable items to a trader from inventory
|
||||
* WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD
|
||||
* @param sessionId Session id
|
||||
* @param profileWithItemsToSell Profile with items to be sold to trader
|
||||
* @param profileThatGetsMoney Profile that gets the money after selling items
|
||||
* @param trader Trader to sell items to
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse;
|
||||
/**
|
||||
* 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;
|
||||
protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse;
|
||||
}
|
||||
export { TradeController };
|
||||
|
17
types/controllers/TraderController.d.ts
vendored
17
types/controllers/TraderController.d.ts
vendored
@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { TraderAssortHelper } from "../helpers/TraderAssortHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
|
||||
import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { FenceService } from "../services/FenceService";
|
||||
import { TraderAssortService } from "../services/TraderAssortService";
|
||||
import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class TraderController {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected traderAssortHelper: TraderAssortHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected traderAssortService: TraderAssortService;
|
||||
protected traderPurchasePersisterService: TraderPurchasePersisterService;
|
||||
protected fenceService: FenceService;
|
||||
protected fenceBaseAssortGenerator: FenceBaseAssortGenerator;
|
||||
protected jsonUtil: JsonUtil;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, 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
|
||||
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
|
||||
@ -37,12 +35,21 @@ export declare class TraderController {
|
||||
*/
|
||||
update(): boolean;
|
||||
/**
|
||||
* Handle client/trading/api/traderSettings
|
||||
* Return an array of all traders
|
||||
* @param sessionID Session id
|
||||
* @returns array if ITraderBase objects
|
||||
*/
|
||||
getAllTraders(sessionID: string): ITraderBase[];
|
||||
/**
|
||||
* Order traders by their traderId (Ttid)
|
||||
* @param traderA First trader to compare
|
||||
* @param traderB Second trader to compare
|
||||
* @returns 1,-1 or 0
|
||||
*/
|
||||
protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number;
|
||||
/** Handle client/trading/api/getTrader */
|
||||
getTrader(sessionID: string, traderID: string): ITraderBase;
|
||||
/** Handle client/trading/api/getTraderAssort */
|
||||
getAssort(sessionId: string, traderId: string): ITraderAssort;
|
||||
getPurchasesData(sessionID: string, traderID: string): Record<string, IBarterScheme[][]>;
|
||||
}
|
||||
|
1
types/controllers/WeatherController.d.ts
vendored
1
types/controllers/WeatherController.d.ts
vendored
@ -9,6 +9,7 @@ export declare class WeatherController {
|
||||
protected configServer: ConfigServer;
|
||||
protected weatherConfig: IWeatherConfig;
|
||||
constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer);
|
||||
/** Handle client/weather */
|
||||
generate(): IWeatherData;
|
||||
/**
|
||||
* Get the current in-raid time (MUST HAVE PLAYER LOGGED INTO CLIENT TO WORK)
|
||||
|
2
types/controllers/WishlistController.d.ts
vendored
2
types/controllers/WishlistController.d.ts
vendored
@ -5,6 +5,8 @@ import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData"
|
||||
export declare class WishlistController {
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
constructor(eventOutputHolder: EventOutputHolder);
|
||||
/** Handle AddToWishList */
|
||||
addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RemoveFromWishList event */
|
||||
removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
||||
|
4
types/di/Router.d.ts
vendored
4
types/di/Router.d.ts
vendored
@ -2,10 +2,10 @@ import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
export declare class Router {
|
||||
private handledRoutes;
|
||||
protected handledRoutes: HandledRoute[];
|
||||
getTopLevelRoute(): string;
|
||||
protected getHandledRoutes(): HandledRoute[];
|
||||
private getInternalHandledRoutes;
|
||||
protected getInternalHandledRoutes(): HandledRoute[];
|
||||
canHandle(url: string, partialMatch?: boolean): boolean;
|
||||
}
|
||||
export declare class StaticRouter extends Router {
|
||||
|
15
types/generators/BotEquipmentModGenerator.d.ts
vendored
15
types/generators/BotEquipmentModGenerator.d.ts
vendored
@ -81,10 +81,11 @@ export declare class BotEquipmentModGenerator {
|
||||
*/
|
||||
protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean;
|
||||
/**
|
||||
* Set all scope mod chances to 100%
|
||||
* @param modSpawnChances Chances objet to update
|
||||
* Set mod spawn chances to defined amount
|
||||
* @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[];
|
||||
/**
|
||||
* Get a Slot property for an item (chamber/cartridge/slot)
|
||||
@ -94,7 +95,7 @@ export declare class BotEquipmentModGenerator {
|
||||
*/
|
||||
protected getModItemSlot(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 modSlot slot the mod sits in
|
||||
@ -191,10 +192,12 @@ export declare class BotEquipmentModGenerator {
|
||||
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
|
||||
/**
|
||||
* 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 scopes Full scope pool
|
||||
* @param botWeaponSightWhitelist whitelist of scope types by weapon base type
|
||||
* @returns array of scope tpls that have been filtered
|
||||
* @param botWeaponSightWhitelist Whitelist of scope types by weapon base type
|
||||
* @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[];
|
||||
}
|
||||
|
35
types/generators/BotGenerator.d.ts
vendored
35
types/generators/BotGenerator.d.ts
vendored
@ -2,24 +2,28 @@ import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
|
||||
import { BotHelper } from "../helpers/BotHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { Health as PmcHealth, IBotBase, Info, Skills } from "../models/eft/common/tables/IBotBase";
|
||||
import { Health, IBotType } from "../models/eft/common/tables/IBotType";
|
||||
import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "../models/eft/common/tables/IBotBase";
|
||||
import { Appearance, Health, IBotType } from "../models/eft/common/tables/IBotType";
|
||||
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { BotInventoryGenerator } from "./BotInventoryGenerator";
|
||||
import { BotLevelGenerator } from "./BotLevelGenerator";
|
||||
export declare class BotGenerator {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
@ -30,9 +34,11 @@ export declare class BotGenerator {
|
||||
protected botHelper: BotHelper;
|
||||
protected botDifficultyHelper: BotDifficultyHelper;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, 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
|
||||
* @param role e.g. assault / pmcbot
|
||||
@ -62,6 +68,13 @@ export declare class BotGenerator {
|
||||
* @returns IBotBase object
|
||||
*/
|
||||
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
|
||||
* @param botJsonTemplate x.json from database
|
||||
@ -69,7 +82,7 @@ export declare class BotGenerator {
|
||||
* @param botRole role of bot e.g. assault
|
||||
* @returns Nickname for bot
|
||||
*/
|
||||
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string;
|
||||
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string;
|
||||
/**
|
||||
* Log the number of PMCs generated to the debug console
|
||||
* @param output Generated bot array, ready to send to client
|
||||
@ -82,7 +95,19 @@ export declare class BotGenerator {
|
||||
* @returns PmcHealth object
|
||||
*/
|
||||
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
|
||||
* @param bot bot to update
|
||||
|
10
types/generators/BotInventoryGenerator.d.ts
vendored
10
types/generators/BotInventoryGenerator.d.ts
vendored
@ -1,5 +1,6 @@
|
||||
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
||||
import { BotHelper } from "../helpers/BotHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
|
||||
import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType";
|
||||
@ -25,16 +26,17 @@ export declare class BotInventoryGenerator {
|
||||
protected botGeneratorHelper: BotGeneratorHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localisationService: LocalisationService;
|
||||
protected botEquipmentModPoolService: BotEquipmentModPoolService;
|
||||
protected botEquipmentModGenerator: BotEquipmentModGenerator;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, 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
|
||||
* @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 isPmc Is bot being converted into a pmc
|
||||
* @param botLevel Level of bot being generated
|
||||
@ -103,10 +105,10 @@ export declare class BotInventoryGenerator {
|
||||
* @param equipmentChances Chances bot can have equipment equipped
|
||||
* @param botRole assault/pmcBot/bossTagilla etc
|
||||
* @param isPmc Is the bot being generated as a pmc
|
||||
* @param itemGenerationLimitsMinMax
|
||||
* @param itemGenerationWeights
|
||||
*/
|
||||
protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: {
|
||||
slot: EquipmentSlots;
|
||||
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;
|
||||
}
|
||||
|
4
types/generators/BotLevelGenerator.d.ts
vendored
4
types/generators/BotLevelGenerator.d.ts
vendored
@ -1,6 +1,6 @@
|
||||
import { MinMax } from "../models/common/MinMax";
|
||||
import { IRandomisedBotLevelResult } from "../models/eft/bot/IRandomisedBotLevelResult";
|
||||
import { ExpTable } from "../models/eft/common/IGlobals";
|
||||
import { IExpTable } from "../models/eft/common/IGlobals";
|
||||
import { IBotBase } from "../models/eft/common/tables/IBotBase";
|
||||
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
@ -25,5 +25,5 @@ export declare class BotLevelGenerator {
|
||||
* @param relativeDeltaMax max delta above player level to go
|
||||
* @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;
|
||||
}
|
||||
|
85
types/generators/BotLootGenerator.d.ts
vendored
85
types/generators/BotLootGenerator.d.ts
vendored
@ -1,11 +1,15 @@
|
||||
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
||||
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
|
||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
|
||||
import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem, Props } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { EquipmentSlots } from "../models/enums/EquipmentSlots";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
@ -18,39 +22,59 @@ export declare class BotLootGenerator {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected botGeneratorHelper: BotGeneratorHelper;
|
||||
protected botWeaponGenerator: BotWeaponGenerator;
|
||||
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected botLootCacheService: BotLootCacheService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, 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
|
||||
* @param sessionId Session id
|
||||
* @param templateInventory x.json from database/bots
|
||||
* @param itemCounts Liits on item types to be added as loot
|
||||
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||
* @param isPmc Will bot be a pmc
|
||||
* @param botRole Role of bot, e.g. asssult
|
||||
* @param botInventory Inventory to add loot to
|
||||
* @param equipmentChances
|
||||
* @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;
|
||||
/**
|
||||
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached
|
||||
* @param pool pool of items to pick from
|
||||
* @param equipmentSlots What equality slot will the loot items be added to
|
||||
* @param pool Pool of items to pick from
|
||||
* @param equipmentSlots What equipment slot will the loot items be added to
|
||||
* @param totalItemCount Max count of items to add
|
||||
* @param inventoryToAddItemsTo bot inventory loot will be added to
|
||||
* @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 totalValueLimitRub total value of loot allowed in roubles
|
||||
* @param isPmc is the bot being generated for a pmc
|
||||
* @param inventoryToAddItemsTo Bot inventory loot will be added to
|
||||
* @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 totalValueLimitRub Total value of loot allowed in roubles
|
||||
* @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;
|
||||
/**
|
||||
@ -65,22 +89,22 @@ export declare class BotLootGenerator {
|
||||
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
|
||||
* @param pool pool of items to pick an item from
|
||||
* @param isPmc is the bot being created a pmc
|
||||
* @param pool Pool of items to pick an item from
|
||||
* @param isPmc Is the bot being created a pmc
|
||||
* @returns ITemplateItem object
|
||||
*/
|
||||
protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem;
|
||||
protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem;
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
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
|
||||
* @param isPmc is the bot a pmc
|
||||
* @param botRole role the bot has
|
||||
* @param isPmc Is the bot a pmc
|
||||
* @param botRole Role the bot has
|
||||
* @param limitCount
|
||||
*/
|
||||
protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record<string, number>): void;
|
||||
@ -89,24 +113,11 @@ export declare class BotLootGenerator {
|
||||
* @param itemTemplate Item we check to see if its reached spawn limit
|
||||
* @param botRole Bot type
|
||||
* @param isPmc Is bot we're working with a pmc
|
||||
* @param limitCount spawn limits for items on bot
|
||||
* @param itemSpawnLimits the limits this bot is allowed to have
|
||||
* @param limitCount Spawn limits for items on bot
|
||||
* @param itemSpawnLimits The limits this bot is allowed to have
|
||||
* @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;
|
||||
/**
|
||||
* 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
|
||||
* @param isPmc is this a PMC
|
||||
|
45
types/generators/BotWeaponGenerator.d.ts
vendored
45
types/generators/BotWeaponGenerator.d.ts
vendored
@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
||||
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { MinMax } from "../models/common/MinMax";
|
||||
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
|
||||
import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { IRepairConfig } from "../models/spt/config/IRepairConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { RepairService } from "../services/RepairService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
@ -33,10 +35,13 @@ export declare class BotWeaponGenerator {
|
||||
protected botWeaponModLimitService: BotWeaponModLimitService;
|
||||
protected botEquipmentModGenerator: BotEquipmentModGenerator;
|
||||
protected localisationService: LocalisationService;
|
||||
protected repairService: RepairService;
|
||||
protected inventoryMagGenComponents: IInventoryMagGen[];
|
||||
protected readonly modMagazineSlotId = "mod_magazine";
|
||||
protected botConfig: IBotConfig;
|
||||
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, 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
|
||||
* @param equipmentSlot Primary/secondary/holster
|
||||
@ -63,10 +68,17 @@ export declare class BotWeaponGenerator {
|
||||
* @param weaponParentId ParentId of the weapon being generated
|
||||
* @param modChances Dictionary of item types and % chance weapon will have that mod
|
||||
* @param botRole e.g. assault/exusec
|
||||
* @param isPmc
|
||||
* @param isPmc Is weapon being generated for a pmc
|
||||
* @returns GenerateWeaponResult object
|
||||
*/
|
||||
generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult;
|
||||
/**
|
||||
* Insert a cartridge into a weapon
|
||||
* @param weaponWithModsArray Weapon and mods
|
||||
* @param ammoTpl Cartridge to add to weapon
|
||||
* @param desiredSlotId name of slot, e.g. patron_in_weapon
|
||||
*/
|
||||
protected addCartridgeToChamber(weaponWithModsArray: Item[], ammoTpl: string, desiredSlotId: string): void;
|
||||
/**
|
||||
* Create array with weapon base as only element and
|
||||
* add additional properties based on weapon type
|
||||
@ -97,11 +109,11 @@ export declare class BotWeaponGenerator {
|
||||
* Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets.
|
||||
* Additionally, adds extra bullets to SecuredContainer
|
||||
* @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 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
|
||||
* @param weaponMods Weapon array with mods
|
||||
@ -140,26 +152,27 @@ export declare class BotWeaponGenerator {
|
||||
protected getWeaponCaliber(weaponTemplate: ITemplateItem): string;
|
||||
/**
|
||||
* Fill existing magazines to full, while replacing their contents with specified ammo
|
||||
* @param weaponMods
|
||||
* @param magazine
|
||||
* @param ammoTpl
|
||||
* @param weaponMods Weapon with children
|
||||
* @param magazine Magazine item
|
||||
* @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
|
||||
* @param weaponMods
|
||||
* @param ubglMod
|
||||
* @param ubglAmmoTpl
|
||||
* @param weaponMods Weapon with children
|
||||
* @param ubglMod UBGL item
|
||||
* @param ubglAmmoTpl Grenade ammo tpl
|
||||
*/
|
||||
protected fillUbgl(weaponMods: Item[], ubglMod: Item, ubglAmmoTpl: string): void;
|
||||
/**
|
||||
* Add cartridge item to weapon Item array, if it already exists, update
|
||||
* @param weaponMods Weapon items array to amend
|
||||
* @param weaponWithMods Weapon items array to amend
|
||||
* @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 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
|
||||
* @param weaponMods Weapon mods to find and update camora mod(s) from
|
||||
|
@ -6,15 +6,17 @@ import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { ItemFilterService } from "../services/ItemFilterService";
|
||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
||||
export declare class FenceBaseAssortGenerator {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected configServer: ConfigServer;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
|
||||
/**
|
||||
* Create base fence assorts dynamically and store in db
|
||||
*/
|
||||
|
107
types/generators/LocationGenerator.d.ts
vendored
107
types/generators/LocationGenerator.d.ts
vendored
@ -2,25 +2,35 @@ import { ContainerHelper } from "../helpers/ContainerHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { PresetHelper } from "../helpers/PresetHelper";
|
||||
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
|
||||
import { ILooseLoot, SpawnpointsForced, SpawnpointTemplate } from "../models/eft/common/ILooseLoot";
|
||||
import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation";
|
||||
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
||||
import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase";
|
||||
import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase";
|
||||
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { MathUtil } from "../utils/MathUtil";
|
||||
import { ObjectId } from "../utils/ObjectId";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { ProbabilityObjectArray, RandomUtil } from "../utils/RandomUtil";
|
||||
export interface IContainerItem {
|
||||
items: Item[];
|
||||
width: 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 {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected objectId: ObjectId;
|
||||
protected randomUtil: RandomUtil;
|
||||
@ -33,8 +43,72 @@ export declare class LocationGenerator {
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
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);
|
||||
generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerProps;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
/**
|
||||
* 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 getStaticLootMultiplerForLocation(location: string): number;
|
||||
/**
|
||||
@ -52,5 +126,26 @@ export declare class LocationGenerator {
|
||||
* @param name of map currently generating forced loot for
|
||||
*/
|
||||
protected addForcedLoot(loot: 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(tpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
|
||||
}
|
||||
|
64
types/generators/LootGenerator.d.ts
vendored
64
types/generators/LootGenerator.d.ts
vendored
@ -1,38 +1,49 @@
|
||||
import { InventoryHelper } from "../helpers/InventoryHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { Preset } from "../models/eft/common/IGlobals";
|
||||
import { PresetHelper } from "../helpers/PresetHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { IPreset } from "../models/eft/common/IGlobals";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { AddItem } from "../models/eft/inventory/IAddItemRequestData";
|
||||
import { ISealedAirdropContainerSettings, RewardDetails } from "../models/spt/config/IInventoryConfig";
|
||||
import { LootItem } from "../models/spt/services/LootItem";
|
||||
import { LootRequest } from "../models/spt/services/LootRequest";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { ItemFilterService } from "../services/ItemFilterService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { RagfairLinkedItemService } from "../services/RagfairLinkedItemService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
type ItemLimit = {
|
||||
current: number;
|
||||
max: number;
|
||||
};
|
||||
export declare class LootGenerator {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected inventoryHelper: InventoryHelper;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected localisationService: LocalisationService;
|
||||
protected ragfairLinkedItemService: RagfairLinkedItemService;
|
||||
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, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService);
|
||||
/**
|
||||
* Generate a list of items based on configuration options parameter
|
||||
* @param options parameters to adjust how loot is generated
|
||||
* @returns An array of loot items
|
||||
*/
|
||||
createRandomloot(options: LootRequest): LootItem[];
|
||||
createRandomLoot(options: LootRequest): LootItem[];
|
||||
/**
|
||||
* Construct item limit record to hold max and current item count
|
||||
* Construct item limit record to hold max and current item count for each item type
|
||||
* @param limits limits as defined in config
|
||||
* @returns record, key: item tplId, value: current/max item count allowed
|
||||
*/
|
||||
protected initItemLimitCounter(limits: Record<string, number>): Record<string, {
|
||||
current: number;
|
||||
max: number;
|
||||
}>;
|
||||
protected initItemLimitCounter(limits: Record<string, number>): Record<string, ItemLimit>;
|
||||
/**
|
||||
* Find a random item in items.json and add to result array
|
||||
* @param items items to choose from
|
||||
@ -60,8 +71,43 @@ export declare class LootGenerator {
|
||||
* @param result array to add found preset to
|
||||
* @returns true if preset was valid and added to pool
|
||||
*/
|
||||
protected findAndAddRandomPresetToLoot(globalDefaultPresets: [string, Preset][], itemTypeCounts: Record<string, {
|
||||
protected findAndAddRandomPresetToLoot(globalDefaultPresets: [string, IPreset][], itemTypeCounts: Record<string, {
|
||||
current: number;
|
||||
max: number;
|
||||
}>, 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 items to add to player inventory
|
||||
*/
|
||||
getSealedWeaponCaseLoot(containerSettings: ISealedAirdropContainerSettings): AddItem[];
|
||||
/**
|
||||
* 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 AddItem array
|
||||
*/
|
||||
protected getSealedContainerNonWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, weaponDetailsDb: ITemplateItem): AddItem[];
|
||||
/**
|
||||
* 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 AddItem array
|
||||
*/
|
||||
protected getSealedContainerWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, linkedItemsToWeapon: ITemplateItem[], chosenWeaponPreset: IPreset): AddItem[];
|
||||
/**
|
||||
* Handle event-related loot containers - currently just the halloween jack-o-lanterns that give food rewards
|
||||
* @param rewardContainerDetails
|
||||
* @returns AddItem array
|
||||
*/
|
||||
getRandomLootContainerLoot(rewardContainerDetails: RewardDetails): AddItem[];
|
||||
/**
|
||||
* A bug in inventoryHelper.addItem() means you cannot add the same item to the array twice with a count of 1, it causes duplication
|
||||
* Default adds 1, or increments count
|
||||
* @param itemTplToAdd items tpl we want to add to array
|
||||
* @param resultsArray Array to add item tpl to
|
||||
*/
|
||||
protected addOrIncrementItemToArray(itemTplToAdd: string, resultsArray: AddItem[]): void;
|
||||
}
|
||||
export {};
|
||||
|
18
types/generators/PMCLootGenerator.d.ts
vendored
18
types/generators/PMCLootGenerator.d.ts
vendored
@ -1,5 +1,6 @@
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { ItemFilterService } from "../services/ItemFilterService";
|
||||
@ -15,14 +16,27 @@ export declare class PMCLootGenerator {
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected pocketLootPool: string[];
|
||||
protected vestLootPool: string[];
|
||||
protected backpackLootPool: string[];
|
||||
protected botConfig: IBotConfig;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService);
|
||||
/**
|
||||
* Create an array of loot items a PMC can have in their pockets
|
||||
* @returns string array of tpls
|
||||
*/
|
||||
generatePMCPocketLootPool(): string[];
|
||||
/**
|
||||
* Create an array of loot items a PMC can have in their 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
|
||||
* @returns string array of tpls
|
||||
|
6
types/generators/RagfairAssortGenerator.d.ts
vendored
6
types/generators/RagfairAssortGenerator.d.ts
vendored
@ -1,5 +1,5 @@
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { Preset } from "../models/eft/common/IGlobals";
|
||||
import { IPreset } from "../models/eft/common/IGlobals";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
@ -36,12 +36,12 @@ export declare class RagfairAssortGenerator {
|
||||
* Get presets from globals.json
|
||||
* @returns Preset object array
|
||||
*/
|
||||
protected getPresets(): Preset[];
|
||||
protected getPresets(): IPreset[];
|
||||
/**
|
||||
* Get default presets from globals.json
|
||||
* @returns Preset object array
|
||||
*/
|
||||
protected getDefaultPresets(): Preset[];
|
||||
protected getDefaultPresets(): IPreset[];
|
||||
/**
|
||||
* Create a base assort item and return it with populated values + 999999 stack count + unlimited count = true
|
||||
* @param tplId tplid to add to item
|
||||
|
72
types/generators/RagfairOfferGenerator.d.ts
vendored
72
types/generators/RagfairOfferGenerator.d.ts
vendored
@ -48,13 +48,34 @@ export declare class RagfairOfferGenerator {
|
||||
price: number;
|
||||
}[];
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer);
|
||||
createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
|
||||
/**
|
||||
* Create a flea offer and store it in the Ragfair server offers array
|
||||
* @param userID Owner of the offer
|
||||
* @param time Time offer is listed at
|
||||
* @param items Items in the offer
|
||||
* @param barterScheme Cost of item (currency or barter)
|
||||
* @param loyalLevel Loyalty level needed to buy item
|
||||
* @param 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
|
||||
* @param offerRequirements barter requirements for offer
|
||||
* @returns rouble cost of offer
|
||||
*/
|
||||
protected calculateOfferListingPrice(offerRequirements: OfferRequirement[]): number;
|
||||
protected convertOfferRequirementsIntoRoubles(offerRequirements: OfferRequirement[]): number;
|
||||
/**
|
||||
* Get avatar url from trader table in db
|
||||
* @param isTrader Is user we're getting avatar for a trader
|
||||
@ -69,8 +90,18 @@ export declare class RagfairOfferGenerator {
|
||||
* @returns count of roubles
|
||||
*/
|
||||
protected calculateRoublePrice(currencyCount: number, currencyType: string): number;
|
||||
protected getTraderId(userID: string): string;
|
||||
protected getRating(userID: string): number;
|
||||
/**
|
||||
* Check userId, if its a player, return their pmc _id, otherwise return userId parameter
|
||||
* @param userId Users Id to check
|
||||
* @returns Users Id
|
||||
*/
|
||||
protected getTraderId(userId: string): string;
|
||||
/**
|
||||
* Get a flea trading rating for the passed in user
|
||||
* @param userId User to get flea rating of
|
||||
* @returns Flea rating value
|
||||
*/
|
||||
protected getRating(userId: string): number;
|
||||
/**
|
||||
* Is the offers user rating growing
|
||||
* @param userID user to check rating of
|
||||
@ -89,15 +120,22 @@ export declare class RagfairOfferGenerator {
|
||||
* @param expiredOffers optional, expired offers to regenerate
|
||||
*/
|
||||
generateDynamicOffers(expiredOffers?: Item[]): Promise<void>;
|
||||
/**
|
||||
*
|
||||
* @param assortItemIndex Index of assort item
|
||||
* @param assortItemsToProcess Item array containing index
|
||||
* @param expiredOffers Currently expired offers on flea
|
||||
* @param config Ragfair dynamic config
|
||||
*/
|
||||
protected createOffersForItems(assortItemIndex: string, assortItemsToProcess: Item[], expiredOffers: Item[], config: Dynamic): Promise<void>;
|
||||
/**
|
||||
* Create one flea offer for a specific item
|
||||
* @param items Item to create offer for
|
||||
* @param isPreset Is item a weapon preset
|
||||
* @param itemDetails raw db item details
|
||||
* @returns
|
||||
* @returns Item array
|
||||
*/
|
||||
protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise<Item[]>;
|
||||
protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise<void>;
|
||||
/**
|
||||
* Generate trader offers on flea using the traders assort data
|
||||
* @param traderID Trader to generate offers for
|
||||
@ -111,7 +149,7 @@ export declare class RagfairOfferGenerator {
|
||||
* @param itemDetails db details of first item
|
||||
* @returns
|
||||
*/
|
||||
protected getItemCondition(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[];
|
||||
protected randomiseItemUpdProperties(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[];
|
||||
/**
|
||||
* Get the relevant condition id if item tpl matches in ragfair.json/condition
|
||||
* @param tpl Item to look for matching condition object
|
||||
@ -142,9 +180,9 @@ export declare class RagfairOfferGenerator {
|
||||
/**
|
||||
* Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based
|
||||
* @param offerItems Items for sale in offer
|
||||
* @returns barter scheme
|
||||
* @returns Barter scheme
|
||||
*/
|
||||
protected createBarterRequirement(offerItems: Item[]): IBarterScheme[];
|
||||
protected createBarterBarterScheme(offerItems: Item[]): IBarterScheme[];
|
||||
/**
|
||||
* Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter`
|
||||
* @returns array with tpl/price values
|
||||
@ -156,19 +194,9 @@ export declare class RagfairOfferGenerator {
|
||||
/**
|
||||
* Create a random currency-based barter scheme for an array of items
|
||||
* @param offerItems 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
|
||||
*/
|
||||
protected createCurrencyRequirement(offerItems: Item[]): IBarterScheme[];
|
||||
/**
|
||||
* Create a flea offer and store it in the Ragfair server offers array
|
||||
* @param userID owner of the offer
|
||||
* @param time time offer is put up
|
||||
* @param items items in the offer
|
||||
* @param barterScheme cost of item (currency or barter)
|
||||
* @param loyalLevel Loyalty level needed to buy item
|
||||
* @param price price of offer
|
||||
* @param sellInOnePiece
|
||||
* @returns Ragfair offer
|
||||
*/
|
||||
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
|
||||
protected createCurrencyBarterScheme(offerItems: Item[], isPackOffer: boolean, multipler?: number): IBarterScheme[];
|
||||
}
|
||||
|
15
types/generators/ScavCaseRewardGenerator.d.ts
vendored
15
types/generators/ScavCaseRewardGenerator.d.ts
vendored
@ -1,5 +1,6 @@
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { Product } from "../models/eft/common/tables/IBotBase";
|
||||
import { Upd } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase";
|
||||
import { IScavCaseConfig } from "../models/spt/config/IScavCaseConfig";
|
||||
@ -24,6 +25,8 @@ export declare class ScavCaseRewardGenerator {
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected configServer: ConfigServer;
|
||||
protected scavCaseConfig: IScavCaseConfig;
|
||||
protected dbItemsCache: ITemplateItem[];
|
||||
protected dbAmmoItemsCache: ITemplateItem[];
|
||||
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
||||
/**
|
||||
* Create an array of rewards that will be given to the player upon completing their scav case build
|
||||
@ -32,12 +35,12 @@ export declare class ScavCaseRewardGenerator {
|
||||
*/
|
||||
generate(recipeId: string): Product[];
|
||||
/**
|
||||
* Get all db items that are not blacklisted in scavcase config
|
||||
* @returns filtered array of db items
|
||||
* Get all db items that are not blacklisted in scavcase config or global blacklist
|
||||
* 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 itemFilters how the rewards should be filtered down (by item count)
|
||||
* @returns
|
||||
@ -78,7 +81,7 @@ export declare class ScavCaseRewardGenerator {
|
||||
protected addStackCountToAmmoAndMoney(item: ITemplateItem, resultItem: {
|
||||
_id: string;
|
||||
_tpl: string;
|
||||
upd: any;
|
||||
upd: Upd;
|
||||
}, rarity: string): void;
|
||||
/**
|
||||
*
|
||||
@ -88,7 +91,7 @@ export declare class ScavCaseRewardGenerator {
|
||||
*/
|
||||
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
|
||||
* @returns ScavCaseRewardCountsAndPrices object
|
||||
*/
|
||||
|
8
types/generators/WeatherGenerator.d.ts
vendored
8
types/generators/WeatherGenerator.d.ts
vendored
@ -16,6 +16,11 @@ export declare class WeatherGenerator {
|
||||
protected configServer: ConfigServer;
|
||||
protected weatherConfig: IWeatherConfig;
|
||||
constructor(weightedRandomHelper: WeightedRandomHelper, logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
/**
|
||||
* Get current + raid datetime and format into correct BSG format and return
|
||||
* @param data Weather data
|
||||
* @returns IWeatherData
|
||||
*/
|
||||
calculateGameTime(data: IWeatherData): IWeatherData;
|
||||
/**
|
||||
* Get server uptime seconds multiplied by a multiplier and add to current time as seconds
|
||||
@ -33,7 +38,7 @@ export declare class WeatherGenerator {
|
||||
/**
|
||||
* Get current time formatted to fit BSGs requirement
|
||||
* @param date date to format into bsg style
|
||||
* @returns
|
||||
* @returns Time formatted in BSG format
|
||||
*/
|
||||
protected getBSGFormattedTime(date: Date): string;
|
||||
/**
|
||||
@ -47,6 +52,7 @@ export declare class WeatherGenerator {
|
||||
*/
|
||||
protected setCurrentDateTime(weather: IWeather): void;
|
||||
protected getWeightedWindDirection(): WindDirection;
|
||||
protected getWeightedClouds(): number;
|
||||
protected getWeightedWindSpeed(): number;
|
||||
protected getWeightedFog(): number;
|
||||
protected getWeightedRain(): number;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MinMax } from "../../models/common/MinMax";
|
||||
import { Inventory } from "../../models/eft/common/tables/IBotBase";
|
||||
import { GenerationData } from "../../models/eft/common/tables/IBotType";
|
||||
import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem";
|
||||
export declare class InventoryMagGen {
|
||||
private magCounts;
|
||||
@ -7,8 +7,8 @@ export declare class InventoryMagGen {
|
||||
private weaponTemplate;
|
||||
private ammoTemplate;
|
||||
private pmcInventory;
|
||||
constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory);
|
||||
getMagCount(): MinMax;
|
||||
constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory);
|
||||
getMagCount(): GenerationData;
|
||||
getMagazineTemplate(): ITemplateItem;
|
||||
getWeaponTemplate(): ITemplateItem;
|
||||
getAmmoTemplate(): ITemplateItem;
|
||||
|
25
types/helpers/AssortHelper.d.ts
vendored
25
types/helpers/AssortHelper.d.ts
vendored
@ -1,5 +1,6 @@
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { ITraderAssort } from "../models/eft/common/tables/ITrader";
|
||||
import { QuestStatus } from "../models/enums/QuestStatus";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
@ -13,14 +14,24 @@ export declare class AssortHelper {
|
||||
protected questHelper: QuestHelper;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, questHelper: QuestHelper);
|
||||
/**
|
||||
* Remove assorts from a trader that have not been unlocked yet
|
||||
* @param pmcProfile player profile
|
||||
* @param traderId traders id
|
||||
* @param assort assort items from a trader
|
||||
* @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders
|
||||
* @returns assort items minus locked quest assorts
|
||||
* Remove assorts from a trader that have not been unlocked yet (via player completing corrisponding quest)
|
||||
* @param pmcProfile Player profile
|
||||
* @param traderId Traders id the assort belongs to
|
||||
* @param traderAssorts All assort items from same trader
|
||||
* @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders (key = started/failed/complete)
|
||||
* @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
|
||||
* @param pmcProfile player profile
|
||||
|
4
types/helpers/BotDifficultyHelper.d.ts
vendored
4
types/helpers/BotDifficultyHelper.d.ts
vendored
@ -1,5 +1,5 @@
|
||||
import { Difficulty } from "../models/eft/common/tables/IBotType";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
@ -15,7 +15,7 @@ export declare class BotDifficultyHelper {
|
||||
protected localisationService: LocalisationService;
|
||||
protected botHelper: BotHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
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;
|
||||
/**
|
||||
|
15
types/helpers/BotGeneratorHelper.d.ts
vendored
15
types/helpers/BotGeneratorHelper.d.ts
vendored
@ -1,7 +1,9 @@
|
||||
import { ApplicationContext } from "../context/ApplicationContext";
|
||||
import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper";
|
||||
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "../models/spt/config/IBotConfig";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
@ -15,10 +17,12 @@ export declare class BotGeneratorHelper {
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected durabilityLimitsHelper: DurabilityLimitsHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
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
|
||||
* e.g. Repairable / HasHinge / Foldable / MaxDurability
|
||||
@ -29,6 +33,13 @@ export declare class BotGeneratorHelper {
|
||||
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): {
|
||||
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
|
||||
* @param botRole role of bot with weapon/helmet
|
||||
|
4
types/helpers/BotHelper.d.ts
vendored
4
types/helpers/BotHelper.d.ts
vendored
@ -1,6 +1,7 @@
|
||||
import { MinMax } from "../models/common/MinMax";
|
||||
import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType";
|
||||
import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
@ -15,6 +16,7 @@ export declare class BotHelper {
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
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
|
||||
@ -70,7 +72,7 @@ export declare class BotHelper {
|
||||
*/
|
||||
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
|
||||
*/
|
||||
getRandomizedPmcRole(): string;
|
||||
|
23
types/helpers/BotWeaponGeneratorHelper.d.ts
vendored
23
types/helpers/BotWeaponGeneratorHelper.d.ts
vendored
@ -1,8 +1,9 @@
|
||||
import { MinMax } from "../models/common/MinMax";
|
||||
import { Inventory } from "../models/eft/common/tables/IBotBase";
|
||||
import { GenerationData } from "../models/eft/common/tables/IBotType";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { EquipmentSlots } from "../models/enums/EquipmentSlots";
|
||||
import { ItemAddedResult } from "../models/enums/ItemAddedResult";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
@ -11,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { ContainerHelper } from "./ContainerHelper";
|
||||
import { InventoryHelper } from "./InventoryHelper";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
import { WeightedRandomHelper } from "./WeightedRandomHelper";
|
||||
export declare class BotWeaponGeneratorHelper {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
@ -18,22 +20,23 @@ export declare class BotWeaponGeneratorHelper {
|
||||
protected randomUtil: RandomUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected inventoryHelper: InventoryHelper;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected localisationService: LocalisationService;
|
||||
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
|
||||
* @param magCounts min and max count of magazines
|
||||
* @param magCounts Weights of magazines
|
||||
* @param magTemplate magazine to generate bullet count for
|
||||
* @returns bullet count number
|
||||
*/
|
||||
getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number;
|
||||
getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number;
|
||||
/**
|
||||
* Get a randomized count of magazines
|
||||
* @param magCounts min and max value returned value can be between
|
||||
* @returns numerical value of magazine count
|
||||
*/
|
||||
getRandomizedMagazineCount(magCounts: MinMax): number;
|
||||
getRandomizedMagazineCount(magCounts: GenerationData): number;
|
||||
/**
|
||||
* Is this magazine cylinder related (revolvers and grenade launchers)
|
||||
* @param magazineParentName the name of the magazines parent
|
||||
@ -47,7 +50,7 @@ export declare class BotWeaponGeneratorHelper {
|
||||
* @param magTemplate template object of magazine
|
||||
* @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)
|
||||
* @param ammoTpl Ammo tpl to add to vest/pockets
|
||||
@ -65,14 +68,14 @@ export declare class BotWeaponGeneratorHelper {
|
||||
/**
|
||||
* TODO - move into BotGeneratorHelper, this is not the class for it
|
||||
* Adds an item with all its children into specified equipmentSlots, wherever it fits.
|
||||
* @param equipmentSlots
|
||||
* @param equipmentSlots Slot to add item+children into
|
||||
* @param parentId
|
||||
* @param parentTpl
|
||||
* @param itemWithChildren
|
||||
* @param inventory
|
||||
* @param itemWithChildren Item to add
|
||||
* @param inventory Inventory to add item+children into
|
||||
* @returns a `boolean` indicating item was added
|
||||
*/
|
||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): boolean;
|
||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult;
|
||||
/**
|
||||
* is the provided item allowed inside a container
|
||||
* @param slot location item wants to be placed in
|
||||
|
32
types/helpers/ContainerHelper.d.ts
vendored
32
types/helpers/ContainerHelper.d.ts
vendored
@ -6,7 +6,35 @@ export declare class FindSlotResult {
|
||||
constructor(success?: boolean, x?: any, y?: any, rotation?: boolean);
|
||||
}
|
||||
export declare class ContainerHelper {
|
||||
protected locateSlot(container2D: number[][], containerX: number, containerY: number, x: number, y: number, itemW: number, itemH: number): boolean;
|
||||
/**
|
||||
* Finds a slot for an item in a given 2D container map
|
||||
* @param container2D Array of container with slots filled/free
|
||||
* @param itemWidth Width of item
|
||||
* @param itemHeight Height of item
|
||||
* @returns Location to place item in container
|
||||
*/
|
||||
findSlotForItem(container2D: number[][], itemWidth: number, itemHeight: number): FindSlotResult;
|
||||
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 palce item in
|
||||
* @param x Container x size
|
||||
* @param y Container y size
|
||||
* @param itemW Items width
|
||||
* @param itemH Items height
|
||||
* @param rotate is item rotated
|
||||
* @returns Location to place item
|
||||
*/
|
||||
fillContainerMapWithItem(container2D: number[][], x: number, y: number, itemW: number, itemH: number, rotate: boolean): number[][];
|
||||
}
|
||||
|
21
types/helpers/DialogueHelper.d.ts
vendored
21
types/helpers/DialogueHelper.d.ts
vendored
@ -19,19 +19,18 @@ export declare class DialogueHelper {
|
||||
protected localisationService: LocalisationService;
|
||||
protected itemHelper: ItemHelper;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper);
|
||||
createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent;
|
||||
/**
|
||||
* Add a templated message to the dialogue.
|
||||
* @param dialogueID
|
||||
* @param messageContent
|
||||
* @param sessionID
|
||||
* @param rewards
|
||||
* @deprecated Use MailSendService.sendMessage() or helpers
|
||||
*/
|
||||
addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void;
|
||||
createMessageContext(templateId: string, messageType: MessageType, maxStoreTime?: any): MessageContent;
|
||||
/**
|
||||
* @deprecated Use MailSendService.sendMessage() or helpers
|
||||
*/
|
||||
addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[], messageType?: MessageType): void;
|
||||
/**
|
||||
* Get the preview contents of the last message in a dialogue.
|
||||
* @param dialogue
|
||||
* @returns
|
||||
* @returns MessagePreview
|
||||
*/
|
||||
getMessagePreview(dialogue: Dialogue): MessagePreview;
|
||||
/**
|
||||
@ -42,4 +41,10 @@ export declare class DialogueHelper {
|
||||
* @returns
|
||||
*/
|
||||
getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[];
|
||||
/**
|
||||
* Get the dialogs dictionary for a profile, create if doesnt exist
|
||||
* @param sessionId Session/player id
|
||||
* @returns Dialog dictionary
|
||||
*/
|
||||
getDialogsForProfile(sessionId: string): Record<string, Dialogue>;
|
||||
}
|
||||
|
26
types/helpers/DurabilityLimitsHelper.d.ts
vendored
26
types/helpers/DurabilityLimitsHelper.d.ts
vendored
@ -9,9 +9,35 @@ export declare class DurabilityLimitsHelper {
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
constructor(randomUtil: RandomUtil, botHelper: BotHelper, configServer: ConfigServer);
|
||||
/**
|
||||
* Get max durability for a weapon based on bot role
|
||||
* @param itemTemplate UNUSED - Item to get durability for
|
||||
* @param botRole Role of bot to get max durability for
|
||||
* @returns Max durability of weapon
|
||||
*/
|
||||
getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number;
|
||||
/**
|
||||
* Get max durability value for armor based on bot role
|
||||
* @param itemTemplate Item to get max durability for
|
||||
* @param botRole Role of bot to get max durability for
|
||||
* @returns max durability
|
||||
*/
|
||||
getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number;
|
||||
/**
|
||||
* Get randomised current weapon durability by bot role
|
||||
* @param itemTemplate Unused - Item to get current durability of
|
||||
* @param botRole Role of bot to get current durability for
|
||||
* @param maxDurability Max durability of weapon
|
||||
* @returns Current weapon durability
|
||||
*/
|
||||
getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number;
|
||||
/**
|
||||
* Get randomised current armor durability by bot role
|
||||
* @param itemTemplate Unused - Item to get current durability of
|
||||
* @param botRole Role of bot to get current durability for
|
||||
* @param maxDurability Max durability of armor
|
||||
* @returns Current armor durability
|
||||
*/
|
||||
getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number;
|
||||
protected generateMaxWeaponDurability(botRole: string): number;
|
||||
protected generateMaxPmcArmorDurability(itemMaxDurability: number): number;
|
||||
|
26
types/helpers/HandbookHelper.d.ts
vendored
26
types/helpers/HandbookHelper.d.ts
vendored
@ -1,12 +1,12 @@
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
declare class LookupItem {
|
||||
byId: Record<number, string>;
|
||||
byParent: Record<string, string[]>;
|
||||
declare class LookupItem<T, I> {
|
||||
readonly byId: Map<string, T>;
|
||||
readonly byParent: Map<string, I[]>;
|
||||
constructor();
|
||||
}
|
||||
export declare class LookupCollection {
|
||||
items: LookupItem;
|
||||
categories: LookupItem;
|
||||
readonly items: LookupItem<number, string>;
|
||||
readonly categories: LookupItem<string, string>;
|
||||
constructor();
|
||||
}
|
||||
export declare class HandbookHelper {
|
||||
@ -14,6 +14,9 @@ export declare class HandbookHelper {
|
||||
protected lookupCacheGenerated: boolean;
|
||||
protected handbookPriceCache: LookupCollection;
|
||||
constructor(databaseServer: DatabaseServer);
|
||||
/**
|
||||
* Create an in-memory cache of all items with associated handbook price in handbookPriceCache class
|
||||
*/
|
||||
hydrateLookup(): void;
|
||||
/**
|
||||
* Get price from internal cache, if cache empty look up price directly in handbook (expensive)
|
||||
@ -23,18 +26,23 @@ export declare class HandbookHelper {
|
||||
*/
|
||||
getTemplatePrice(tpl: string): number;
|
||||
/**
|
||||
* all items in template with the given parent category
|
||||
* @param x
|
||||
* Get all items in template with the given parent category
|
||||
* @param parentId
|
||||
* @returns string array
|
||||
*/
|
||||
templatesWithParent(x: string): string[];
|
||||
templatesWithParent(parentId: string): string[];
|
||||
/**
|
||||
* Does category exist in handbook cache
|
||||
* @param category
|
||||
* @returns true if exists in cache
|
||||
*/
|
||||
isCategory(category: string): boolean;
|
||||
childrenCategories(x: string): string[];
|
||||
/**
|
||||
* Get all items associated with a categories parent
|
||||
* @param categoryParent
|
||||
* @returns string array
|
||||
*/
|
||||
childrenCategories(categoryParent: string): string[];
|
||||
/**
|
||||
* Convert non-roubles into roubles
|
||||
* @param nonRoubleCurrencyCount Currency count to convert
|
||||
|
5
types/helpers/HealthHelper.d.ts
vendored
5
types/helpers/HealthHelper.d.ts
vendored
@ -27,6 +27,7 @@ export declare class HealthHelper {
|
||||
* @param request Heal request
|
||||
* @param sessionID Session id
|
||||
* @param addEffects Should effects be added or removed (default - add)
|
||||
* @param deleteExistingEffects Should all prior effects be removed before apply new ones
|
||||
*/
|
||||
saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
|
||||
/**
|
||||
@ -53,5 +54,7 @@ export declare class HealthHelper {
|
||||
* @param duration How long the effect has left in seconds (-1 by default, no duration).
|
||||
*/
|
||||
protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string, duration?: number): void;
|
||||
protected isEmpty(map: any): boolean;
|
||||
protected isEmpty(map: Record<string, {
|
||||
Time: number;
|
||||
}>): boolean;
|
||||
}
|
||||
|
124
types/helpers/HideoutHelper.d.ts
vendored
124
types/helpers/HideoutHelper.d.ts
vendored
@ -6,6 +6,7 @@ import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hide
|
||||
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
|
||||
import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData";
|
||||
import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData";
|
||||
import { IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
@ -36,31 +37,49 @@ export declare class HideoutHelper {
|
||||
static bitcoin: string;
|
||||
static expeditionaryFuelTank: string;
|
||||
static maxSkillPoint: number;
|
||||
private static generatorOffMultipler;
|
||||
protected hideoutConfig: IHideoutConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
/**
|
||||
* Add production to profiles' Hideout.Production array
|
||||
* @param pmcData Profile to add production to
|
||||
* @param body Production request
|
||||
* @param sessionID Session id
|
||||
* @returns client response
|
||||
*/
|
||||
registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* This convenience function initializes new Production Object
|
||||
* with all the constants.
|
||||
*/
|
||||
initProduction(recipeId: string, productionTime: number): Production;
|
||||
isProductionType(productive: Productive): productive is Production;
|
||||
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
|
||||
initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production;
|
||||
/**
|
||||
* TODO:
|
||||
* After looking at the skills there doesnt seem to be a configuration per skill to boost
|
||||
* the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it)
|
||||
* and be able to tune the skill gain PER skill, but I havent tested it and Im not sure!
|
||||
* @param pmcData
|
||||
* @param bonus
|
||||
* Is the provided object a Production type
|
||||
* @param productive
|
||||
* @returns
|
||||
*/
|
||||
protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void;
|
||||
isProductionType(productive: Productive): productive is Production;
|
||||
/**
|
||||
* Apply bonus to player profile given after completing hideout upgrades
|
||||
* @param pmcData Profile to add bonus to
|
||||
* @param bonus Bonus to add to profile
|
||||
*/
|
||||
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
|
||||
/**
|
||||
* Process a players hideout, update areas that use resources + increment production timers
|
||||
* @param sessionID Session id
|
||||
*/
|
||||
updatePlayerHideout(sessionID: string): void;
|
||||
/**
|
||||
* Get various properties that will be passed to hideout update-related functions
|
||||
* @param pmcData Player profile
|
||||
* @returns Properties
|
||||
*/
|
||||
protected getHideoutProperties(pmcData: IPmcData): {
|
||||
btcFarmCGs: number;
|
||||
isGeneratorOn: boolean;
|
||||
waterCollectorHasFilter: boolean;
|
||||
};
|
||||
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
|
||||
/**
|
||||
* Update progress timer for water collector
|
||||
* @param pmcData profile to update
|
||||
@ -119,9 +138,8 @@ export declare class HideoutHelper {
|
||||
isGeneratorOn: boolean;
|
||||
waterCollectorHasFilter: boolean;
|
||||
}): void;
|
||||
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
|
||||
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
|
||||
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void;
|
||||
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
|
||||
/**
|
||||
* Adjust water filter objects resourceValue or delete when they reach 0 resource
|
||||
* @param waterFilterArea water filter area to update
|
||||
@ -131,25 +149,81 @@ export declare class HideoutHelper {
|
||||
* @returns Updated HideoutArea object
|
||||
*/
|
||||
protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea;
|
||||
/**
|
||||
* Get an adjusted water filter drain rate based on time elapsed since last run,
|
||||
* handle edge case when craft time has gone on longer than total production time
|
||||
* @param secondsSinceServerTick Time passed
|
||||
* @param totalProductionTime Total time collecting water
|
||||
* @param productionProgress how far water collector has progressed
|
||||
* @param baseFilterDrainRate Base drain rate
|
||||
* @returns
|
||||
*/
|
||||
protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number;
|
||||
/**
|
||||
* Get the water filter drain rate based on hideout bonues player has
|
||||
* @param pmcData Player profile
|
||||
* @returns Drain rate
|
||||
*/
|
||||
protected getWaterFilterDrainRate(pmcData: IPmcData): number;
|
||||
/**
|
||||
* Get the production time in seconds for the desired production
|
||||
* @param prodId Id, e.g. Water collector id
|
||||
* @returns seconds to produce item
|
||||
*/
|
||||
protected getTotalProductionTimeSeconds(prodId: string): number;
|
||||
/**
|
||||
* Create a upd object using passed in parameters
|
||||
* @param stackCount
|
||||
* @param resourceValue
|
||||
* @param resourceUnitsConsumed
|
||||
* @returns Upd
|
||||
*/
|
||||
protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd;
|
||||
protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): void;
|
||||
protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production;
|
||||
/**
|
||||
* Add bitcoin object to btc production products array and set progress time
|
||||
* @param btcProd Bitcoin production object
|
||||
* @param coinCraftTimeSeconds Time to craft a bitcoin
|
||||
*/
|
||||
protected addBtcToProduction(btcProd: Production, coinCraftTimeSeconds: number): void;
|
||||
/**
|
||||
* Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off
|
||||
* @param pmcData Player profile
|
||||
* @param isGeneratorOn Is the generator on for the duration of elapsed time
|
||||
* @param recipe Hideout production recipe being crafted we need the ticks for
|
||||
* @returns Amount of time elapsed in seconds
|
||||
*/
|
||||
protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number;
|
||||
/**
|
||||
* Get a count of how many BTC can be gathered by the profile
|
||||
* @param pmcData Profile to look up
|
||||
* @returns coin slot count
|
||||
*/
|
||||
protected getBTCSlots(pmcData: IPmcData): number;
|
||||
protected getManagementSkillsSlots(): number;
|
||||
protected hasManagementSkillSlots(pmcData: IPmcData): boolean;
|
||||
protected getHideoutManagementSkill(pmcData: IPmcData): Common;
|
||||
protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number;
|
||||
/**
|
||||
* Get the crafting skill details from player profile
|
||||
* @param pmcData Player profile
|
||||
* @returns crafting skill, null if not found
|
||||
* Does profile have elite hideout management skill
|
||||
* @param pmcData Profile to look at
|
||||
* @returns True if profile has skill
|
||||
*/
|
||||
protected getCraftingSkill(pmcData: IPmcData): Common;
|
||||
protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean;
|
||||
/**
|
||||
* Get a count of bitcoins player miner can hold
|
||||
*/
|
||||
protected getBitcoinMinerContainerSlotSize(): number;
|
||||
/**
|
||||
* Get the hideout management skill from player profile
|
||||
* @param pmcData Profile to look at
|
||||
* @returns Hideout management skill object
|
||||
*/
|
||||
protected getHideoutManagementSkill(pmcData: IPmcData): Common;
|
||||
/**
|
||||
* HideoutManagement skill gives a consumption bonus the higher the level
|
||||
* 0.5% per level per 1-51, (25.5% at max)
|
||||
* @param pmcData Profile to get hideout consumption level level from
|
||||
* @returns consumption bonus
|
||||
*/
|
||||
protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number;
|
||||
/**
|
||||
* Adjust craft time based on crafting skill level found in player profile
|
||||
* @param pmcData Player profile
|
||||
@ -168,7 +242,13 @@ export declare class HideoutHelper {
|
||||
*/
|
||||
getBTC(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionId: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Upgrade hideout wall from starting level to interactable level if enough time has passed
|
||||
* Create a single bitcoin request object
|
||||
* @param pmcData Player profile
|
||||
* @returns IAddItemRequestData
|
||||
*/
|
||||
protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData;
|
||||
/**
|
||||
* Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded
|
||||
* @param pmcProfile Profile to upgrade wall in
|
||||
*/
|
||||
unlockHideoutWallInProfile(pmcProfile: IPmcData): void;
|
||||
|
9
types/helpers/HttpServerHelper.d.ts
vendored
9
types/helpers/HttpServerHelper.d.ts
vendored
@ -16,8 +16,17 @@ export declare class HttpServerHelper {
|
||||
};
|
||||
constructor(configServer: ConfigServer);
|
||||
getMimeText(key: string): string;
|
||||
/**
|
||||
* Combine ip and port into url
|
||||
* @returns url
|
||||
*/
|
||||
buildUrl(): string;
|
||||
/**
|
||||
* Prepend http to the url:port
|
||||
* @returns URI
|
||||
*/
|
||||
getBackendUrl(): string;
|
||||
/** Get websocket url + port */
|
||||
getWebsocketUrl(): string;
|
||||
sendTextJson(resp: any, output: any): void;
|
||||
}
|
||||
|
77
types/helpers/InRaidHelper.d.ts
vendored
77
types/helpers/InRaidHelper.d.ts
vendored
@ -1,27 +1,42 @@
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Victim } from "../models/eft/common/tables/IBotBase";
|
||||
import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
|
||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
||||
import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { ProfileFixerService } from "../services/ProfileFixerService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { InventoryHelper } from "./InventoryHelper";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
import { PaymentHelper } from "./PaymentHelper";
|
||||
import { QuestHelper } from "./QuestHelper";
|
||||
export declare class InRaidHelper {
|
||||
protected logger: ILogger;
|
||||
protected saveServer: SaveServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected inventoryHelper: InventoryHelper;
|
||||
protected questHelper: QuestHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected localisationService: LocalisationService;
|
||||
protected profileFixerService: ProfileFixerService;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService);
|
||||
protected configServer: ConfigServer;
|
||||
protected lostOnDeathConfig: ILostOnDeathConfig;
|
||||
protected inRaidConfig: IInRaidConfig;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer);
|
||||
/**
|
||||
* Check an array of items and add an upd object to money items with a stack count of 1
|
||||
* Lookup quest item loss from lostOnDeath config
|
||||
* @returns True if items should be removed from inventory
|
||||
*/
|
||||
removeQuestItemsOnDeath(): boolean;
|
||||
/**
|
||||
* Check items array and add an upd object to money with a stack count of 1
|
||||
* Single stack money items have no upd object and thus no StackObjectsCount, causing issues
|
||||
* @param items Items array to check
|
||||
*/
|
||||
@ -33,6 +48,12 @@ export declare class InRaidHelper {
|
||||
* @returns adjusted karma level after kills are taken into account
|
||||
*/
|
||||
calculateFenceStandingChangeFromKills(existingFenceStanding: number, victims: Victim[]): number;
|
||||
/**
|
||||
* Get the standing gain/loss for killing an npc
|
||||
* @param victim Who was killed by player
|
||||
* @returns a numerical standing gain or loss
|
||||
*/
|
||||
protected getFenceStandingChangeForKillAsScav(victim: Victim): number;
|
||||
/**
|
||||
* Reset a profile to a baseline, used post-raid
|
||||
* Reset points earned during session property
|
||||
@ -44,12 +65,27 @@ export declare class InRaidHelper {
|
||||
* @returns Reset profile object
|
||||
*/
|
||||
updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): IPmcData;
|
||||
/**
|
||||
* Look for quests not are now status = fail that were not failed pre-raid and run the failQuest() function
|
||||
* @param sessionId Player id
|
||||
* @param pmcData Player profile
|
||||
* @param preRaidQuests Quests prior to starting raid
|
||||
* @param postRaidQuests Quest after raid
|
||||
*/
|
||||
protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void;
|
||||
protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void;
|
||||
/**
|
||||
* Take body part effects from client profile and apply to server profile
|
||||
* @param saveProgressRequest post-raid request
|
||||
* @param profileData player profile on server
|
||||
*/
|
||||
protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void;
|
||||
/**
|
||||
* Adjust server trader settings if they differ from data sent by client
|
||||
* @param tradersServerProfile Server
|
||||
* @param tradersClientProfile Client
|
||||
*/
|
||||
protected applyTraderStandingAdjustments(tradersServerProfile: Record<string, TraderInfo>, tradersClientProfile: Record<string, TraderInfo>): void;
|
||||
/**
|
||||
* Some maps have one-time-use keys (e.g. Labs
|
||||
* Remove the relevant key from an inventory based on the post-raid request data passed in
|
||||
@ -62,28 +98,19 @@ export declare class InRaidHelper {
|
||||
* @param sessionID Session id
|
||||
*/
|
||||
protected setPlayerInRaidLocationStatusToNone(sessionID: string): void;
|
||||
/**
|
||||
* Adds SpawnedInSession property to items found in a raid
|
||||
* Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true
|
||||
* @param preRaidProfile profile to update
|
||||
* @param postRaidProfile profile to update inventory contents of
|
||||
* @param isPlayerScav Was this a p scav raid
|
||||
* @returns
|
||||
*/
|
||||
addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData;
|
||||
/**
|
||||
* Iterate over inventory items and remove the property that defines an item as Found in Raid
|
||||
* Only removes property if item had FiR when entering raid
|
||||
* @param postRaidProfile profile to update items for
|
||||
* @returns Updated profile with SpawnedInSession removed
|
||||
*/
|
||||
removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData;
|
||||
removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData;
|
||||
/**
|
||||
* Update a players inventory post-raid
|
||||
* Remove equipped items from pre-raid
|
||||
* Add new items found in raid to profile
|
||||
* Store insurance items in profile
|
||||
* @param sessionID
|
||||
* @param sessionID Session id
|
||||
* @param pmcData Profile to update
|
||||
* @param postRaidProfile Profile returned by client after a raid
|
||||
* @returns Updated profile
|
||||
@ -94,15 +121,27 @@ export declare class InRaidHelper {
|
||||
* Used post-raid to remove items after death
|
||||
* @param pmcData Player profile
|
||||
* @param sessionID Session id
|
||||
* @returns Player profile with pmc inventory cleared
|
||||
*/
|
||||
deleteInventory(pmcData: IPmcData, sessionID: string): IPmcData;
|
||||
deleteInventory(pmcData: IPmcData, sessionID: string): void;
|
||||
/**
|
||||
* Get an array of items from a profile that will be lost on death
|
||||
* @param pmcProfile Profile to get items from
|
||||
* @returns Array of items lost on death
|
||||
*/
|
||||
protected getInventoryItemsLostOnDeath(pmcProfile: IPmcData): Item[];
|
||||
/**
|
||||
* Get items in vest/pocket/backpack inventory containers (excluding children)
|
||||
* @param pmcData Player profile
|
||||
* @returns Item array
|
||||
*/
|
||||
protected getBaseItemsInRigPocketAndBackpack(pmcData: IPmcData): Item[];
|
||||
/**
|
||||
* Does the provided items slotId mean its kept on the player after death
|
||||
* @param slotId slotid of item to check
|
||||
* @pmcData Player profile
|
||||
* @itemToCheck Item to check should be kept
|
||||
* @returns true if item is kept after death
|
||||
*/
|
||||
isItemKeptAfterDeath(slotId: string): boolean;
|
||||
protected isItemKeptAfterDeath(pmcData: IPmcData, itemToCheck: Item): boolean;
|
||||
/**
|
||||
* Return the equipped items from a players inventory
|
||||
* @param items Players inventory to search through
|
||||
|
91
types/helpers/InventoryHelper.d.ts
vendored
91
types/helpers/InventoryHelper.d.ts
vendored
@ -1,9 +1,11 @@
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Inventory } from "../models/eft/common/tables/IBotBase";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData";
|
||||
import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject";
|
||||
import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData";
|
||||
import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData";
|
||||
import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData";
|
||||
import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig";
|
||||
@ -22,7 +24,9 @@ import { PaymentHelper } from "./PaymentHelper";
|
||||
import { ProfileHelper } from "./ProfileHelper";
|
||||
import { TraderAssortHelper } from "./TraderAssortHelper";
|
||||
export interface OwnerInventoryItems {
|
||||
/** Inventory items from source */
|
||||
from: Item[];
|
||||
/** Inventory items at destination */
|
||||
to: Item[];
|
||||
sameInventory: boolean;
|
||||
isMail: boolean;
|
||||
@ -53,20 +57,34 @@ export declare class InventoryHelper {
|
||||
* @param callback Code to execute later (function)
|
||||
* @param foundInRaid Will results added to inventory be set as found in raid
|
||||
* @param addUpd Additional upd properties for items being added to inventory
|
||||
* @param useSortingTable Allow items to go into sorting table when stash has no space
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
addItem(pmcData: IPmcData, request: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: {
|
||||
(): void;
|
||||
}, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse;
|
||||
addItem(pmcData: IPmcData, request: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: () => void, foundInRaid?: boolean, addUpd?: any, useSortingTable?: boolean): IItemEventRouterResponse;
|
||||
/**
|
||||
* Take the given item, find a free slot in passed in inventory and place it there
|
||||
* If no space in inventory, place in sorting table
|
||||
* @param itemToAdd Item to add to inventory
|
||||
* @param stashFS2D Two dimentional stash map
|
||||
* @param sortingTableFS2D Two dimentional sorting table stash map
|
||||
* @param itemLib
|
||||
* @param pmcData Player profile
|
||||
* @param useSortingTable Should sorting table be used for overflow items when no inventory space for item
|
||||
* @param output Client output object
|
||||
* @returns Client error output if placing item failed
|
||||
*/
|
||||
protected placeItemInInventory(itemToAdd: IAddItemTempObject, stashFS2D: number[][], sortingTableFS2D: number[][], itemLib: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Add ammo to ammo boxes
|
||||
* @param itemToAdd Item to check is ammo box
|
||||
* @param toDo
|
||||
* @param parentId Ammo box parent id
|
||||
* @param output IItemEventRouterResponse object
|
||||
* @param sessionID Session id
|
||||
* @param pmcData Profile to add ammobox to
|
||||
* @param output object to send to client
|
||||
* @param foundInRaid should ammo be FiR
|
||||
*/
|
||||
protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, toDo: string[][], sessionID: string, output: IItemEventRouterResponse): void;
|
||||
protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void;
|
||||
/**
|
||||
*
|
||||
* @param assortItems Items to add to inventory
|
||||
@ -75,23 +93,31 @@ export declare class InventoryHelper {
|
||||
*/
|
||||
protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void;
|
||||
/**
|
||||
* Remove item from player inventory
|
||||
* @param pmcData Profile to remove item from
|
||||
* Handle Remove event
|
||||
* Remove item from player inventory + insured items array
|
||||
* Also deletes child items
|
||||
* @param profile Profile to remove item from (pmc or scav)
|
||||
* @param itemId Items id to remove
|
||||
* @param sessionID Session id
|
||||
* @param output Existing IItemEventRouterResponse object to append data to, creates new one by default if not supplied
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
removeItem(profile: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): Record<number, number>;
|
||||
protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): Record<number, number>;
|
||||
getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[];
|
||||
protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[];
|
||||
protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash;
|
||||
getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][];
|
||||
/**
|
||||
* Return the inventory that needs to be modified (scav/pmc etc)
|
||||
* Changes made to result apply to character inventory
|
||||
* Based on the item action, determine whose inventories we should be looking at for from and to.
|
||||
* @param request Item interaction request
|
||||
* @param sessionId Session id / playerid
|
||||
* @returns OwnerInventoryItems with inventory of player/scav to adjust
|
||||
*/
|
||||
getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems;
|
||||
getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems;
|
||||
/**
|
||||
* Made a 2d array table with 0 - free slot and 1 - used slot
|
||||
* @param {Object} pmcData
|
||||
@ -99,19 +125,43 @@ export declare class InventoryHelper {
|
||||
* @returns Array
|
||||
*/
|
||||
protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][];
|
||||
protected getStashType(sessionID: string): string;
|
||||
protected getSortingTableSlotMap(pmcData: IPmcData): number[][];
|
||||
/**
|
||||
* Get Player Stash Proper Size
|
||||
* @param sessionID Playerid
|
||||
* @returns Array of 2 values, x and y stash size
|
||||
*/
|
||||
protected getPlayerStashSize(sessionID: string): Record<number, number>;
|
||||
/**
|
||||
* Internal helper function to transfer an item from one profile to another.
|
||||
* fromProfileData: Profile of the source.
|
||||
* toProfileData: Profile of the destination.
|
||||
* body: Move request
|
||||
*/
|
||||
* Get the players stash items tpl
|
||||
* @param sessionID Player id
|
||||
* @returns Stash tpl
|
||||
*/
|
||||
protected getStashType(sessionID: string): string;
|
||||
/**
|
||||
* Internal helper function to transfer an item from one profile to another.
|
||||
* @param fromItems Inventory of the source (can be non-player)
|
||||
* @param toItems Inventory of the destination
|
||||
* @param body Move request
|
||||
*/
|
||||
moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void;
|
||||
/**
|
||||
* Internal helper function to move item within the same profile_f.
|
||||
*/
|
||||
moveItemInternal(inventoryItems: Item[], body: IInventoryMoveRequestData): void;
|
||||
* Internal helper function to move item within the same profile_f.
|
||||
* @param pmcData profile to edit
|
||||
* @param inventoryItems
|
||||
* @param moveRequest
|
||||
* @returns True if move was successful
|
||||
*/
|
||||
moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): {
|
||||
success: boolean;
|
||||
errorMessage?: string;
|
||||
};
|
||||
/**
|
||||
* Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access
|
||||
* @param pmcData Player profile
|
||||
* @param itemBeingMoved item being moved
|
||||
*/
|
||||
protected updateFastPanelBinding(pmcData: IPmcData, itemBeingMoved: Item): void;
|
||||
/**
|
||||
* Internal helper function to handle cartridges in inventory if any of them exist.
|
||||
*/
|
||||
@ -122,6 +172,7 @@ export declare class InventoryHelper {
|
||||
* @returns Reward details
|
||||
*/
|
||||
getRandomLootContainerRewardDetails(itemTpl: string): RewardDetails;
|
||||
getInventoryConfig(): IInventoryConfig;
|
||||
}
|
||||
declare namespace InventoryHelper {
|
||||
interface InventoryItemHash {
|
||||
|
140
types/helpers/ItemHelper.d.ts
vendored
140
types/helpers/ItemHelper.d.ts
vendored
@ -26,6 +26,7 @@ declare class ItemHelper {
|
||||
protected itemBaseClassService: ItemBaseClassService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected localeService: LocaleService;
|
||||
protected readonly defaultInvalidBaseTypes: string[];
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService);
|
||||
/**
|
||||
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash
|
||||
@ -51,11 +52,34 @@ declare class ItemHelper {
|
||||
/**
|
||||
* Returns the item price based on the handbook or as a fallback from the prices.json if the item is not
|
||||
* found in the handbook. If the price can't be found at all return 0
|
||||
*
|
||||
* @param {string} tpl the item template to check
|
||||
* @returns {integer} The price of the item or 0 if not found
|
||||
* @param tpl Item to look price up of
|
||||
* @returns Price in roubles
|
||||
*/
|
||||
getItemPrice(tpl: string): number;
|
||||
/**
|
||||
* Returns the item price based on the handbook or as a fallback from the prices.json if the item is not
|
||||
* found in the handbook. If the price can't be found at all return 0
|
||||
* @param tpl Item to look price up of
|
||||
* @returns Price in roubles
|
||||
*/
|
||||
getItemMaxPrice(tpl: string): number;
|
||||
/**
|
||||
* Get the static (handbook) price in roubles for an item by tpl
|
||||
* @param tpl Items tpl id to look up price
|
||||
* @returns Price in roubles (0 if not found)
|
||||
*/
|
||||
getStaticItemPrice(tpl: string): number;
|
||||
/**
|
||||
* Get the dynamic (flea) price in roubles for an item by tpl
|
||||
* @param tpl Items tpl id to look up price
|
||||
* @returns Price in roubles (undefined if not found)
|
||||
*/
|
||||
getDynamicItemPrice(tpl: string): number;
|
||||
/**
|
||||
* Update items upd.StackObjectsCount to be 1 if its upd is missing or StackObjectsCount is undefined
|
||||
* @param item Item to update
|
||||
* @returns Fixed item
|
||||
*/
|
||||
fixItemStackCount(item: Item): Item;
|
||||
/**
|
||||
* AmmoBoxes contain StackSlots which need to be filled for the AmmoBox to have content.
|
||||
@ -105,6 +129,7 @@ declare class ItemHelper {
|
||||
* @returns bool - is valid + template item object as array
|
||||
*/
|
||||
getItem(tpl: string): [boolean, ITemplateItem];
|
||||
isItemInDb(tpl: string): boolean;
|
||||
/**
|
||||
* get normalized value (0-1) based on item condition
|
||||
* @param item
|
||||
@ -113,19 +138,19 @@ declare class ItemHelper {
|
||||
getItemQualityModifier(item: Item): number;
|
||||
/**
|
||||
* Get a quality value based on a repairable items (weapon/armor) current state between current and max durability
|
||||
* @param itemDetails
|
||||
* @param repairable repairable object
|
||||
* @param item
|
||||
* @returns a number between 0 and 1
|
||||
* @param itemDetails Db details for item we want quality value for
|
||||
* @param repairable Repairable properties
|
||||
* @param item Item quality value is for
|
||||
* @returns A number between 0 and 1
|
||||
*/
|
||||
protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number;
|
||||
/**
|
||||
* Recursive function that looks at every item from parameter and gets their childrens Ids
|
||||
* @param items
|
||||
* @param itemID
|
||||
* Recursive function that looks at every item from parameter and gets their childrens Ids + includes parent item in results
|
||||
* @param items Array of items (item + possible children)
|
||||
* @param itemId Parent items id
|
||||
* @returns an array of strings
|
||||
*/
|
||||
findAndReturnChildrenByItems(items: Item[], itemID: string): string[];
|
||||
findAndReturnChildrenByItems(items: Item[], itemId: string): string[];
|
||||
/**
|
||||
* A variant of findAndReturnChildren where the output is list of item objects instead of their ids.
|
||||
* @param items
|
||||
@ -152,12 +177,6 @@ declare class ItemHelper {
|
||||
* @returns true if it is a dogtag
|
||||
*/
|
||||
isDogtag(tpl: string): boolean;
|
||||
/**
|
||||
* Can the item passed in be sold to a trader because it is raw money
|
||||
* @param tpl Item template id to check
|
||||
* @returns true if unsellable
|
||||
*/
|
||||
isNotSellable(tpl: string): boolean;
|
||||
/**
|
||||
* Gets the identifier for a child using slotId, locationX and locationY.
|
||||
* @param item
|
||||
@ -171,57 +190,100 @@ declare class ItemHelper {
|
||||
*/
|
||||
isItemTplStackable(tpl: string): boolean;
|
||||
/**
|
||||
* split item stack if it exceeds StackMaxSize
|
||||
* split item stack if it exceeds its items StackMaxSize property
|
||||
* @param itemToSplit Item to split into smaller stacks
|
||||
* @returns Array of split items
|
||||
*/
|
||||
splitStack(item: Item): Item[];
|
||||
splitStack(itemToSplit: Item): Item[];
|
||||
/**
|
||||
* Find Barter items in the inventory
|
||||
* @param {string} by
|
||||
* @param {Object} pmcData
|
||||
* Find Barter items from array of items
|
||||
* @param {string} by tpl or id
|
||||
* @param {Item[]} items Array of items to iterate over
|
||||
* @param {string} barterItemId
|
||||
* @returns Array of Item objects
|
||||
*/
|
||||
findBarterItems(by: string, pmcData: IPmcData, barterItemId: string): Item[];
|
||||
findBarterItems(by: "tpl" | "id", items: Item[], barterItemId: string): Item[];
|
||||
/**
|
||||
*
|
||||
* @param pmcData
|
||||
* @param items
|
||||
* Regenerate all guids with new ids, exceptions are for items that cannot be altered (e.g. stash/sorting table)
|
||||
* @param pmcData Player profile
|
||||
* @param items Items to adjust ID values of
|
||||
* @param insuredItems insured items to not replace ids for
|
||||
* @param fastPanel
|
||||
* @returns
|
||||
* @returns Item[]
|
||||
*/
|
||||
replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[];
|
||||
replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): Item[];
|
||||
/**
|
||||
* WARNING, SLOW. Recursively loop down through an items hierarchy to see if any of the ids match the supplied list, return true if any do
|
||||
* @param {string} tpl
|
||||
* @param {Array} tplsToCheck
|
||||
* @returns boolean
|
||||
* @param {string} tpl Items tpl to check parents of
|
||||
* @param {Array} tplsToCheck Tpl values to check if parents of item match
|
||||
* @returns boolean Match found
|
||||
*/
|
||||
doesItemOrParentsIdMatch(tpl: string, tplsToCheck: string[]): boolean;
|
||||
/**
|
||||
* Return true if item is a quest item
|
||||
* @param {string} tpl
|
||||
* @returns boolean
|
||||
* Check if item is quest item
|
||||
* @param tpl Items tpl to check quest status of
|
||||
* @returns true if item is flagged as quest item
|
||||
*/
|
||||
isQuestItem(tpl: string): boolean;
|
||||
/**
|
||||
* Get the inventory size of an item
|
||||
* @param items
|
||||
* @param items Item with children
|
||||
* @param rootItemId
|
||||
* @returns ItemSize object (width and height)
|
||||
*/
|
||||
getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize;
|
||||
/**
|
||||
* Get a random cartridge from an items Filter property
|
||||
* @param item
|
||||
* @returns
|
||||
* @param item Db item template to look up Cartridge filter values from
|
||||
* @returns Caliber of cartridge
|
||||
*/
|
||||
getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string;
|
||||
createRandomMagCartridges(magTemplate: ITemplateItem, parentId: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, caliber?: string): Item;
|
||||
/**
|
||||
* Add cartridges to the ammo box with correct max stack sizes
|
||||
* @param ammoBox Box to add cartridges to
|
||||
* @param ammoBoxDetails Item template from items db
|
||||
*/
|
||||
addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void;
|
||||
/**
|
||||
* Check if item is stored inside of a container
|
||||
* @param item Item to check is inside of container
|
||||
* @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack
|
||||
* @param items Inventory with child parent items to check
|
||||
* @returns True when item is in container
|
||||
*/
|
||||
itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean;
|
||||
/**
|
||||
* Add child items (cartridges) to a magazine
|
||||
* @param magazine Magazine to add child items to
|
||||
* @param magTemplate Db template of magazine
|
||||
* @param staticAmmoDist Cartridge distribution
|
||||
* @param caliber Caliber of cartridge to add to magazine
|
||||
* @param minSizePercent % the magazine must be filled to
|
||||
*/
|
||||
fillMagazineWithRandomCartridge(magazine: Item[], magTemplate: ITemplateItem, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, caliber?: string, minSizePercent?: number): void;
|
||||
/**
|
||||
* Add child items to a magazine of a specific cartridge
|
||||
* @param magazine Magazine to add child items to
|
||||
* @param magTemplate Db template of magazine
|
||||
* @param cartridgeTpl Cartridge to add to magazine
|
||||
* @param minSizePercent % the magazine must be filled to
|
||||
*/
|
||||
fillMagazineWithCartridge(magazine: Item[], magTemplate: ITemplateItem, cartridgeTpl: string, minSizePercent?: number): void;
|
||||
/**
|
||||
* Choose a random bullet type from the list of possible a magazine has
|
||||
* @param magTemplate Magazine template from Db
|
||||
* @returns Tpl of cartridge
|
||||
*/
|
||||
protected getRandomValidCaliber(magTemplate: ITemplateItem): string;
|
||||
/**
|
||||
* Chose a randomly weighted cartridge that fits
|
||||
* @param caliber Desired caliber
|
||||
* @param staticAmmoDist Cartridges and thier weights
|
||||
* @returns Tpl of cartrdige
|
||||
*/
|
||||
protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string;
|
||||
/**
|
||||
*
|
||||
* Create a basic cartrige object
|
||||
* @param parentId container cartridges will be placed in
|
||||
* @param ammoTpl Cartridge to insert
|
||||
* @param stackCount Count of cartridges inside parent
|
||||
|
26
types/helpers/NotificationSendHelper.d.ts
vendored
26
types/helpers/NotificationSendHelper.d.ts
vendored
@ -1,12 +1,36 @@
|
||||
import { INotification } from "../models/eft/notifier/INotifier";
|
||||
import { Dialogue, IUserDialogInfo } from "../models/eft/profile/IAkiProfile";
|
||||
import { MessageType } from "../models/enums/MessageType";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { WebSocketServer } from "../servers/WebSocketServer";
|
||||
import { NotificationService } from "../services/NotificationService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
export declare class NotificationSendHelper {
|
||||
protected webSocketServer: WebSocketServer;
|
||||
protected hashUtil: HashUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected notificationService: NotificationService;
|
||||
constructor(webSocketServer: WebSocketServer, notificationService: NotificationService);
|
||||
constructor(webSocketServer: WebSocketServer, hashUtil: HashUtil, saveServer: SaveServer, notificationService: NotificationService);
|
||||
/**
|
||||
* Send notification message to the appropriate channel
|
||||
* @param sessionID
|
||||
* @param notificationMessage
|
||||
*/
|
||||
sendMessage(sessionID: string, notificationMessage: INotification): void;
|
||||
/**
|
||||
* Send a message directly to the player
|
||||
* @param sessionId Session id
|
||||
* @param senderDetails Who is sendin the message to player
|
||||
* @param messageText Text to send player
|
||||
* @param messageType Underlying type of message being sent
|
||||
*/
|
||||
sendMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, messageText: string, messageType: MessageType): void;
|
||||
/**
|
||||
* Helper function for sendMessageToPlayer(), get new dialog for storage in profile or find existing by sender id
|
||||
* @param sessionId Session id
|
||||
* @param messageType Type of message to generate
|
||||
* @param senderDetails Who is sending the message
|
||||
* @returns Dialogue
|
||||
*/
|
||||
protected getDialog(sessionId: string, messageType: MessageType, senderDetails: IUserDialogInfo): Dialogue;
|
||||
}
|
||||
|
13
types/helpers/NotifierHelper.d.ts
vendored
13
types/helpers/NotifierHelper.d.ts
vendored
@ -9,9 +9,18 @@ export declare class NotifierHelper {
|
||||
protected defaultNotification: INotification;
|
||||
constructor(httpServerHelper: HttpServerHelper);
|
||||
getDefaultNotification(): INotification;
|
||||
/** Creates a new notification that displays the "Your offer was sold!" prompt and removes sold offer from "My Offers" on clientside */
|
||||
/**
|
||||
* Create a new notification that displays the "Your offer was sold!" prompt and removes sold offer from "My Offers" on clientside
|
||||
* @param dialogueMessage Message from dialog that was sent
|
||||
* @param ragfairData Ragfair data to attach to notification
|
||||
* @returns
|
||||
*/
|
||||
createRagfairOfferSoldNotification(dialogueMessage: Message, ragfairData: MessageContentRagfair): INotification;
|
||||
/** Creates a new notification with the specified dialogueMessage object. */
|
||||
/**
|
||||
* Create a new notification with the specified dialogueMessage object
|
||||
* @param dialogueMessage
|
||||
* @returns
|
||||
*/
|
||||
createNewMessageNotification(dialogueMessage: Message): INotification;
|
||||
getWebSocketServer(sessionID: string): string;
|
||||
}
|
||||
|
7
types/helpers/PaymentHelper.d.ts
vendored
7
types/helpers/PaymentHelper.d.ts
vendored
@ -1,6 +1,11 @@
|
||||
import { IInventoryConfig } from "../models/spt/config/IInventoryConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
export declare class PaymentHelper {
|
||||
protected configServer: ConfigServer;
|
||||
protected inventoryConfig: IInventoryConfig;
|
||||
constructor(configServer: ConfigServer);
|
||||
/**
|
||||
* Check whether tpl is Money
|
||||
* Is the passed in tpl money (also checks custom currencies in inventoryConfig.customMoneyTpls)
|
||||
* @param {string} tpl
|
||||
* @returns void
|
||||
*/
|
||||
|
17
types/helpers/PresetHelper.d.ts
vendored
17
types/helpers/PresetHelper.d.ts
vendored
@ -1,18 +1,23 @@
|
||||
import { Preset } from "../models/eft/common/IGlobals";
|
||||
import { IPreset } from "../models/eft/common/IGlobals";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class PresetHelper {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected lookup: Record<string, string[]>;
|
||||
protected defaultPresets: Record<string, Preset>;
|
||||
protected defaultPresets: Record<string, IPreset>;
|
||||
constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer);
|
||||
hydratePresetStore(input: Record<string, string[]>): void;
|
||||
getDefaultPresets(): Record<string, Preset>;
|
||||
getDefaultPresets(): Record<string, IPreset>;
|
||||
isPreset(id: string): boolean;
|
||||
hasPreset(templateId: string): boolean;
|
||||
getPreset(id: string): Preset;
|
||||
getPresets(templateId: string): Preset[];
|
||||
getDefaultPreset(templateId: string): Preset;
|
||||
getPreset(id: string): IPreset;
|
||||
getPresets(templateId: string): IPreset[];
|
||||
/**
|
||||
* Get the default preset for passed in weapon id
|
||||
* @param templateId Weapon id to get preset for
|
||||
* @returns Null if no default preset, otherwise IPreset
|
||||
*/
|
||||
getDefaultPreset(templateId: string): IPreset;
|
||||
getBaseItemTpl(presetId: string): string;
|
||||
}
|
||||
|
44
types/helpers/ProfileHelper.d.ts
vendored
44
types/helpers/ProfileHelper.d.ts
vendored
@ -1,5 +1,5 @@
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Stats } from "../models/eft/common/tables/IBotBase";
|
||||
import { CounterKeyValue, Stats } from "../models/eft/common/tables/IBotBase";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
@ -20,7 +20,12 @@ export declare class ProfileHelper {
|
||||
protected itemHelper: ItemHelper;
|
||||
protected profileSnapshotService: ProfileSnapshotService;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService);
|
||||
resetProfileQuestCondition(sessionID: string, conditionId: string): void;
|
||||
/**
|
||||
* Remove/reset a completed quest condtion from players profile quest data
|
||||
* @param sessionID Session id
|
||||
* @param questConditionId Quest with condition to remove
|
||||
*/
|
||||
removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record<string, string>): void;
|
||||
/**
|
||||
* Get all profiles from server
|
||||
* @returns Dictionary of profiles
|
||||
@ -40,7 +45,16 @@ export declare class ProfileHelper {
|
||||
* @returns updated profile array
|
||||
*/
|
||||
protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[];
|
||||
isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean;
|
||||
/**
|
||||
* Check if a nickname is used by another profile loaded by the server
|
||||
* @param nicknameRequest
|
||||
* @param sessionID Session id
|
||||
* @returns True if already used
|
||||
*/
|
||||
isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean;
|
||||
protected profileHasInfoProperty(profile: IAkiProfile): boolean;
|
||||
protected nicknameMatches(profileName: string, nicknameRequest: string): boolean;
|
||||
protected sessionIdMatchesProfileId(profileId: string, sessionId: string): boolean;
|
||||
/**
|
||||
* Add experience to a PMC inside the players profile
|
||||
* @param sessionID Session id
|
||||
@ -54,6 +68,10 @@ export declare class ProfileHelper {
|
||||
getFullProfile(sessionID: string): IAkiProfile;
|
||||
getPmcProfile(sessionID: string): IPmcData;
|
||||
getScavProfile(sessionID: string): IPmcData;
|
||||
/**
|
||||
* Get baseline counter values for a fresh profile
|
||||
* @returns Stats
|
||||
*/
|
||||
getDefaultCounters(): Stats;
|
||||
protected isWiped(sessionID: string): boolean;
|
||||
protected getServerVersion(): string;
|
||||
@ -63,4 +81,24 @@ export declare class ProfileHelper {
|
||||
* @returns profile without secure container
|
||||
*/
|
||||
removeSecureContainer(profile: IPmcData): IPmcData;
|
||||
/**
|
||||
* Flag a profile as having received a gift
|
||||
* Store giftid in profile aki object
|
||||
* @param playerId Player to add gift flag to
|
||||
* @param giftId Gift player received
|
||||
*/
|
||||
addGiftReceivedFlagToProfile(playerId: string, giftId: string): void;
|
||||
/**
|
||||
* Check if profile has recieved a gift by id
|
||||
* @param playerId Player profile to check for gift
|
||||
* @param giftId Gift to check for
|
||||
* @returns True if player has recieved gift previously
|
||||
*/
|
||||
playerHasRecievedGift(playerId: string, giftId: string): boolean;
|
||||
/**
|
||||
* Find Stat in profile counters and increment by one
|
||||
* @param counters Counters to search for key
|
||||
* @param keyToIncrement Key
|
||||
*/
|
||||
incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void;
|
||||
}
|
||||
|
1
types/helpers/QuestConditionHelper.d.ts
vendored
1
types/helpers/QuestConditionHelper.d.ts
vendored
@ -3,5 +3,6 @@ export declare class QuestConditionHelper {
|
||||
getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
|
||||
getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
|
||||
getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
|
||||
getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
|
||||
protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
|
||||
}
|
||||
|
84
types/helpers/QuestHelper.d.ts
vendored
84
types/helpers/QuestHelper.d.ts
vendored
@ -1,5 +1,6 @@
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Quest } from "../models/eft/common/tables/IBotBase";
|
||||
import { IQuestStatus } from "../models/eft/common/tables/IBotBase";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
|
||||
@ -12,6 +13,7 @@ import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { MailSendService } from "../services/MailSendService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
@ -19,6 +21,7 @@ import { DialogueHelper } from "./DialogueHelper";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
import { PaymentHelper } from "./PaymentHelper";
|
||||
import { ProfileHelper } from "./ProfileHelper";
|
||||
import { QuestConditionHelper } from "./QuestConditionHelper";
|
||||
import { RagfairServerHelper } from "./RagfairServerHelper";
|
||||
import { TraderHelper } from "./TraderHelper";
|
||||
export declare class QuestHelper {
|
||||
@ -27,6 +30,7 @@ export declare class QuestHelper {
|
||||
protected timeUtil: TimeUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected questConditionHelper: QuestConditionHelper;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected localeService: LocaleService;
|
||||
@ -36,16 +40,17 @@ export declare class QuestHelper {
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected localisationService: LocalisationService;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected configServer: ConfigServer;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, questConditionHelper: QuestConditionHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, mailSendService: MailSendService, configServer: ConfigServer);
|
||||
/**
|
||||
* Get status of a quest by quest id
|
||||
* Get status of a quest in player profile by its id
|
||||
* @param pmcData Profile to search
|
||||
* @param questID Quest id to look up
|
||||
* @param questId Quest id to look up
|
||||
* @returns QuestStatus enum
|
||||
*/
|
||||
getQuestStatus(pmcData: IPmcData, questID: string): QuestStatus;
|
||||
getQuestStatus(pmcData: IPmcData, questId: string): QuestStatus;
|
||||
/**
|
||||
* returns true is the level condition is satisfied
|
||||
* @param playerLevel Players level
|
||||
@ -62,6 +67,7 @@ export declare class QuestHelper {
|
||||
getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[];
|
||||
/**
|
||||
* Increase skill points of a skill on player profile
|
||||
* Dupe of PlayerService.incrementSkillLevel()
|
||||
* @param sessionID Session id
|
||||
* @param pmcData Player profile
|
||||
* @param skillName Name of skill to increase skill points of
|
||||
@ -80,43 +86,57 @@ export declare class QuestHelper {
|
||||
* @param profile Player profile
|
||||
* @returns true if loyalty is high enough to fulfill quest requirement
|
||||
*/
|
||||
traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean;
|
||||
/**
|
||||
* Check if trader has sufficient standing to fulfill quest requirement
|
||||
* @param questProperties Quest props
|
||||
* @param profile Player profile
|
||||
* @returns true if standing is high enough to fulfill quest requirement
|
||||
*/
|
||||
traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean;
|
||||
protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean;
|
||||
/**
|
||||
* take reward item from quest and set FiR status + fix stack sizes + fix mod Ids
|
||||
* @param reward Reward item to fix
|
||||
* @returns Fixed rewards
|
||||
*/
|
||||
protected processReward(reward: Reward): Reward[];
|
||||
/**
|
||||
* Gets a flat list of reward items for the given quest at a specific state (e.g. Fail/Success)
|
||||
* @param quest quest to get rewards for
|
||||
* @param state Quest status that holds the items (Started, Success, Fail)
|
||||
* @param status Quest status that holds the items (Started, Success, Fail)
|
||||
* @returns array of items with the correct maxStack
|
||||
*/
|
||||
getQuestRewardItems(quest: IQuest, state: QuestStatus): Reward[];
|
||||
getQuestRewardItems(quest: IQuest, status: QuestStatus): Reward[];
|
||||
/**
|
||||
* Look up quest in db by accepted quest id and construct a profile-ready object ready to store in profile
|
||||
* @param pmcData Player profile
|
||||
* @param newState State the new quest should be in when returned
|
||||
* @param acceptedQuest Details of accepted quest from client
|
||||
*/
|
||||
getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest;
|
||||
getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus;
|
||||
/**
|
||||
* TODO: what is going on here
|
||||
* @param acceptedQuestId Quest to add to profile
|
||||
* Get quests that can be shown to player after starting a quest
|
||||
* @param startedQuestId Quest started by player
|
||||
* @param sessionID Session id
|
||||
* @returns Array of quests in profile + quest passed in as param
|
||||
* @returns Quests accessible to player incuding newly unlocked quests now quest (startedQuestId) was started
|
||||
*/
|
||||
acceptedUnlocked(acceptedQuestId: string, sessionID: string): IQuest[];
|
||||
getNewlyAccessibleQuestsWhenStartingQuest(startedQuestId: string, sessionID: string): IQuest[];
|
||||
/**
|
||||
* TODO: what is going on here
|
||||
* @param failedQuestId
|
||||
* @param sessionID Session id
|
||||
* @returns
|
||||
* Get quests that can be shown to player after failing a quest
|
||||
* @param failedQuestId Id of the quest failed by player
|
||||
* @param sessionId Session id
|
||||
* @returns IQuest array
|
||||
*/
|
||||
failedUnlocked(failedQuestId: string, sessionID: string): IQuest[];
|
||||
failedUnlocked(failedQuestId: string, sessionId: string): IQuest[];
|
||||
/**
|
||||
* Adjust quest money rewards by passed in multiplier
|
||||
* @param quest Quest to multiple money rewards
|
||||
* @param multiplier Value to adjust money rewards by
|
||||
* @param questStatus Status of quest to apply money boost to rewards of
|
||||
* @returns Updated quest
|
||||
*/
|
||||
applyMoneyBoost(quest: IQuest, multiplier: number): IQuest;
|
||||
applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest;
|
||||
/**
|
||||
* Sets the item stack to new value, or delete the item if value <= 0
|
||||
* // TODO maybe merge this function and the one from customization
|
||||
@ -127,6 +147,13 @@ export declare class QuestHelper {
|
||||
* @param output ItemEvent router response
|
||||
*/
|
||||
changeItemStack(pmcData: IPmcData, itemId: string, newStackSize: number, sessionID: string, output: IItemEventRouterResponse): void;
|
||||
/**
|
||||
* Add item stack change object into output route event response
|
||||
* @param output Response to add item change event into
|
||||
* @param sessionId Session id
|
||||
* @param item Item that was adjusted
|
||||
*/
|
||||
protected addItemStackSizeChangeIntoEventResponse(output: IItemEventRouterResponse, sessionId: string, item: Item): void;
|
||||
/**
|
||||
* Get quests, strip all requirement conditions except level
|
||||
* @param quests quests to process
|
||||
@ -144,9 +171,10 @@ export declare class QuestHelper {
|
||||
* @param pmcData Player profile
|
||||
* @param failRequest Fail quest request data
|
||||
* @param sessionID Session id
|
||||
* @param output Client output
|
||||
* @returns Item event router response
|
||||
*/
|
||||
failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Get List of All Quests from db
|
||||
* NOT CLONED
|
||||
@ -160,6 +188,13 @@ export declare class QuestHelper {
|
||||
* @returns IQuest object
|
||||
*/
|
||||
getQuestFromDb(questId: string, pmcData: IPmcData): IQuest;
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string;
|
||||
/**
|
||||
* Get the locale Id from locale db for a quest message
|
||||
* @param questMessageId Quest message id to look up
|
||||
@ -194,17 +229,18 @@ export declare class QuestHelper {
|
||||
*/
|
||||
protected findAndAddHideoutProductionIdToProfile(pmcData: IPmcData, craftUnlockReward: Reward, questDetails: IQuest, sessionID: string, response: IItemEventRouterResponse): void;
|
||||
/**
|
||||
* Get players intel center bonus from profile
|
||||
* Get players money reward bonus from profile
|
||||
* @param pmcData player profile
|
||||
* @returns bonus as a percent
|
||||
*/
|
||||
protected getIntelCenterRewardBonus(pmcData: IPmcData): number;
|
||||
protected getQuestMoneyRewardBonus(pmcData: IPmcData): number;
|
||||
/**
|
||||
* Find quest with 'findItem' requirement that needs the item tpl be handed in
|
||||
* Find quest with 'findItem' condition that needs the item tpl be handed in
|
||||
* @param itemTpl item tpl to look for
|
||||
* @returns 'FindItem' condition id
|
||||
* @param questIds Quests to search through for the findItem condition
|
||||
* @returns quest id with 'FindItem' condition id
|
||||
*/
|
||||
getFindItemIdForQuestHandIn(itemTpl: string): string;
|
||||
getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record<string, string>;
|
||||
/**
|
||||
* Add all quests to a profile with the provided statuses
|
||||
* @param pmcProfile profile to update
|
||||
|
99
types/helpers/RagfairOfferHelper.d.ts
vendored
99
types/helpers/RagfairOfferHelper.d.ts
vendored
@ -1,6 +1,8 @@
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITraderAssort } from "../models/eft/common/tables/ITrader";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
|
||||
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
|
||||
import { IQuestConfig } from "../models/spt/config/IQuestConfig";
|
||||
@ -11,10 +13,11 @@ import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { MailSendService } from "../services/MailSendService";
|
||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { DialogueHelper } from "./DialogueHelper";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
import { PaymentHelper } from "./PaymentHelper";
|
||||
import { PresetHelper } from "./PresetHelper";
|
||||
@ -31,7 +34,6 @@ export declare class RagfairOfferHelper {
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected presetHelper: PresetHelper;
|
||||
@ -41,13 +43,45 @@ export declare class RagfairOfferHelper {
|
||||
protected ragfairHelper: RagfairHelper;
|
||||
protected ragfairOfferService: RagfairOfferService;
|
||||
protected localeService: LocaleService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected mailSendService: MailSendService;
|
||||
protected configServer: ConfigServer;
|
||||
protected static goodSoldTemplate: string;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer);
|
||||
/**
|
||||
* Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see
|
||||
* @param searchRequest Data from client
|
||||
* @param itemsToAdd ragfairHelper.filterCategories()
|
||||
* @param traderAssorts Trader assorts
|
||||
* @param pmcProfile Player profile
|
||||
* @returns Offers the player should see
|
||||
*/
|
||||
getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||
/**
|
||||
* Get offers from flea/traders specifically when building weapon preset
|
||||
* @param searchRequest Search request data
|
||||
* @param itemsToAdd string array of item tpls to search for
|
||||
* @param traderAssorts All trader assorts player can access/buy
|
||||
* @param pmcProfile Player profile
|
||||
* @returns IRagfairOffer array
|
||||
*/
|
||||
getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||
/**
|
||||
* Check if offer is from trader standing the player does not have
|
||||
* @param offer Offer to check
|
||||
* @param pmcProfile Player profile
|
||||
* @returns True if item is locked, false if item is purchaseable
|
||||
*/
|
||||
protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean;
|
||||
/**
|
||||
* Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme
|
||||
* @param offer Offer to check is quest locked
|
||||
* @param traderAssorts all trader assorts for player
|
||||
* @returns true if quest locked
|
||||
*/
|
||||
traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record<string, ITraderAssort>): boolean;
|
||||
/**
|
||||
* Has a traders offer ran out of stock to sell to player
|
||||
* @param offer Offer to check stock of
|
||||
@ -64,11 +98,64 @@ export declare class RagfairOfferHelper {
|
||||
* Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level
|
||||
* @param offers Offers to check
|
||||
* @param pmcProfile Players profile with trader loyalty levels
|
||||
* @returns array of offer ids player cannot see
|
||||
*/
|
||||
protected getLoyaltyLockedOffers(offers: IRagfairOffer[], pmcProfile: IPmcData): string[];
|
||||
/**
|
||||
* Process all player-listed flea offers for a desired profile
|
||||
* @param sessionID Session id to process offers for
|
||||
* @returns true = complete
|
||||
*/
|
||||
processOffersOnProfile(sessionID: string): boolean;
|
||||
/**
|
||||
* Add amount to players ragfair rating
|
||||
* @param sessionId Profile to update
|
||||
* @param amountToIncrementBy Raw amount to add to players ragfair rating (excluding the reputation gain multiplier)
|
||||
*/
|
||||
increaseProfileRagfairRating(profile: IAkiProfile, amountToIncrementBy: number): void;
|
||||
/**
|
||||
* Return all offers a player has listed on a desired profile
|
||||
* @param sessionID Session id
|
||||
* @returns Array of ragfair offers
|
||||
*/
|
||||
protected getProfileOffers(sessionID: string): IRagfairOffer[];
|
||||
protected deleteOfferByOfferId(sessionID: string, offerId: string): void;
|
||||
/**
|
||||
* Delete an offer from a desired profile and from ragfair offers
|
||||
* @param sessionID Session id of profile to delete offer from
|
||||
* @param offerId Id of offer to delete
|
||||
*/
|
||||
protected deleteOfferById(sessionID: string, offerId: string): void;
|
||||
/**
|
||||
* Complete the selling of players' offer
|
||||
* @param sessionID Session id
|
||||
* @param offer Sold offer details
|
||||
* @param boughtAmount Amount item was purchased for
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse;
|
||||
isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, offer: IRagfairOffer, pmcProfile: IPmcData): boolean;
|
||||
/**
|
||||
* Get a localised message for when players offer has sold on flea
|
||||
* @param itemTpl Item sold
|
||||
* @param boughtAmount How many were purchased
|
||||
* @returns Localised message text
|
||||
*/
|
||||
protected getLocalisedOfferSoldMessage(itemTpl: string, boughtAmount: number): string;
|
||||
/**
|
||||
* Should a ragfair offer be visible to the player
|
||||
* @param searchRequest Search request
|
||||
* @param itemsToAdd ?
|
||||
* @param traderAssorts Trader assort items
|
||||
* @param offer The flea offer
|
||||
* @param pmcProfile Player profile
|
||||
* @returns True = should be shown to player
|
||||
*/
|
||||
isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, offer: IRagfairOffer, pmcProfile: IPmcData): boolean;
|
||||
/**
|
||||
* Is items quality value within desired range
|
||||
* @param item Item to check quality of
|
||||
* @param min Desired minimum quality
|
||||
* @param max Desired maximum quality
|
||||
* @returns True if in range
|
||||
*/
|
||||
protected itemQualityInRange(item: Item, min: number, max: number): boolean;
|
||||
}
|
||||
|
6
types/helpers/RagfairSellHelper.d.ts
vendored
6
types/helpers/RagfairSellHelper.d.ts
vendored
@ -13,12 +13,12 @@ export declare class RagfairSellHelper {
|
||||
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
/**
|
||||
* Get the percent chance to sell an item based on its average listed price vs player chosen listing price
|
||||
* @param baseChancePercent Base chance to sell item
|
||||
* @param averageOfferPriceRub Price of average offer in roubles
|
||||
* @param playerListedPriceRub Price player listed item for in roubles
|
||||
* @param qualityMultiplier Quality multipler of item being sold
|
||||
* @returns percent value
|
||||
*/
|
||||
calculateSellChance(baseChancePercent: number, averageOfferPriceRub: number, playerListedPriceRub: number): number;
|
||||
calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number;
|
||||
/**
|
||||
* Get percent chance to sell an item when price is below items average listing price
|
||||
* @param playerListedPriceRub Price player listed item for in roubles
|
||||
@ -27,7 +27,7 @@ export declare class RagfairSellHelper {
|
||||
*/
|
||||
protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number;
|
||||
/**
|
||||
* Determine if the offer being listed will be sold
|
||||
* Get array of item count and sell time (empty array = no sell)
|
||||
* @param sellChancePercent chance item will sell
|
||||
* @param itemSellCount count of items to sell
|
||||
* @returns Array of purchases of item(s) listed
|
||||
|
36
types/helpers/RagfairServerHelper.d.ts
vendored
36
types/helpers/RagfairServerHelper.d.ts
vendored
@ -8,41 +8,67 @@ import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { ItemFilterService } from "../services/ItemFilterService";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { MailSendService } from "../services/MailSendService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { DialogueHelper } from "./DialogueHelper";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
import { ProfileHelper } from "./ProfileHelper";
|
||||
import { TraderHelper } from "./TraderHelper";
|
||||
/**
|
||||
* Helper class for common ragfair server actions
|
||||
*/
|
||||
export declare class RagfairServerHelper {
|
||||
protected randomUtil: RandomUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected mailSendService: MailSendService;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected configServer: ConfigServer;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
protected static goodsReturnedTemplate: string;
|
||||
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
||||
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
||||
/**
|
||||
* Is item valid / on blacklist / quest item
|
||||
* @param itemDetails
|
||||
* @returns boolean
|
||||
*/
|
||||
isItemValidRagfairItem(itemDetails: [boolean, ITemplateItem]): boolean;
|
||||
protected isItemBlacklisted(itemTemplateId: string): boolean;
|
||||
isTrader(userID: string): boolean;
|
||||
isPlayer(userID: string): boolean;
|
||||
returnItems(sessionID: string, items: Item[]): void;
|
||||
/**
|
||||
* Is supplied item tpl on the ragfair custom blacklist from configs/ragfair.json/dynamic
|
||||
* @param itemTemplateId Item tpl to check is blacklisted
|
||||
* @returns True if its blacklsited
|
||||
*/
|
||||
protected isItemOnCustomFleaBlacklist(itemTemplateId: string): boolean;
|
||||
/**
|
||||
* is supplied id a trader
|
||||
* @param traderId
|
||||
* @returns True if id was a trader
|
||||
*/
|
||||
isTrader(traderId: string): boolean;
|
||||
/**
|
||||
* Is this user id the logged in player
|
||||
* @param userId Id to test
|
||||
* @returns True is the current player
|
||||
*/
|
||||
isPlayer(userId: string): boolean;
|
||||
/**
|
||||
* Send items back to player
|
||||
* @param sessionID Player to send items to
|
||||
* @param returnedItems Items to send to player
|
||||
*/
|
||||
returnItems(sessionID: string, returnedItems: Item[]): void;
|
||||
calculateDynamicStackCount(tplId: string, isWeaponPreset: boolean): number;
|
||||
/**
|
||||
* Choose a currency at random with bias
|
||||
|
1
types/helpers/RepairHelper.d.ts
vendored
1
types/helpers/RepairHelper.d.ts
vendored
@ -21,6 +21,7 @@ export declare class RepairHelper {
|
||||
* @param isArmor Is item being repaired a piece of armor
|
||||
* @param amountToRepair how many unit of durability to repair
|
||||
* @param useRepairKit Is item being repaired with a repair kit
|
||||
* @param traderQualityMultipler Trader quality value from traders base json
|
||||
* @param applyMaxDurabilityDegradation should item have max durability reduced
|
||||
*/
|
||||
updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void;
|
||||
|
11
types/helpers/TradeHelper.d.ts
vendored
11
types/helpers/TradeHelper.d.ts
vendored
@ -13,6 +13,7 @@ import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { RagfairServer } from "../servers/RagfairServer";
|
||||
import { FenceService } from "../services/FenceService";
|
||||
import { PaymentService } from "../services/PaymentService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class TradeHelper {
|
||||
protected logger: ILogger;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
@ -20,11 +21,12 @@ export declare class TradeHelper {
|
||||
protected itemHelper: ItemHelper;
|
||||
protected paymentService: PaymentService;
|
||||
protected fenceService: FenceService;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected inventoryHelper: InventoryHelper;
|
||||
protected ragfairServer: RagfairServer;
|
||||
protected configServer: ConfigServer;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, httpResponse: HttpResponseUtil, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer, configServer: ConfigServer);
|
||||
/**
|
||||
* Buy item from flea or trader
|
||||
* @param pmcData Player profile
|
||||
@ -37,12 +39,13 @@ export declare class TradeHelper {
|
||||
buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse;
|
||||
/**
|
||||
* Sell item to trader
|
||||
* @param pmcData Profile to update
|
||||
* @param sellRequest request data
|
||||
* @param profileWithItemsToSell Profile to remove items from
|
||||
* @param profileToReceiveMoney Profile to accept the money for selling item
|
||||
* @param sellRequest Request data
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Increment the assorts buy count by number of items purchased
|
||||
* Show error on screen if player attempts to buy more than what the buy max allows
|
||||
|
150
types/helpers/TraderHelper.d.ts
vendored
150
types/helpers/TraderHelper.d.ts
vendored
@ -1,7 +1,8 @@
|
||||
import { FenceLevel } from "../models/eft/common/IGlobals";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader";
|
||||
import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate";
|
||||
import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader";
|
||||
import { Traders } from "../models/enums/Traders";
|
||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
@ -10,30 +11,44 @@ import { SaveServer } from "../servers/SaveServer";
|
||||
import { FenceService } from "../services/FenceService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { PlayerService } from "../services/PlayerService";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { HandbookHelper } from "./HandbookHelper";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
import { PaymentHelper } from "./PaymentHelper";
|
||||
import { ProfileHelper } from "./ProfileHelper";
|
||||
export declare class TraderHelper {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected saveServer: SaveServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected playerService: PlayerService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected fenceService: FenceService;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected traderConfig: ITraderConfig;
|
||||
/** Dictionary of item tpl and the highest trader rouble price */
|
||||
/** Dictionary of item tpl and the highest trader sell rouble price */
|
||||
protected highestTraderPriceItems: Record<string, number>;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
/** Dictionary of item tpl and the highest trader buy back rouble price */
|
||||
protected highestTraderBuyPriceItems: Record<string, number>;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer);
|
||||
getTrader(traderID: string, sessionID: string): ITraderBase;
|
||||
getTraderAssortsById(traderId: string): ITraderAssort;
|
||||
/**
|
||||
* Get all assort data for a particular trader
|
||||
* @param traderId Trader to get assorts for
|
||||
* @returns ITraderAssort
|
||||
*/
|
||||
getTraderAssortsByTraderId(traderId: string): ITraderAssort;
|
||||
/**
|
||||
* Retrieve the Item from a traders assort data by its id
|
||||
* @param traderId Trader to get assorts for
|
||||
* @param assortId Id of assort to find
|
||||
* @returns Item object
|
||||
*/
|
||||
getTraderAssortItemByAssortId(traderId: string, assortId: string): Item;
|
||||
/**
|
||||
* Reset a profiles trader data back to its initial state as seen by a level 1 player
|
||||
* Does NOT take into account different profile levels
|
||||
@ -41,6 +56,7 @@ export declare class TraderHelper {
|
||||
* @param traderID trader id to reset
|
||||
*/
|
||||
resetTrader(sessionID: string, traderID: string): void;
|
||||
protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number;
|
||||
/**
|
||||
* Alter a traders unlocked status
|
||||
* @param traderId Trader to alter
|
||||
@ -48,62 +64,6 @@ export declare class TraderHelper {
|
||||
* @param sessionId Session id
|
||||
*/
|
||||
setTraderUnlockedState(traderId: string, status: boolean, sessionId: string): void;
|
||||
/**
|
||||
* Get a list of items and their prices from player inventory that can be sold to a trader
|
||||
* @param traderID trader id being traded with
|
||||
* @param sessionID session id
|
||||
* @returns IBarterScheme[][]
|
||||
*/
|
||||
getPurchasesData(traderID: string, sessionID: string): Record<string, IBarterScheme[][]>;
|
||||
/**
|
||||
* Should item be skipped when selling to trader according to its sell categories and other checks
|
||||
* @param pmcData Profile
|
||||
* @param item Item to be checked is sellable to trader
|
||||
* @param sellCategory categories trader will buy
|
||||
* @param traderId Trader item is being checked can be sold to
|
||||
* @returns true if should NOT be sold to trader
|
||||
*/
|
||||
protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean;
|
||||
/**
|
||||
* Check if item has durability so low it precludes it from being sold to the trader (inclusive)
|
||||
* @param item Item to check durability of
|
||||
* @param traderId Trader item is sold to
|
||||
* @returns
|
||||
*/
|
||||
protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean;
|
||||
/**
|
||||
* Get the percentage threshold value a trader will buy armor/weapons above
|
||||
* @param traderId Trader to look up
|
||||
* @returns percentage
|
||||
*/
|
||||
protected getTraderDurabiltyPurchaseThreshold(traderId: string): number;
|
||||
/**
|
||||
* Get the price of passed in item and all of its attached children (mods)
|
||||
* Take into account bonuses/adjustments e.g. discounts
|
||||
* @param pmcData profile data
|
||||
* @param item item to calculate price of
|
||||
* @param buyPriceCoefficient
|
||||
* @param fenceInfo fence data
|
||||
* @param traderBase trader details
|
||||
* @param currencyTpl Currency to get price as
|
||||
* @returns price of item + children
|
||||
*/
|
||||
protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number;
|
||||
/**
|
||||
* Get the raw price of item+child items from handbook without any modification
|
||||
* @param pmcData profile data
|
||||
* @param item item to calculate price of
|
||||
* @returns price as number
|
||||
*/
|
||||
protected getRawItemPrice(pmcData: IPmcData, item: Item): number;
|
||||
/**
|
||||
* Get discount modifier for desired trader
|
||||
* @param trader Trader to get discount for
|
||||
* @param buyPriceCoefficient
|
||||
* @param fenceInfo fence info, needed if getting fence modifier value
|
||||
* @returns discount modifier value
|
||||
*/
|
||||
protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number;
|
||||
/**
|
||||
* Add standing to a trader and level them up if exp goes over level threshold
|
||||
* @param sessionId Session id
|
||||
@ -112,11 +72,18 @@ export declare class TraderHelper {
|
||||
*/
|
||||
addStandingToTrader(sessionId: string, traderId: string, standingToAdd: number): void;
|
||||
/**
|
||||
* Calculate traders level based on exp amount and increments level if over threshold
|
||||
* @param traderID trader to process
|
||||
* @param sessionID session id
|
||||
* Add standing to current standing and clamp value if it goes too low
|
||||
* @param currentStanding current trader standing
|
||||
* @param standingToAdd stansding to add to trader standing
|
||||
* @returns current standing + added standing (clamped if needed)
|
||||
*/
|
||||
lvlUp(traderID: string, sessionID: string): void;
|
||||
protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number;
|
||||
/**
|
||||
* Calculate traders level based on exp amount and increments level if over threshold
|
||||
* @param traderID trader to check standing of
|
||||
* @param pmcData profile to update trader in
|
||||
*/
|
||||
lvlUp(traderID: string, pmcData: IPmcData): void;
|
||||
/**
|
||||
* Get the next update timestamp for a trader
|
||||
* @param traderID Trader to look up update value for
|
||||
@ -129,13 +96,6 @@ export declare class TraderHelper {
|
||||
* @returns Time in seconds
|
||||
*/
|
||||
getTraderUpdateSeconds(traderId: string): number;
|
||||
/**
|
||||
* check if an item is allowed to be sold to a trader
|
||||
* @param categoriesTraderBuys array of allowed categories
|
||||
* @param tplToCheck itemTpl of inventory
|
||||
* @returns boolean if item can be sold to trader
|
||||
*/
|
||||
doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean;
|
||||
getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel;
|
||||
/**
|
||||
* Store the purchase of an assort from a trader in the player profile
|
||||
@ -151,8 +111,48 @@ export declare class TraderHelper {
|
||||
}): void;
|
||||
/**
|
||||
* Get the highest rouble price for an item from traders
|
||||
* UNUSED
|
||||
* @param tpl Item to look up highest pride for
|
||||
* @returns highest rouble cost for item
|
||||
*/
|
||||
getHighestTraderPriceRouble(tpl: string): number;
|
||||
/**
|
||||
* Get the highest price item can be sold to trader for (roubles)
|
||||
* @param tpl Item to look up best trader sell-to price
|
||||
* @returns Rouble price
|
||||
*/
|
||||
getHighestSellToTraderPrice(tpl: string): number;
|
||||
/**
|
||||
* Get a trader enum key by its value
|
||||
* @param traderId Traders id
|
||||
* @returns Traders key
|
||||
*/
|
||||
getTraderById(traderId: string): Traders;
|
||||
/**
|
||||
* Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the
|
||||
* same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string.
|
||||
* This method provides a runtime check to prevent undefined behavior when using the enum as a dictionary key.
|
||||
*
|
||||
* For example, instead of this:
|
||||
* `const traderId = Traders[Traders.PRAPOR];`
|
||||
*
|
||||
* You can use safely use this:
|
||||
* `const traderId = this.traderHelper.getValidTraderIdByEnumValue(Traders.PRAPOR);`
|
||||
*
|
||||
* @param traderEnumValue The trader enum value to validate
|
||||
* @returns The validated trader enum value as a string, or an empty string if invalid
|
||||
*/
|
||||
getValidTraderIdByEnumValue(traderEnumValue: Traders): string;
|
||||
/**
|
||||
* Does the 'Traders' enum has a value that matches the passed in parameter
|
||||
* @param key Value to check for
|
||||
* @returns True, values exists in Traders enum as a value
|
||||
*/
|
||||
traderEnumHasKey(key: string): boolean;
|
||||
/**
|
||||
* Accepts a trader id
|
||||
* @param traderId Trader id
|
||||
* @returns Ttrue if Traders enum has the param as a value
|
||||
*/
|
||||
traderEnumHasValue(traderId: string): boolean;
|
||||
}
|
||||
|
4
types/helpers/WeightedRandomHelper.d.ts
vendored
4
types/helpers/WeightedRandomHelper.d.ts
vendored
@ -1,5 +1,6 @@
|
||||
export declare class WeightedRandomHelper {
|
||||
/**
|
||||
* @deprecated USE getWeightedValue() WHERE POSSIBLE
|
||||
* Gets a tplId from a weighted dictionary
|
||||
* @param {tplId: weighting[]} itemArray
|
||||
* @returns tplId
|
||||
@ -7,6 +8,9 @@ export declare class WeightedRandomHelper {
|
||||
getWeightedInventoryItem(itemArray: {
|
||||
[tplId: string]: unknown;
|
||||
} | ArrayLike<unknown>): string;
|
||||
getWeightedValue<T>(itemArray: {
|
||||
[key: string]: unknown;
|
||||
} | ArrayLike<unknown>): T;
|
||||
/**
|
||||
* Picks the random item based on its weight.
|
||||
* The items with higher weight will be picked more often (with a higher probability).
|
||||
|
4
types/loaders/BundleLoader.d.ts
vendored
4
types/loaders/BundleLoader.d.ts
vendored
@ -15,9 +15,13 @@ export declare class BundleLoader {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected bundles: Record<string, BundleInfo>;
|
||||
constructor(httpServerHelper: HttpServerHelper, vfs: VFS, jsonUtil: JsonUtil);
|
||||
/**
|
||||
* Handle singleplayer/bundles
|
||||
*/
|
||||
getBundles(local: boolean): BundleInfo[];
|
||||
getBundle(key: string, local: boolean): BundleInfo;
|
||||
addBundles(modpath: string): void;
|
||||
addBundle(key: string, b: BundleInfo): void;
|
||||
}
|
||||
export interface BundleManifest {
|
||||
manifest: Array<BundleManifestEntry>;
|
||||
|
6
types/loaders/PostAkiModLoader.d.ts
vendored
6
types/loaders/PostAkiModLoader.d.ts
vendored
@ -1,15 +1,19 @@
|
||||
import { DependencyContainer } from "tsyringe";
|
||||
import { IModLoader } from "../models/spt/mod/IModLoader";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { VFS } from "../utils/VFS";
|
||||
import { BundleLoader } from "./BundleLoader";
|
||||
import { ModTypeCheck } from "./ModTypeCheck";
|
||||
import { PreAkiModLoader } from "./PreAkiModLoader";
|
||||
export declare class PostAkiModLoader implements IModLoader {
|
||||
protected logger: ILogger;
|
||||
protected bundleLoader: BundleLoader;
|
||||
protected vfs: VFS;
|
||||
protected preAkiModLoader: PreAkiModLoader;
|
||||
protected localisationService: LocalisationService;
|
||||
protected modTypeCheck: ModTypeCheck;
|
||||
constructor(bundleLoader: BundleLoader, vfs: VFS, preAkiModLoader: PreAkiModLoader, modTypeCheck: ModTypeCheck);
|
||||
constructor(logger: ILogger, bundleLoader: BundleLoader, vfs: VFS, preAkiModLoader: PreAkiModLoader, localisationService: LocalisationService, modTypeCheck: ModTypeCheck);
|
||||
getModPath(mod: string): string;
|
||||
load(): Promise<void>;
|
||||
protected executeMods(container: DependencyContainer): Promise<void>;
|
||||
|
6
types/loaders/PostDBModLoader.d.ts
vendored
6
types/loaders/PostDBModLoader.d.ts
vendored
@ -1,11 +1,15 @@
|
||||
import { DependencyContainer } from "tsyringe";
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { ModTypeCheck } from "./ModTypeCheck";
|
||||
import { PreAkiModLoader } from "./PreAkiModLoader";
|
||||
export declare class PostDBModLoader implements OnLoad {
|
||||
protected logger: ILogger;
|
||||
protected preAkiModLoader: PreAkiModLoader;
|
||||
protected localisationService: LocalisationService;
|
||||
protected modTypeCheck: ModTypeCheck;
|
||||
constructor(preAkiModLoader: PreAkiModLoader, modTypeCheck: ModTypeCheck);
|
||||
constructor(logger: ILogger, preAkiModLoader: PreAkiModLoader, localisationService: LocalisationService, modTypeCheck: ModTypeCheck);
|
||||
onLoad(): Promise<void>;
|
||||
getRoute(): string;
|
||||
getModPath(mod: string): 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