Merge pull request '3.8.0 features and fixes' (#2) from 3.8.0 into main

Reviewed-on: #2
This commit is contained in:
Platinum 2024-04-03 08:42:55 +00:00
commit 1dd931d2eb
499 changed files with 7128 additions and 4439 deletions

View File

@ -1,15 +0,0 @@
{
"startDelayInSeconds": 6.9,
"baselineBulletId": "59e6906286f7746c9f75e847",
"baselineBulletPrice": 1000,
"bulletDamageMultiplierRedutionFactor": 0.7,
"baselineArmourId": "5c0e655586f774045612eeb2",
"baselineArmourWeight": 10,
"baselineArmourPrice": 200000,
"pricePerArmourClassStep": 100000,
"armourWeightMultiplierReductionFactor": 0.7,
"enableDebug": false,
"excludedCategories": ["5b5f78b786f77447ed5636af", "5b47574386f77428ca22b33c"],
"gunPriceFallback": 100000,
"useTraderPriceForOffersIfHigher": true
}

50
advancedConfig.jsonc Normal file
View File

@ -0,0 +1,50 @@
{
// Represents the M856A1 bullet which is a blacklist round that is good to balance the price of other ammos around.
"baselineBulletId": "59e6906286f7746c9f75e847",
// The M856A1 will be 1000 roubles on the flea, better blacklisted rounds will be more expensive proportionally and worse rounds will be cheaper.
"baselineBulletPrice": 1000,
// Reduces the weighting of the bullet damage against their flea price. So a blacklisted low pen, high dmg round won't be as expensive as better pen rounds.
"bulletDamageMultiplierRedutionFactor": 0.7,
// When enabled, creates more logging, mostly for Platinum to debug things.
"enableDebug": true,
// Items that are blacklisted in these categories will remain blacklisted.
"excludedCategories": [
"5b5f78b786f77447ed5636af", // Money, dont want people buying roubles with roubles
"5b47574386f77428ca22b345", // Special equipment, dont want people buying lightkeeper items
"5b47574386f77428ca22b33c" // Ammo boxes, some ammo boxes are really cheap, some are very expensive. Just buy loose rounds instead.
],
// By default, SPT flea prices will use a trader's price for an item if the trader's price is higher. Even custom item configs from this mod won't apply so you might need to disable this if you have some items set really cheap.
"useTraderPriceForOffersIfHigher": true,
// When an item doesn't have a flea price because it was blacklisted by default, multiply the handbook price by this number to get the new flea price. Default 3.
"handbookPriceMultiplier": 3,
// Overrides ragfairConfig.runIntervalValues.outOfRaid if config.enableFasterSales is true. Default 3s.
"runIntervalSecondsOverride": 3,
// When config.enableScarceOffers is true, use these values to limit the number of offers on the flea.
"offerItemCountOverride": {
"max": 4,
"min": 2
},
// When config.enableScarceOffers is true, use these values to limit the quantity of a stackable item (like ammo) per offer on the flea.
"stackablePercentOverride": {
"max": 200,
"min": 20
},
// When config.enableScarceOffers is true, use these values to limit the quantity of a non-stackable item (most items) per offer on the flea.
"nonStackableCountOverride": {
"max": 2,
"min": 1
},
// Adds the specified amount of offers for your current flea market rating if config.addExtraOfferSlot is enabled.
"extraOfferSlotsToAdd": 1
}

View File

@ -1,71 +0,0 @@
{
"disableBsgBlacklist": true,
"limitMaxPriceOfAttachments": true,
"useBalancedPricingForAllAmmo": false,
"maxFleaPriceOfAttachmentsToHandbookPrice": 5,
"blacklistedItemPriceMultiplier": 1,
"blacklistedAmmoAdditionalPriceMultiplier": 1,
"blacklistedArmourAdditionalPriceMultiplier": 1,
"customItemConfigs": [
{
"itemIdHint": "Just a human friendly description that isn't used in code to help you remember. This item is the .338 AP round",
"itemId": "5fc382a9d724d907e2077dab",
"priceMultiplier": 1.3
},
{
"itemIdHint": "MK-18 .338 rifle",
"itemId": "5fc22d7c187fea44d52eda44",
"fleaPriceOverride": 400000
},
{
"itemIdHint": "AXMC .338 rifle. This gun has no flea price by default. We can use the price override to avoid any issues",
"itemId": "627e14b21713922ded6f2c15",
"fleaPriceOverride": 300000
},
{
"itemIdHint": "RSASS 7.62 rifle. 300k+ default seems too high for me",
"itemId": "5a367e5dc4a282000e49738f",
"fleaPriceOverride": 150000
},
{
"itemIdHint": "M32 40mm MGL",
"itemId": "6275303a9f372d6ea97f9ec7",
"fleaPriceOverride": 200000
},
{
"itemIdHint": "Thicc Items Case",
"itemId": "5c0a840b86f7742ffa4f2482",
"fleaPriceOverride": 12000000
},
{
"itemIdHint": "Thicc Weapons Case",
"itemId": "5b6d9ce188a4501afc1b2b25",
"fleaPriceOverride": 4000000
},
{
"itemIdHint": "Regular Weapon Case",
"itemId": "59fb023c86f7746d0d4b423c",
"fleaPriceOverride": 1500000
},
{
"itemIdHint": "M203 40mm UGL",
"itemId": "6357c98711fb55120211f7e1",
"fleaPriceOverride": 200000
},
{
"itemIdHint": "GP-25 40mm UGL",
"itemId": "62e7e7bbe6da9612f743f1e0",
"fleaPriceOverride": 150000
},
{
"itemIdHint": "Dogtag BEAR",
"itemId": "59f32bb586f774757e1e8442",
"blacklisted": true
},
{
"itemIdHint": "Dogtag USEC",
"itemId": "59f32c3b86f77472a31742f0",
"blacklisted": true
}
]
}

61
config.jsonc Normal file
View File

@ -0,0 +1,61 @@
{
// Main feature of the mod, set to true to disable blacklist, false to keep it enabled. Other parts of the mod still applies however. Default true.
"disableBsgBlacklist": true,
// Make cheap offers sell faster. Default true.
"enableFasterSales": true,
// Reduces the number of offers and quantities per offer to make the flea experience more hardcore. Highly recommend to enable but default is false.
"enableScarceOffers": false,
// Adds an extra offer for your current flea market rating bracket. So a new account at level 15 can create 3 offers instead of 2. Default is false. Extra amount is configurable in advancedConfigs.
"addExtraOfferSlot": false,
// Balances the flea price of all ammo types, not just the blacklisted ammo types. Can be useful if you find some ammo prices are unbalanced, this generally makes them very balanced for what they do. Default false.
"useBalancedPricingForAllAmmo": false,
// Multiplies the price of all blacklisted items that are now available. Default 1.
"blacklistedItemPriceMultiplier": 1,
// Multiplies the price of all blacklisted ammo in addition to the `blacklistedItemPriceMultiplier` setting. Default 1.
"blacklistedAmmoAdditionalPriceMultiplier": 1,
// You can manually add flea prices to items, set a multiplier to their existing price or blacklist them entirely.
"customItemConfigs": [
{
// .338 AP round, the best round in the game so it's quite expensive. This also demonstrates the use of the priceMultiplier property. You can lower this if you think it's too expensive.",
"itemId": "5fc382a9d724d907e2077dab",
"priceMultiplier": 1.2
},
{
// .338 FMJ round",
"itemId": "5fc275cf85fd526b824a571a",
"priceMultiplier": 1.3
},
{
// 6.8x51mm FMJ, a bit expensive at 5k a round because of the novelty
"itemId": "6529302b8c26af6326029fb7",
"fleaPriceOverride": 2000
},
{
// 6.8x51mm Hybrid, it's around 2k using my ammo price balancing but we'll make it a bit more expensive due to it's novelty.
"itemId": "6529243824cbe3c74a05e5c1",
"fleaPriceOverride": 2800
},
{
// Regular Weapon Case, I think it's too expensive at the 5 mil mark by default",
"itemId": "59fb023c86f7746d0d4b423c",
"fleaPriceOverride": 1500000
},
{
// Dogtag BEAR
"itemId": "59f32bb586f774757e1e8442",
"blacklisted": true
},
{
// Dogtag USEC
"itemId": "59f32c3b86f77472a31742f0",
"blacklisted": true
}
]
}

View File

@ -1,10 +1,10 @@
{
"name": "The Blacklist",
"version": "1.3.1",
"version": "1.3.2",
"main": "src/mod.js",
"license": "GPLv3",
"author": "Platinum",
"akiVersion": "3.7.*",
"akiVersion": "3.8.*",
"scripts": {
"setup": "npm i",
"build": "node ./packageBuild.ts"
@ -18,6 +18,7 @@
"fs-extra": "11.1.0",
"glob": "8.0.3",
"tsyringe": "4.7.0",
"typescript": "4.9.4"
"typescript": "4.9.4",
"jsonc": "^2.0.0"
}
}

7
src/helpers.ts Normal file
View File

@ -0,0 +1,7 @@
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
export function isBulletOrShotgunShell(item: ITemplateItem): boolean {
const props = item._props;
return props.ammoType === "bullet" || props.ammoType === "buckshot";
}

View File

@ -16,215 +16,194 @@
// along with spt-the-blacklist. If not, see <http://www.gnu.org/licenses/>.
import { DependencyContainer } from "tsyringe";
import { jsonc } from "jsonc";
import path from "path";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { IPostDBLoadMod } from "@spt-aki/models/external/IPostDBLoadMod";
import { IPostDBLoadModAsync } from "@spt-aki/models/external/IPostDBLoadModAsync";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator";
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase";
import { HandbookItem } from "@spt-aki/models/eft/common/tables/IHandbookBase";
import config from "../config.json";
import advancedConfig from "../advancedConfig.json";
import { isBulletOrShotgunShell } from "./helpers";
import { IGlobals } from "@spt-aki/models/eft/common/IGlobals";
class TheBlacklistMod implements IPostDBLoadMod {
class TheBlacklistMod implements IPostDBLoadModAsync {
private logger: ILogger;
private modName = "[The Blacklist]";
// We to adjust for pricing using a baseline when mods like SPT Realism are used
private baselineBullet: ITemplateItem;
private baselineArmour: ITemplateItem;
// Store the category IDs of all attachments in the handbook so we don't have to manually enter them in json
private attachmentCategoryIds: string[] = [];
private blacklistedItemsUpdatedCount = 0;
private nonBlacklistedItemsUpdatedCount = 0;
private ammoPricesUpdatedCount = 0;
public postDBLoad(container: DependencyContainer): void {
private config;
private advancedConfig;
public async postDBLoadAsync(container: DependencyContainer) {
this.logger = container.resolve<ILogger>("WinstonLogger");
this.config = await jsonc.read(path.resolve(__dirname, "../config.jsonc"));
this.advancedConfig = await jsonc.read(path.resolve(__dirname, "../advancedConfig.jsonc"));
// Easiest way to make mod compatible with Lua's flea updater is let the user choose when to load the mod...
setTimeout(() => this.initialiseMod(container), (advancedConfig.startDelayInSeconds || 7) * 1000);
}
private initialiseMod(
container: DependencyContainer
): void {
const databaseServer = container.resolve<DatabaseServer>("DatabaseServer");
const tables = databaseServer.getTables();
const configServer = container.resolve<ConfigServer>("ConfigServer");
const ragfairConfig = configServer.getConfig<IRagfairConfig>(ConfigTypes.RAGFAIR);
const ragfairPriceService = container.resolve<RagfairPriceService>("RagfairPriceService");
const ragfairOfferGenerator = container.resolve<RagfairOfferGenerator>("RagfairOfferGenerator");
const itemTable = tables.templates.items;
const handbookItems = tables.templates.handbook.Items;
const prices = tables.templates.prices;
const globals = tables.globals;
ragfairConfig.dynamic.blacklist.enableBsgList = !config.disableBsgBlacklist;
ragfairConfig.dynamic.useTraderPriceForOffersIfHigher = advancedConfig.useTraderPriceForOffersIfHigher != null ? advancedConfig.useTraderPriceForOffersIfHigher : true;
this.baselineBullet = itemTable[this.advancedConfig.baselineBulletId];
this.baselineBullet = itemTable[advancedConfig.baselineBulletId];
this.baselineArmour = itemTable[advancedConfig.baselineArmourId];
let blacklistedItemsUpdatedCount = 0;
let nonBlacklistedItemsUpdatedCount = 0;
let ammoPricesUpdatedCount = 0;
let attachmentPriceLimitedCount = 0;
if (config.limitMaxPriceOfAttachments) {
this.initialiseAttachmentCategoryIds(tables.templates.handbook.Categories);
}
this.updateRagfairConfig(ragfairConfig);
this.updateGlobals(globals);
// Find all items to update by looping through handbook which is a better indicator of useable items.
handbookItems.forEach(handbookItem => {
const item = itemTable[handbookItem.Id];
const customItemConfig = config.customItemConfigs.find(conf => conf.itemId === item._id);
const originalPrice = prices[item._id];
// We found a custom price override to use. That's all we care about for this item. Move on to the next item.
if (customItemConfig?.fleaPriceOverride) {
prices[item._id] = customItemConfig.fleaPriceOverride;
this.debug(`Updated ${item._id} - ${item._name} flea price from ${originalPrice} to ${prices[item._id]} (price override).`);
blacklistedItemsUpdatedCount++;
const customItemConfig = this.config.customItemConfigs.find(conf => conf.itemId === item._id);
// We found a custom item config override to use. That's all we care about for this item. Move on to the next item.
if (customItemConfig && this.updateItemUsingCustomItemConfig(customItemConfig, item, prices, originalPrice, ragfairConfig)) {
return;
}
if (customItemConfig?.blacklisted) {
this.debug(`Blacklisted item ${item._id} - ${item._name} due to its customItemConfig.`);
ragfairConfig.dynamic.blacklist.custom.push(item._id);
return;
}
if (config.limitMaxPriceOfAttachments && this.attachmentCategoryIds.includes(handbookItem.ParentId)) {
const handbookPrice = handbookItem.Price;
const existingFleaPrice = prices[item._id];
const maxFleaPrice = handbookPrice * config.maxFleaPriceOfAttachmentsToHandbookPrice;
if (existingFleaPrice > maxFleaPrice) {
prices[item._id] = maxFleaPrice;
attachmentPriceLimitedCount++;
this.debug(`Attachment ${item._id} - ${item._name} was updated from ${existingFleaPrice} to ${maxFleaPrice}.`)
}
}
const itemProps = item._props;
if (config.useBalancedPricingForAllAmmo && this.isBulletOrShotgunShell(item)) {
const newPrice = this.getUpdatedAmmoPrice(item);
prices[item._id] = newPrice;
if (!itemProps.CanSellOnRagfair) {
blacklistedItemsUpdatedCount++;
// Set to true so we avoid recalculating ammo price again for blacklisted ammo below.
itemProps.CanSellOnRagfair = true;
} else {
nonBlacklistedItemsUpdatedCount++;
}
ammoPricesUpdatedCount++;
if (isBulletOrShotgunShell(item)) {
this.updateAmmoPrice(item, prices);
}
if (!itemProps.CanSellOnRagfair) {
// Some blacklisted items are hard to balance or just shouldn't be allowed so we will keep them blacklisted.
if (advancedConfig.excludedCategories.some(category => category === handbookItem.ParentId)) {
if (this.advancedConfig.excludedCategories.some(category => category === handbookItem.ParentId)) {
ragfairConfig.dynamic.blacklist.custom.push(item._id);
this.debug(`Blacklisted item ${item._id} - ${item._name} because we are excluding handbook category ${handbookItem.ParentId}.`);
this.debug(`Ignored item ${item._id} - ${item._name} because we are excluding handbook category ${handbookItem.ParentId}.`);
return;
}
itemProps.CanSellOnRagfair = config.disableBsgBlacklist;
prices[item._id] = this.getUpdatedPrice(item, prices);
prices[item._id] = this.getUpdatedPrice(handbookItem, item, prices);
if (!prices[item._id]) {
this.debug(`There are no flea prices for ${item._id} - ${item._name}!`);
return;
}
if (!isNaN(customItemConfig?.priceMultiplier)) {
prices[item._id] *= customItemConfig.priceMultiplier;
}
this.debug(`Updated ${item._id} - ${item._name} flea price from ${originalPrice} to ${prices[item._id]}.`);
blacklistedItemsUpdatedCount++;
}
const itemSpecificPriceMultiplier = customItemConfig?.priceMultiplier || 1;
prices[item._id] *= itemSpecificPriceMultiplier;
});
// Typescript hack to call protected method
(ragfairPriceService as any).generateDynamicPrices();
ragfairOfferGenerator.generateDynamicOffers().then(() => {
this.logger.success(`${this.modName}: Success! Found ${blacklistedItemsUpdatedCount} blacklisted & ${nonBlacklistedItemsUpdatedCount} non-blacklisted items to update.`);
if (config.limitMaxPriceOfAttachments) {
this.logger.success(`${this.modName}: config.limitMaxPriceOfAttachments is enabled! Updated ${attachmentPriceLimitedCount} flea prices of attachments.`);
}
if (config.useBalancedPricingForAllAmmo) {
this.logger.success(`${this.modName}: config.useBalancedPricingForAllAmmo is enabled! Updated ${ammoPricesUpdatedCount} ammo prices.`);
this.blacklistedItemsUpdatedCount++;
}
});
this.logger.success(`${this.modName}: Success! Found ${this.blacklistedItemsUpdatedCount} blacklisted & ${this.nonBlacklistedItemsUpdatedCount} non-blacklisted items to update.`);
if (this.config.useBalancedPricingForAllAmmo) {
this.logger.success(`${this.modName}: config.useBalancedPricingForAllAmmo is enabled! Updated ${this.ammoPricesUpdatedCount} ammo prices.`);
}
}
private initialiseAttachmentCategoryIds(handbookCategories: Category[]) {
const weaponPartsAndModsId = "5b5f71a686f77447ed5636ab";
const weaponPartsChildrenCategories = this.getChildCategoriesRecursively(handbookCategories, weaponPartsAndModsId);
const childrenIds = weaponPartsChildrenCategories.map(category => category.Id);
private updateRagfairConfig(ragfairConfig: IRagfairConfig) {
ragfairConfig.dynamic.blacklist.enableBsgList = !this.config.disableBsgBlacklist;
this.attachmentCategoryIds.push(weaponPartsAndModsId);
this.attachmentCategoryIds = this.attachmentCategoryIds.concat(childrenIds);
if (this.advancedConfig.useTraderPriceForOffersIfHigher != null) {
ragfairConfig.dynamic.useTraderPriceForOffersIfHigher = !!this.advancedConfig.useTraderPriceForOffersIfHigher;
}
private getChildCategoriesRecursively(handbookCategories: Category[], parentId: string): Category[] {
const childCategories = handbookCategories.filter(category => category.ParentId === parentId);
const grandChildrenCategories = childCategories.reduce(
(memo, category) => memo.concat(this.getChildCategoriesRecursively(handbookCategories, category.Id)),
[]
);
return childCategories.concat(grandChildrenCategories);
if (this.config.enableFasterSales && !isNaN(this.advancedConfig.runIntervalSecondsOverride)) {
ragfairConfig.runIntervalValues.outOfRaid = this.advancedConfig.runIntervalSecondsOverride;
}
private getUpdatedPrice(item: ITemplateItem, prices: Record<string, number>): number | undefined {
// Note that this price can be affected by other mods like Lua's market updater.
const currentFleaPrice = prices[item._id];
let newPrice: number;
if (this.isBulletOrShotgunShell(item)) {
newPrice = this.getUpdatedAmmoPrice(item);
} else if (this.isArmour(item)) {
newPrice = this.getUpdatedArmourPrice(item);
} else if (this.isGun(item) && currentFleaPrice == null) {
newPrice = this.getFallbackGunPrice();
if (this.config.enableScarceOffers) {
this.updateRagfairConfigToHaveScarceOffers(ragfairConfig);
}
}
// Avoids NaN. Also we shouldn't have any prices of 0.
const price = newPrice || currentFleaPrice;
return price && price * config.blacklistedItemPriceMultiplier;
private updateRagfairConfigToHaveScarceOffers(ragfairConfig: IRagfairConfig) {
const minMaxPropertiesToOverride = ["offerItemCount", "stackablePercent", "nonStackableCount"];
for (const propertyToOverride of minMaxPropertiesToOverride) {
ragfairConfig.dynamic[propertyToOverride].max = this.advancedConfig[`${propertyToOverride}Override`].max;
ragfairConfig.dynamic[propertyToOverride].min = this.advancedConfig[`${propertyToOverride}Override`].min;
}
private isBulletOrShotgunShell(item: ITemplateItem): boolean {
const props = item._props;
return props.ammoType === "bullet" || props.ammoType === "buckshot";
ragfairConfig.dynamic.barter.chancePercent = 0;
ragfairConfig.dynamic.pack.chancePercent = 0;
}
private isArmour(item: ITemplateItem): boolean {
return Number(item._props.armorClass) > 0 && item._props.armorZone?.some(zone => zone === "Chest")
private updateGlobals(globals: IGlobals) {
const ragfairConfig = globals.config.RagFair;
if (this.config.addExtraOfferSlot) {
for (const settingForBracket of ragfairConfig.maxActiveOfferCount) {
settingForBracket.count += this.advancedConfig.extraOfferSlotsToAdd;
}
}
}
// Some blacklisted guns are very cheap because they don't have a flea price, just a handbook price. The ones listed below will get a much higher default price.
private isGun(item: ITemplateItem): boolean {
const marksmanRiflesItemCategoryId = "5447b6194bdc2d67278b4567";
const assaultRiflesItemCategoryId = "5447b5f14bdc2d61278b4567";
const sniperRiflesItemCategoryId = "5447b6254bdc2dc3278b4568";
const smgsItemCategoryId = "5447b5e04bdc2d62278b4567";
const carbinesItemCategoryId = "5447b5fc4bdc2d87278b4567";
const gunCategories = [marksmanRiflesItemCategoryId, assaultRiflesItemCategoryId, sniperRiflesItemCategoryId, smgsItemCategoryId, carbinesItemCategoryId];
// Returns true if we updated something using the customItemConfig so we can skip to the next handbook item.
private updateItemUsingCustomItemConfig(customItemConfig, item: ITemplateItem , prices: Record<string, number>, originalPrice: number, ragfairConfig: IRagfairConfig): boolean {
if (customItemConfig?.blacklisted) {
this.debug(`Blacklisted item ${item._id} - ${item._name} due to its customItemConfig.`);
return gunCategories.includes(item._parent);
ragfairConfig.dynamic.blacklist.custom.push(item._id);
if (item._props.CanSellOnRagfair) {
this.nonBlacklistedItemsUpdatedCount++
}
private getUpdatedAmmoPrice(item: ITemplateItem) {
return true;
}
if (customItemConfig?.fleaPriceOverride) {
prices[item._id] = customItemConfig.fleaPriceOverride;
this.debug(`Updated ${item._id} - ${item._name} flea price from ${originalPrice} to ${prices[item._id]} (price override).`);
if (item._props.CanSellOnRagfair) {
this.nonBlacklistedItemsUpdatedCount++
}
return true;
}
return false;
}
private updateAmmoPrice(item: ITemplateItem, prices: Record<string, number>) {
const itemProps = item._props;
// We don't care about this standard ammo item if we haven't enabled useBalancedPricingForAllAmmo
if (itemProps.CanSellOnRagfair && !this.config.useBalancedPricingForAllAmmo) {
return;
}
const newPrice = this.getUpdatedAmmoPrice(item);
prices[item._id] = newPrice;
if (!itemProps.CanSellOnRagfair) {
this.blacklistedItemsUpdatedCount++;
} else {
this.nonBlacklistedItemsUpdatedCount++;
}
this.ammoPricesUpdatedCount++;
}
private getUpdatedAmmoPrice(item: ITemplateItem): number {
const baselinePen = this.baselineBullet._props.PenetrationPower;
const baselineDamage = this.baselineBullet._props.Damage;
@ -232,11 +211,13 @@ class TheBlacklistMod implements IPostDBLoadMod {
const baseDamageMultiplier = item._props.Damage / baselineDamage;
let penetrationMultiplier: number;
if (basePenetrationMultiplier > 1) {
// We are checking for > 0.99 because we want the baseline bullet (mult of 1) to be close to its baseline price.
if (basePenetrationMultiplier > 0.99) {
// A good gradient to make higher power rounds more expensive
penetrationMultiplier = 7 * basePenetrationMultiplier - 6;
penetrationMultiplier = 3 * basePenetrationMultiplier - 2;
} else {
// Due to maths above, its really easy to go < 1. The baseline ammo is mid tier with a reasonable 1000 rouble each. Ammo weaker than this tend to be pretty crap so we'll make it much cheaper
// The baseline ammo is mid tier with a reasonable 1000 rouble each. Ammo weaker than this tend to be pretty crap so we'll make it much cheaper
const newMultiplier = basePenetrationMultiplier * 0.7;
penetrationMultiplier = newMultiplier < 0.1 ? 0.1 : newMultiplier;
}
@ -244,33 +225,24 @@ class TheBlacklistMod implements IPostDBLoadMod {
// Reduces the effect of the damage multiplier so high DMG rounds aren't super expensive.
// Eg. let baseDamageMultiplier = 2 & bulletDamageMultiplierRedutionFactor = 0.7. Instead of a 2x price when a bullet is 2x damage, we instead get:
// 2 + (1 - 2) * 0.7 = 2 - 0.7 = 1.3x the price.
const damageMultiplier = baseDamageMultiplier + (1 - baseDamageMultiplier) * advancedConfig.bulletDamageMultiplierRedutionFactor;
const damageMultiplier = baseDamageMultiplier + (1 - baseDamageMultiplier) * this.advancedConfig.bulletDamageMultiplierRedutionFactor;
return advancedConfig.baselineBulletPrice * penetrationMultiplier * damageMultiplier * config.blacklistedAmmoAdditionalPriceMultiplier;
return this.advancedConfig.baselineBulletPrice * penetrationMultiplier * damageMultiplier * this.config.blacklistedAmmoAdditionalPriceMultiplier;
}
// Some default armour prices are too high like the Zabralo so I want a more balanced way to calculate the price.
private getUpdatedArmourPrice(item: ITemplateItem) {
const baselineArmourClass = Number(this.baselineArmour._props.armorClass);
private getUpdatedPrice(handbookItem: HandbookItem, item: ITemplateItem, prices: Record<string, number>): number | undefined {
// If a flea price doesn't exist for an item, we can multiply its handbook price which usually exists.
if (prices[item._id] == null) {
const handbookPrice = handbookItem.Price;
// Instead of doing a simple multiplier by dividing the two armour classes, this will give us a much bigger price range for different tiered armours.
const armourClassCost = (Number(item._props.armorClass) - baselineArmourClass) * advancedConfig.pricePerArmourClassStep;
const baseArmourWeightMultiplier = advancedConfig.baselineArmourWeight / item._props.Weight;
// Reduces the effect of the weight multiplier so some lighter armour aren't super expensive.
// Eg. let baseArmourWeightMultiplier = 2 & armourWeightMultiplierReductionFactor = 0.7. Instead of a 2x price when an armour is half as light as the baseline, we instead get:
// 2 + (1 - 2) * 0.7 = 2 - 0.7 = 1.3x the price.
const armourWeightMultiplier = baseArmourWeightMultiplier + (1 - baseArmourWeightMultiplier) * advancedConfig.armourWeightMultiplierReductionFactor;
return (advancedConfig.baselineArmourPrice + armourClassCost) * armourWeightMultiplier * config.blacklistedArmourAdditionalPriceMultiplier;
return handbookPrice * this.advancedConfig.handbookPriceMultiplier;
}
private getFallbackGunPrice() {
return advancedConfig.gunPriceFallback || 100000;
return prices[item._id] * this.config.blacklistedItemPriceMultiplier;
}
private debug(message: string) {
if (advancedConfig.enableDebug) {
if (this.advancedConfig.enableDebug) {
this.logger.debug(`${this.modName}: ${message}`);
}
}

View File

@ -2,5 +2,5 @@ export declare class ErrorHandler {
private logger;
private readLine;
constructor();
handleCriticalError(err: any): void;
handleCriticalError(err: Error): void;
}

2
types/Program.d.ts vendored
View File

@ -1,5 +1,5 @@
export declare class Program {
private errorHandler;
constructor();
start(): void;
start(): Promise<void>;
}

View File

@ -0,0 +1,21 @@
import { AchievementController } from "@spt-aki/controllers/AchievementController";
import { ProfileController } from "@spt-aki/controllers/ProfileController";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { ICompletedAchievementsResponse } from "@spt-aki/models/eft/profile/ICompletedAchievementsResponse";
import { IGetAchievementsResponse } from "@spt-aki/models/eft/profile/IGetAchievementsResponse";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export declare class AchievementCallbacks {
protected achievementController: AchievementController;
protected profileController: ProfileController;
protected httpResponse: HttpResponseUtil;
constructor(achievementController: AchievementController, profileController: ProfileController, httpResponse: HttpResponseUtil);
/**
* Handle client/achievement/list
*/
getAchievements(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetAchievementsResponse>;
/**
* Handle client/achievement/statistic
*/
statistic(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICompletedAchievementsResponse>;
}

View File

@ -1,9 +1,9 @@
import { BotController } from "../controllers/BotController";
import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IBotBase } from "../models/eft/common/tables/IBotBase";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { BotController } from "@spt-aki/controllers/BotController";
import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export declare class BotCallbacks {
protected botController: BotController;
protected httpResponse: HttpResponseUtil;

34
types/callbacks/BuildsCallbacks.d.ts vendored Normal file
View File

@ -0,0 +1,34 @@
import { BuildController } from "@spt-aki/controllers/BuildController";
import { ISetMagazineRequest } from "@spt-aki/models/eft/builds/ISetMagazineRequest";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
import { IPresetBuildActionRequestData } from "@spt-aki/models/eft/presetBuild/IPresetBuildActionRequestData";
import { IRemoveBuildRequestData } from "@spt-aki/models/eft/presetBuild/IRemoveBuildRequestData";
import { IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export declare class BuildsCallbacks {
protected httpResponse: HttpResponseUtil;
protected buildController: BuildController;
constructor(httpResponse: HttpResponseUtil, buildController: BuildController);
/**
* Handle client/builds/list
*/
getBuilds(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IUserBuilds>;
/**
* Handle client/builds/magazine/save
*/
createMagazineTemplate(url: string, request: ISetMagazineRequest, sessionID: string): INullResponseData;
/**
* Handle client/builds/weapon/save
*/
setWeapon(url: string, info: IPresetBuildActionRequestData, sessionID: string): INullResponseData;
/**
* Handle client/builds/equipment/save
*/
setEquipment(url: string, info: IPresetBuildActionRequestData, sessionID: string): INullResponseData;
/**
* Handle client/builds/delete
*/
deleteBuild(url: string, info: IRemoveBuildRequestData, sessionID: string): INullResponseData;
}

View File

@ -1,18 +1,13 @@
import { BundleLoader } from "../loaders/BundleLoader";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { HttpFileUtil } from "../utils/HttpFileUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { BundleLoader } from "@spt-aki/loaders/BundleLoader";
import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export declare class BundleCallbacks {
protected logger: ILogger;
protected httpResponse: HttpResponseUtil;
protected httpFileUtil: HttpFileUtil;
protected bundleLoader: BundleLoader;
protected configServer: ConfigServer;
protected httpConfig: IHttpConfig;
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer);
sendBundle(sessionID: string, req: any, resp: any, body: any): any;
constructor(httpResponse: HttpResponseUtil, bundleLoader: BundleLoader, configServer: ConfigServer);
/**
* Handle singleplayer/bundles
*/

28
types/callbacks/ClientLogCallbacks.d.ts vendored Normal file
View File

@ -0,0 +1,28 @@
import { ClientLogController } from "@spt-aki/controllers/ClientLogController";
import { ModLoadOrder } from "@spt-aki/loaders/ModLoadOrder";
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
import { IClientLogRequest } from "@spt-aki/models/spt/logging/IClientLogRequest";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
/** Handle client logging related events */
export declare class ClientLogCallbacks {
protected httpResponse: HttpResponseUtil;
protected clientLogController: ClientLogController;
protected configServer: ConfigServer;
protected localisationService: LocalisationService;
protected modLoadOrder: ModLoadOrder;
constructor(httpResponse: HttpResponseUtil, clientLogController: ClientLogController, configServer: ConfigServer, localisationService: LocalisationService, modLoadOrder: ModLoadOrder);
/**
* Handle /singleplayer/log
*/
clientLog(url: string, info: IClientLogRequest, sessionID: string): INullResponseData;
/**
* Handle /singleplayer/release
*/
releaseNotes(): string;
/**
* Handle /singleplayer/enableBSGlogging
*/
bsgLogging(): string;
}

View File

@ -1,14 +1,14 @@
import { CustomizationController } from "../controllers/CustomizationController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IPmcData } from "../models/eft/common/IPmcData";
import { ISuit } from "../models/eft/common/tables/ITrader";
import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothingRequestData";
import { IGetSuitsResponse } from "../models/eft/customization/IGetSuitsResponse";
import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { SaveServer } from "../servers/SaveServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { CustomizationController } from "@spt-aki/controllers/CustomizationController";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { ISuit } from "@spt-aki/models/eft/common/tables/ITrader";
import { IBuyClothingRequestData } from "@spt-aki/models/eft/customization/IBuyClothingRequestData";
import { IGetSuitsResponse } from "@spt-aki/models/eft/customization/IGetSuitsResponse";
import { IWearClothingRequestData } from "@spt-aki/models/eft/customization/IWearClothingRequestData";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export declare class CustomizationCallbacks {
protected customizationController: CustomizationController;
protected saveServer: SaveServer;

View File

@ -1,18 +1,18 @@
import { HideoutController } from "../controllers/HideoutController";
import { RagfairController } from "../controllers/RagfairController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IGlobals } from "../models/eft/common/IGlobals";
import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem";
import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase";
import { IGetItemPricesResponse } from "../models/eft/game/IGetItemPricesResponse";
import { IHideoutArea } from "../models/eft/hideout/IHideoutArea";
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase";
import { IHideoutSettingsBase } from "../models/eft/hideout/IHideoutSettingsBase";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { ISettingsBase } from "../models/spt/server/ISettingsBase";
import { DatabaseServer } from "../servers/DatabaseServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { HideoutController } from "@spt-aki/controllers/HideoutController";
import { RagfairController } from "@spt-aki/controllers/RagfairController";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IGlobals } from "@spt-aki/models/eft/common/IGlobals";
import { ICustomizationItem } from "@spt-aki/models/eft/common/tables/ICustomizationItem";
import { IHandbookBase } from "@spt-aki/models/eft/common/tables/IHandbookBase";
import { IGetItemPricesResponse } from "@spt-aki/models/eft/game/IGetItemPricesResponse";
import { IHideoutArea } from "@spt-aki/models/eft/hideout/IHideoutArea";
import { IHideoutProduction } from "@spt-aki/models/eft/hideout/IHideoutProduction";
import { IHideoutScavCase } from "@spt-aki/models/eft/hideout/IHideoutScavCase";
import { IHideoutSettingsBase } from "@spt-aki/models/eft/hideout/IHideoutSettingsBase";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { ISettingsBase } from "@spt-aki/models/spt/server/ISettingsBase";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
/**
* Handle client requests
*/

View File

@ -1,31 +1,31 @@
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";
import { IGetFriendListDataResponse } from "../models/eft/dialog/IGetFriendListDataResponse";
import { IGetMailDialogInfoRequestData } from "../models/eft/dialog/IGetMailDialogInfoRequestData";
import { IGetMailDialogListRequestData } from "../models/eft/dialog/IGetMailDialogListRequestData";
import { IGetMailDialogViewRequestData } from "../models/eft/dialog/IGetMailDialogViewRequestData";
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";
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
import { DialogueInfo } from "../models/eft/profile/IAkiProfile";
import { HashUtil } from "../utils/HashUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil";
import { DialogueController } from "@spt-aki/controllers/DialogueController";
import { OnUpdate } from "@spt-aki/di/OnUpdate";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData";
import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer";
import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest";
import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest";
import { IFriendRequestData } from "@spt-aki/models/eft/dialog/IFriendRequestData";
import { IFriendRequestSendResponse } from "@spt-aki/models/eft/dialog/IFriendRequestSendResponse";
import { IGetAllAttachmentsRequestData } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsRequestData";
import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse";
import { IGetChatServerListRequestData } from "@spt-aki/models/eft/dialog/IGetChatServerListRequestData";
import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse";
import { IGetMailDialogInfoRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogInfoRequestData";
import { IGetMailDialogListRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogListRequestData";
import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData";
import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewResponseData";
import { IPinDialogRequestData } from "@spt-aki/models/eft/dialog/IPinDialogRequestData";
import { IRemoveDialogRequestData } from "@spt-aki/models/eft/dialog/IRemoveDialogRequestData";
import { IRemoveMailMessageRequest } from "@spt-aki/models/eft/dialog/IRemoveMailMessageRequest";
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
import { ISetDialogReadRequestData } from "@spt-aki/models/eft/dialog/ISetDialogReadRequestData";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
import { DialogueInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class DialogueCallbacks implements OnUpdate {
protected hashUtil: HashUtil;
protected timeUtil: TimeUtil;
@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate {
/** Handle client/friend/ignore/set */
ignoreFriend(url: string, request: {
uid: string;
}, sessionID: string): any;
}, sessionID: string): INullResponseData;
/** Handle client/friend/ignore/remove */
unIgnoreFriend(url: string, request: {
uid: string;
}, sessionID: string): any;
}, sessionID: string): INullResponseData;
clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]>;
removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]>;
onUpdate(timeSinceLastRun: number): Promise<boolean>;

View File

@ -1,22 +1,24 @@
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";
import { IGameLogoutResponseData } from "../models/eft/game/IGameLogoutResponseData";
import { IGameStartResponse } from "../models/eft/game/IGameStartResponse";
import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData";
import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
import { SaveServer } from "../servers/SaveServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { Watermark } from "../utils/Watermark";
declare class GameCallbacks implements OnLoad {
import { GameController } from "@spt-aki/controllers/GameController";
import { OnLoad } from "@spt-aki/di/OnLoad";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse";
import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse";
import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse";
import { IGameEmptyCrcRequestData } from "@spt-aki/models/eft/game/IGameEmptyCrcRequestData";
import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveResponse";
import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData";
import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse";
import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest";
import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse";
import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData";
import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails";
import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { Watermark } from "@spt-aki/utils/Watermark";
export declare class GameCallbacks implements OnLoad {
protected httpResponse: HttpResponseUtil;
protected watermark: Watermark;
protected saveServer: SaveServer;
@ -68,5 +70,9 @@ declare class GameCallbacks implements OnLoad {
*/
getVersion(url: string, info: IEmptyRequestData, sessionID: string): string;
reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData;
/**
* Handle singleplayer/settings/getRaidTime
* @returns string
*/
getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse;
}
export { GameCallbacks };

View File

@ -1,5 +1,5 @@
import { HandbookController } from "../controllers/HandbookController";
import { OnLoad } from "../di/OnLoad";
import { HandbookController } from "@spt-aki/controllers/HandbookController";
import { OnLoad } from "@spt-aki/di/OnLoad";
export declare class HandbookCallbacks implements OnLoad {
protected handbookController: HandbookController;
constructor(handbookController: HandbookController);

View File

@ -1,14 +1,14 @@
import { HealthController } from "../controllers/HealthController";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData";
import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData";
import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData";
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IWorkoutData } from "../models/eft/health/IWorkoutData";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { HealthController } from "@spt-aki/controllers/HealthController";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IHealthTreatmentRequestData } from "@spt-aki/models/eft/health/IHealthTreatmentRequestData";
import { IOffraidEatRequestData } from "@spt-aki/models/eft/health/IOffraidEatRequestData";
import { IOffraidHealRequestData } from "@spt-aki/models/eft/health/IOffraidHealRequestData";
import { ISyncHealthRequestData } from "@spt-aki/models/eft/health/ISyncHealthRequestData";
import { IWorkoutData } from "@spt-aki/models/eft/health/IWorkoutData";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export declare class HealthCallbacks {
protected httpResponse: HttpResponseUtil;
protected profileHelper: ProfileHelper;

View File

@ -1,21 +1,22 @@
import { HideoutController } from "../controllers/HideoutController";
import { OnUpdate } from "../di/OnUpdate";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData";
import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData";
import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData";
import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData";
import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData";
import { IHideoutTakeItemOutRequestData } from "../models/eft/hideout/IHideoutTakeItemOutRequestData";
import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData";
import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData";
import { IHideoutUpgradeCompleteRequestData } from "../models/eft/hideout/IHideoutUpgradeCompleteRequestData";
import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData";
import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { HideoutController } from "@spt-aki/controllers/HideoutController";
import { OnUpdate } from "@spt-aki/di/OnUpdate";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IHandleQTEEventRequestData } from "@spt-aki/models/eft/hideout/IHandleQTEEventRequestData";
import { IHideoutCancelProductionRequestData } from "@spt-aki/models/eft/hideout/IHideoutCancelProductionRequestData";
import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData";
import { IHideoutImproveAreaRequestData } from "@spt-aki/models/eft/hideout/IHideoutImproveAreaRequestData";
import { IHideoutPutItemInRequestData } from "@spt-aki/models/eft/hideout/IHideoutPutItemInRequestData";
import { IHideoutScavCaseStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutScavCaseStartRequestData";
import { IHideoutSingleProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutSingleProductionStartRequestData";
import { IHideoutTakeItemOutRequestData } from "@spt-aki/models/eft/hideout/IHideoutTakeItemOutRequestData";
import { IHideoutTakeProductionRequestData } from "@spt-aki/models/eft/hideout/IHideoutTakeProductionRequestData";
import { IHideoutToggleAreaRequestData } from "@spt-aki/models/eft/hideout/IHideoutToggleAreaRequestData";
import { IHideoutUpgradeCompleteRequestData } from "@spt-aki/models/eft/hideout/IHideoutUpgradeCompleteRequestData";
import { IHideoutUpgradeRequestData } from "@spt-aki/models/eft/hideout/IHideoutUpgradeRequestData";
import { IRecordShootingRangePoints } from "@spt-aki/models/eft/hideout/IRecordShootingRangePoints";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
export declare class HideoutCallbacks implements OnUpdate {
protected hideoutController: HideoutController;
protected configServer: ConfigServer;
@ -25,11 +26,11 @@ export declare class HideoutCallbacks implements OnUpdate {
/**
* Handle HideoutUpgrade event
*/
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/**
* Handle HideoutUpgradeComplete event
*/
upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/**
* Handle HideoutPutItemsInAreaSlots
*/
@ -61,15 +62,19 @@ export declare class HideoutCallbacks implements OnUpdate {
/**
* Handle HideoutQuickTimeEvent
*/
handleQTEEvent(pmcData: IPmcData, request: IHandleQTEEventRequestData, sessionId: string): IItemEventRouterResponse;
handleQTEEvent(pmcData: IPmcData, request: IHandleQTEEventRequestData, sessionId: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/**
* Handle client/game/profile/items/moving - RecordShootingRangePoints
*/
recordShootingRangePoints(pmcData: IPmcData, request: IRecordShootingRangePoints, sessionId: string): IItemEventRouterResponse;
recordShootingRangePoints(pmcData: IPmcData, request: IRecordShootingRangePoints, sessionId: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/**
* Handle client/game/profile/items/moving - RecordShootingRangePoints
*/
improveArea(pmcData: IPmcData, request: IHideoutImproveAreaRequestData, sessionId: string): IItemEventRouterResponse;
/**
* Handle client/game/profile/items/moving - HideoutCancelProductionCommand
*/
cancelProduction(pmcData: IPmcData, request: IHideoutCancelProductionRequestData, sessionId: string): IItemEventRouterResponse;
onUpdate(timeSinceLastRun: number): Promise<boolean>;
getRoute(): string;
}

View File

@ -1,5 +1,5 @@
import { OnLoad } from "../di/OnLoad";
import { HttpServer } from "../servers/HttpServer";
import { OnLoad } from "@spt-aki/di/OnLoad";
import { HttpServer } from "@spt-aki/servers/HttpServer";
export declare class HttpCallbacks implements OnLoad {
protected httpServer: HttpServer;
constructor(httpServer: HttpServer);

View File

@ -1,8 +1,10 @@
import { InraidController } from "../controllers/InraidController";
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { InraidController } from "@spt-aki/controllers/InraidController";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
import { IItemDeliveryRequestData } from "@spt-aki/models/eft/inRaid/IItemDeliveryRequestData";
import { IRegisterPlayerRequestData } from "@spt-aki/models/eft/inRaid/IRegisterPlayerRequestData";
import { ISaveProgressRequestData } from "@spt-aki/models/eft/inRaid/ISaveProgressRequestData";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
/**
* Handle client requests
*/
@ -47,4 +49,19 @@ export declare class InraidCallbacks {
* @returns JSON as string
*/
getAirdropConfig(): string;
/**
* Handle singleplayer/btr/config
* @returns JSON as string
*/
getBTRConfig(): string;
/**
* Handle singleplayer/traderServices/getTraderServices
*/
getTraderServices(url: string, info: IEmptyRequestData, sessionId: string): string;
/**
* Handle singleplayer/traderServices/itemDelivery
*/
itemDelivery(url: string, request: IItemDeliveryRequestData, sessionId: string): INullResponseData;
getTraitorScavHostileChance(url: string, info: IEmptyRequestData, sessionId: string): string;
getSandboxMaxPatrolValue(url: string, info: IEmptyRequestData, sessionId: string): string;
}

View File

@ -1,15 +1,15 @@
import { InsuranceController } from "../controllers/InsuranceController";
import { OnUpdate } from "../di/OnUpdate";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
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 { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { InsuranceService } from "../services/InsuranceService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { InsuranceController } from "@spt-aki/controllers/InsuranceController";
import { OnUpdate } from "@spt-aki/di/OnUpdate";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData";
import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData";
import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { InsuranceService } from "@spt-aki/services/InsuranceService";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export declare class InsuranceCallbacks implements OnUpdate {
protected insuranceController: InsuranceController;
protected insuranceService: InsuranceService;

View File

@ -1,48 +1,61 @@
import { InventoryController } from "../controllers/InventoryController";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IInventoryBindRequestData } from "../models/eft/inventory/IInventoryBindRequestData";
import { IInventoryCreateMarkerRequestData } from "../models/eft/inventory/IInventoryCreateMarkerRequestData";
import { IInventoryDeleteMarkerRequestData } from "../models/eft/inventory/IInventoryDeleteMarkerRequestData";
import { IInventoryEditMarkerRequestData } from "../models/eft/inventory/IInventoryEditMarkerRequestData";
import { IInventoryExamineRequestData } from "../models/eft/inventory/IInventoryExamineRequestData";
import { IInventoryFoldRequestData } from "../models/eft/inventory/IInventoryFoldRequestData";
import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData";
import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData";
import { IInventoryReadEncyclopediaRequestData } from "../models/eft/inventory/IInventoryReadEncyclopediaRequestData";
import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData";
import { IInventorySortRequestData } from "../models/eft/inventory/IInventorySortRequestData";
import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData";
import { IInventorySwapRequestData } from "../models/eft/inventory/IInventorySwapRequestData";
import { IInventoryTagRequestData } from "../models/eft/inventory/IInventoryTagRequestData";
import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryToggleRequestData";
import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData";
import { IOpenRandomLootContainerRequestData } from "../models/eft/inventory/IOpenRandomLootContainerRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { InventoryController } from "@spt-aki/controllers/InventoryController";
import { QuestController } from "@spt-aki/controllers/QuestController";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IInventoryBindRequestData } from "@spt-aki/models/eft/inventory/IInventoryBindRequestData";
import { IInventoryCreateMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryCreateMarkerRequestData";
import { IInventoryDeleteMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryDeleteMarkerRequestData";
import { IInventoryEditMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryEditMarkerRequestData";
import { IInventoryExamineRequestData } from "@spt-aki/models/eft/inventory/IInventoryExamineRequestData";
import { IInventoryFoldRequestData } from "@spt-aki/models/eft/inventory/IInventoryFoldRequestData";
import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData";
import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData";
import { IInventoryReadEncyclopediaRequestData } from "@spt-aki/models/eft/inventory/IInventoryReadEncyclopediaRequestData";
import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData";
import { IInventorySortRequestData } from "@spt-aki/models/eft/inventory/IInventorySortRequestData";
import { IInventorySplitRequestData } from "@spt-aki/models/eft/inventory/IInventorySplitRequestData";
import { IInventorySwapRequestData } from "@spt-aki/models/eft/inventory/IInventorySwapRequestData";
import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInventoryTagRequestData";
import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData";
import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData";
import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData";
import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData";
import { ISetFavoriteItems } from "@spt-aki/models/eft/inventory/ISetFavoriteItems";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IFailQuestRequestData } from "@spt-aki/models/eft/quests/IFailQuestRequestData";
export declare class InventoryCallbacks {
protected inventoryController: InventoryController;
constructor(inventoryController: InventoryController);
/** Handle Move event */
moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
protected questController: QuestController;
constructor(inventoryController: InventoryController, questController: QuestController);
/** Handle client/game/profile/items/moving Move event */
moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** Handle Remove event */
removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse;
removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string, output: IItemEventRouterResponse): 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;
splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
transferItem(pmcData: IPmcData, request: IInventoryTransferRequestData, sessionID: string, output: IItemEventRouterResponse): 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;
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
unbindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string, output: IItemEventRouterResponse): 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;
sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** Handle OpenRandomLootContainer */
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
setFavoriteItem(pmcData: IPmcData, body: ISetFavoriteItems, sessionId: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/**
* TODO - MOVE INTO QUEST CODE
* Handle game/profile/items/moving - QuestFail
*/
failQuest(pmcData: IPmcData, request: IFailQuestRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
}

View File

@ -1,13 +1,19 @@
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { Warning } from "../models/eft/itemEvent/IItemEventRouterBase";
import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { Warning } from "@spt-aki/models/eft/itemEvent/IItemEventRouterBase";
import { IItemEventRouterRequest } from "@spt-aki/models/eft/itemEvent/IItemEventRouterRequest";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { ItemEventRouter } from "@spt-aki/routers/ItemEventRouter";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export declare class ItemEventCallbacks {
protected httpResponse: HttpResponseUtil;
protected itemEventRouter: ItemEventRouter;
constructor(httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter);
handleEvents(url: string, info: IItemEventRouterRequest, sessionID: string): IGetBodyResponseData<IItemEventRouterResponse>;
/**
* Return true if the passed in list of warnings contains critical issues
* @param warnings The list of warnings to check for critical errors
* @returns
*/
private isCriticalError;
protected getErrorCode(warnings: Warning[]): number;
}

View File

@ -1,13 +1,13 @@
import { LauncherController } from "../controllers/LauncherController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData";
import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData";
import { IRegisterData } from "../models/eft/launcher/IRegisterData";
import { IRemoveProfileData } from "../models/eft/launcher/IRemoveProfileData";
import { SaveServer } from "../servers/SaveServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { Watermark } from "../utils/Watermark";
declare class LauncherCallbacks {
import { LauncherController } from "@spt-aki/controllers/LauncherController";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IChangeRequestData } from "@spt-aki/models/eft/launcher/IChangeRequestData";
import { ILoginRequestData } from "@spt-aki/models/eft/launcher/ILoginRequestData";
import { IRegisterData } from "@spt-aki/models/eft/launcher/IRegisterData";
import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileData";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { Watermark } from "@spt-aki/utils/Watermark";
export declare class LauncherCallbacks {
protected httpResponse: HttpResponseUtil;
protected launcherController: LauncherController;
protected saveServer: SaveServer;
@ -27,4 +27,3 @@ declare class LauncherCallbacks {
getLoadedServerMods(): string;
getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string;
}
export { LauncherCallbacks };

View File

@ -1,10 +1,10 @@
import { LocationController } from "../controllers/LocationController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { ILocationBase } from "../models/eft/common/ILocationBase";
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { IGetLocationRequestData } from "../models/eft/location/IGetLocationRequestData";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { LocationController } from "@spt-aki/controllers/LocationController";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { ILocationBase } from "@spt-aki/models/eft/common/ILocationBase";
import { ILocationsGenerateAllResponse } from "@spt-aki/models/eft/common/ILocationsSourceDestinationBase";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { IGetLocationRequestData } from "@spt-aki/models/eft/location/IGetLocationRequestData";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export declare class LocationCallbacks {
protected httpResponse: HttpResponseUtil;
protected locationController: LocationController;

View File

@ -1,26 +1,25 @@
import { MatchController } from "../controllers/MatchController";
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";
import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData";
import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData";
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData";
import { 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";
import { JsonUtil } from "../utils/JsonUtil";
import { MatchController } from "@spt-aki/controllers/MatchController";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
import { IAcceptGroupInviteRequest } from "@spt-aki/models/eft/match/IAcceptGroupInviteRequest";
import { IAcceptGroupInviteResponse } from "@spt-aki/models/eft/match/IAcceptGroupInviteResponse";
import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGroupInviteRequest";
import { IDeclineGroupInviteRequest } from "@spt-aki/models/eft/match/IDeclineGroupInviteRequest";
import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData";
import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData";
import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse";
import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData";
import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData";
import { IJoinMatchResult } from "@spt-aki/models/eft/match/IJoinMatchResult";
import { IPutMetricsRequestData } from "@spt-aki/models/eft/match/IPutMetricsRequestData";
import { IRemovePlayerFromGroupRequest } from "@spt-aki/models/eft/match/IRemovePlayerFromGroupRequest";
import { ISendGroupInviteRequest } from "@spt-aki/models/eft/match/ISendGroupInviteRequest";
import { ITransferGroupRequest } from "@spt-aki/models/eft/match/ITransferGroupRequest";
import { IUpdatePingRequestData } from "@spt-aki/models/eft/match/IUpdatePingRequestData";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
export declare class MatchCallbacks {
protected httpResponse: HttpResponseUtil;
protected jsonUtil: JsonUtil;
@ -38,29 +37,27 @@ export declare class MatchCallbacks {
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/decline */
declineGroupInvite(url: string, info: IDeclineGroupInviteRequest, sessionID: string): IGetBodyResponseData<any>;
/** 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;
cancelAllGroupInvite(url: string, info: IEmptyRequestData, 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<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
* Called periodically while in a group
* 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>;
getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<IGetGroupStatusResponse>;
/** Handle client/match/group/delete */
deleteGroup(url: string, info: any, sessionID: string): INullResponseData;
leaveGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>;
@ -70,4 +67,6 @@ export declare class MatchCallbacks {
endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData;
/** Handle client/raid/configuration */
getRaidConfiguration(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData;
/** Handle client/raid/configuration-by-profile */
getConfigurationByProfile(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData;
}

View File

@ -1,12 +1,12 @@
import { OnLoad } from "../di/OnLoad";
import { PostAkiModLoader } from "../loaders/PostAkiModLoader";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { LocalisationService } from "../services/LocalisationService";
import { HttpFileUtil } from "../utils/HttpFileUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
declare class ModCallbacks implements OnLoad {
import { OnLoad } from "@spt-aki/di/OnLoad";
import { PostAkiModLoader } from "@spt-aki/loaders/PostAkiModLoader";
import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export declare class ModCallbacks implements OnLoad {
protected logger: ILogger;
protected httpResponse: HttpResponseUtil;
protected httpFileUtil: HttpFileUtil;
@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad {
onLoad(): Promise<void>;
getRoute(): string;
}
export { ModCallbacks };

View File

@ -1,7 +1,7 @@
import { NoteController } from "../controllers/NoteController";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { INoteActionData } from "../models/eft/notes/INoteActionData";
import { NoteController } from "@spt-aki/controllers/NoteController";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { INoteActionData } from "@spt-aki/models/eft/notes/INoteActionData";
export declare class NoteCallbacks {
protected noteController: NoteController;
constructor(noteController: NoteController);

View File

@ -1,12 +1,12 @@
import { NotifierController } from "../controllers/NotifierController";
import { HttpServerHelper } from "../helpers/HttpServerHelper";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
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";
import { NotifierController } from "@spt-aki/controllers/NotifierController";
import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier";
import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData";
import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
export declare class NotifierCallbacks {
protected httpServerHelper: HttpServerHelper;
protected httpResponse: HttpResponseUtil;

View File

@ -4,23 +4,13 @@ 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 { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData";
import { IUserBuilds } from "../models/eft/profile/IAkiProfile";
import { WeaponBuild } 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);
/** 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;
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;
}

View File

@ -1,5 +1,5 @@
import { PresetController } from "../controllers/PresetController";
import { OnLoad } from "../di/OnLoad";
import { PresetController } from "@spt-aki/controllers/PresetController";
import { OnLoad } from "@spt-aki/di/OnLoad";
export declare class PresetCallbacks implements OnLoad {
protected presetController: PresetController;
constructor(presetController: PresetController);

View File

@ -1,29 +1,34 @@
import { ProfileController } from "../controllers/ProfileController";
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 { 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";
import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData";
import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse";
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil";
import { ProfileController } from "@spt-aki/controllers/ProfileController";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData";
import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData";
import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse";
import { IGetOtherProfileRequest } from "@spt-aki/models/eft/profile/IGetOtherProfileRequest";
import { IGetOtherProfileResponse } from "@spt-aki/models/eft/profile/IGetOtherProfileResponse";
import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest";
import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData";
import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData";
import { IProfileCreateRequestData } from "@spt-aki/models/eft/profile/IProfileCreateRequestData";
import { ISearchFriendRequestData } from "@spt-aki/models/eft/profile/ISearchFriendRequestData";
import { ISearchFriendResponse } from "@spt-aki/models/eft/profile/ISearchFriendResponse";
import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
/** Handle profile related client events */
export declare class ProfileCallbacks {
protected httpResponse: HttpResponseUtil;
protected timeUtil: TimeUtil;
protected profileController: ProfileController;
constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, profileController: ProfileController);
protected profileHelper: ProfileHelper;
constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, profileController: ProfileController, profileHelper: ProfileHelper);
/**
* Handle client/game/profile/create
*/
createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<any>;
createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<ICreateProfileResponse>;
/**
* Handle client/game/profile/list
* Get the complete player profile (scav + pmc character)
@ -61,6 +66,11 @@ export declare class ProfileCallbacks {
* Called when creating a character when choosing a character face/voice
*/
getProfileStatus(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<GetProfileStatusResponseData>;
/**
* Handle client/profile/view
* Called when viewing another players profile
*/
getOtherProfile(url: string, request: IGetOtherProfileRequest, sessionID: string): IGetBodyResponseData<IGetOtherProfileResponse>;
/**
* Handle client/profile/settings
*/

View File

@ -1,17 +1,17 @@
import { QuestController } from "../controllers/QuestController";
import { RepeatableQuestController } from "../controllers/RepeatableQuestController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IQuest } from "../models/eft/common/tables/IQuest";
import { IPmcDataRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData";
import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData";
import { IListQuestsRequestData } from "../models/eft/quests/IListQuestsRequestData";
import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { QuestController } from "@spt-aki/controllers/QuestController";
import { RepeatableQuestController } from "@spt-aki/controllers/RepeatableQuestController";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IQuest } from "@spt-aki/models/eft/common/tables/IQuest";
import { IPmcDataRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IAcceptQuestRequestData } from "@spt-aki/models/eft/quests/IAcceptQuestRequestData";
import { ICompleteQuestRequestData } from "@spt-aki/models/eft/quests/ICompleteQuestRequestData";
import { IHandoverQuestRequestData } from "@spt-aki/models/eft/quests/IHandoverQuestRequestData";
import { IListQuestsRequestData } from "@spt-aki/models/eft/quests/IListQuestsRequestData";
import { IRepeatableQuestChangeRequest } from "@spt-aki/models/eft/quests/IRepeatableQuestChangeRequest";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export declare class QuestCallbacks {
protected httpResponse: HttpResponseUtil;
protected questController: QuestController;

View File

@ -1,26 +1,28 @@
import { OnLoad } from "../di/OnLoad";
import { OnUpdate } from "../di/OnUpdate";
import { RagfairController } from "../controllers/RagfairController";
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 { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IAddOfferRequestData } from "../models/eft/ragfair/IAddOfferRequestData";
import { IExtendOfferRequestData } from "../models/eft/ragfair/IExtendOfferRequestData";
import { IGetItemPriceResult } from "../models/eft/ragfair/IGetItemPriceResult";
import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPriceRequestData";
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";
import { RagfairController } from "@spt-aki/controllers/RagfairController";
import { OnLoad } from "@spt-aki/di/OnLoad";
import { OnUpdate } from "@spt-aki/di/OnUpdate";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IAddOfferRequestData } from "@spt-aki/models/eft/ragfair/IAddOfferRequestData";
import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOfferRequestData";
import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult";
import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData";
import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult";
import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest";
import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData";
import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData";
import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData";
import { IStorePlayerOfferTaxAmountRequestData } from "@spt-aki/models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { RagfairServer } from "@spt-aki/servers/RagfairServer";
import { RagfairTaxService } from "@spt-aki/services/RagfairTaxService";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
/**
* Handle ragfair related callback events
*/
@ -45,7 +47,7 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData<IGetItemPriceResult>;
/** Handle RagFairAddOffer event */
addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
/** \Handle RagFairRemoveOffer event */
/** Handle RagFairRemoveOffer event */
removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle RagFairRenewOffer event */
extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
/** Handle client/reports/ragfair/send */
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData;
/** Handle client/ragfair/offer/findbyid */
getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData<IRagfairOffer>;
}

View File

@ -1,8 +1,8 @@
import { RepairController } from "../controllers/RepairController";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionDataRequest";
import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest";
import { RepairController } from "@spt-aki/controllers/RepairController";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IRepairActionDataRequest } from "@spt-aki/models/eft/repair/IRepairActionDataRequest";
import { ITraderRepairActionDataRequest } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest";
export declare class RepairCallbacks {
protected repairController: RepairController;
constructor(repairController: RepairController);

View File

@ -1,8 +1,8 @@
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";
import { OnLoad } from "@spt-aki/di/OnLoad";
import { OnUpdate } from "@spt-aki/di/OnUpdate";
import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
export declare class SaveCallbacks implements OnLoad, OnUpdate {
protected saveServer: SaveServer;
protected configServer: ConfigServer;

View File

@ -1,9 +1,9 @@
import { TradeController } from "../controllers/TradeController";
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";
import { TradeController } from "@spt-aki/controllers/TradeController";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IProcessBaseTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBaseTradeRequestData";
import { IProcessRagfairTradeRequestData } from "@spt-aki/models/eft/trade/IProcessRagfairTradeRequestData";
import { ISellScavItemsToFenceRequestData } from "@spt-aki/models/eft/trade/ISellScavItemsToFenceRequestData";
export declare class TradeCallbacks {
protected tradeController: TradeController;
constructor(tradeController: TradeController);

View File

@ -1,14 +1,15 @@
import { OnLoad } from "../di/OnLoad";
import { OnUpdate } from "../di/OnUpdate";
import { TraderController } from "../controllers/TraderController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TraderController } from "@spt-aki/controllers/TraderController";
import { OnLoad } from "@spt-aki/di/OnLoad";
import { OnUpdate } from "@spt-aki/di/OnUpdate";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { ITraderAssort, ITraderBase } from "@spt-aki/models/eft/common/tables/ITrader";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export declare class TraderCallbacks implements OnLoad, OnUpdate {
protected httpResponse: HttpResponseUtil;
protected traderController: TraderController;
constructor(httpResponse: HttpResponseUtil, traderController: TraderController);
constructor(httpResponse: HttpResponseUtil, // TODO: delay required
traderController: TraderController);
onLoad(): Promise<void>;
onUpdate(): Promise<boolean>;
getRoute(): string;

View File

@ -1,8 +1,8 @@
import { WeatherController } from "../controllers/WeatherController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { IWeatherData } from "../models/eft/weather/IWeatherData";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { WeatherController } from "@spt-aki/controllers/WeatherController";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { IWeatherData } from "@spt-aki/models/eft/weather/IWeatherData";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export declare class WeatherCallbacks {
protected httpResponse: HttpResponseUtil;
protected weatherController: WeatherController;

View File

@ -1,7 +1,7 @@
import { WishlistController } from "../controllers/WishlistController";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData";
import { WishlistController } from "@spt-aki/controllers/WishlistController";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IWishlistActionData } from "@spt-aki/models/eft/wishlist/IWishlistActionData";
export declare class WishlistCallbacks {
protected wishlistController: WishlistController;
constructor(wishlistController: WishlistController);

View File

@ -1,20 +1,20 @@
import { ContextVariable } from "./ContextVariable";
import { ContextVariableType } from "./ContextVariableType";
import { ContextVariable } from "@spt-aki/context/ContextVariable";
import { ContextVariableType } from "@spt-aki/context/ContextVariableType";
export declare class ApplicationContext {
private variables;
private static holderMaxSize;
/**
* Called like:
*
* ```
* 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
* const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue<IGetRaidConfigurationRequestData>();
* ```
*/
getLatestValue(type: ContextVariableType): ContextVariable;
getValues(type: ContextVariableType): ContextVariable[];
addValue(type: ContextVariableType, value: any): void;
clearValues(type: ContextVariableType): void;
}

View File

@ -1,4 +1,4 @@
import { ContextVariableType } from "./ContextVariableType";
import { ContextVariableType } from "@spt-aki/context/ContextVariableType";
export declare class ContextVariable {
private value;
private timestamp;

View File

@ -6,5 +6,6 @@ export declare enum ContextVariableType {
/** Timestamp when client first connected */
CLIENT_START_TIMESTAMP = 2,
/** When player is loading into map and loot is requested */
REGISTER_PLAYER_REQUEST = 3
REGISTER_PLAYER_REQUEST = 3,
RAID_ADJUSTMENTS = 4
}

View File

@ -0,0 +1,23 @@
import { ICompletedAchievementsResponse } from "@spt-aki/models/eft/profile/ICompletedAchievementsResponse";
import { IGetAchievementsResponse } from "@spt-aki/models/eft/profile/IGetAchievementsResponse";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
/**
* Logic for handling In Raid callbacks
*/
export declare class AchievementController {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
constructor(logger: ILogger, databaseServer: DatabaseServer);
/**
* Get base achievements
* @param sessionID Session id
*/
getAchievements(sessionID: string): IGetAchievementsResponse;
/**
* Shows % of 'other' players who've completed each achievement
* @param sessionId Session id
* @returns ICompletedAchievementsResponse
*/
getAchievementStatistics(sessionId: string): ICompletedAchievementsResponse;
}

View File

@ -1,21 +1,24 @@
import { ApplicationContext } from "../context/ApplicationContext";
import { BotGenerator } from "../generators/BotGenerator";
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
import { BotHelper } from "../helpers/BotHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData";
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";
import { ApplicationContext } from "@spt-aki/context/ApplicationContext";
import { BotGenerator } from "@spt-aki/generators/BotGenerator";
import { BotDifficultyHelper } from "@spt-aki/helpers/BotDifficultyHelper";
import { BotHelper } from "@spt-aki/helpers/BotHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase";
import { IBotCore } from "@spt-aki/models/eft/common/tables/IBotCore";
import { Difficulty } from "@spt-aki/models/eft/common/tables/IBotType";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { BotGenerationCacheService } from "@spt-aki/services/BotGenerationCacheService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { MatchBotDetailsCacheService } from "@spt-aki/services/MatchBotDetailsCacheService";
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
export declare class BotController {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
@ -25,23 +28,24 @@ export declare class BotController {
protected botGenerationCacheService: BotGenerationCacheService;
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
protected localisationService: LocalisationService;
protected seasonalEventService: SeasonalEventService;
protected profileHelper: ProfileHelper;
protected configServer: ConfigServer;
protected applicationContext: ApplicationContext;
protected randomUtil: RandomUtil;
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, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, jsonUtil: JsonUtil);
/**
* Return the number of bot loadout varieties to be generated
* @param type bot Type we want the loadout gen count for
* Return the number of bot load-out varieties to be generated
* @param type bot Type we want the load-out gen count for
* @returns number of bots to generate
*/
getBotPresetGenerationLimit(type: string): number;
/**
* Handle singleplayer/settings/bot/difficulty
* Get the core.json difficulty settings from database\bots
* Get the core.json difficulty settings from database/bots
* @returns IBotCore
*/
getBotCoreDifficulty(): IBotCore;
@ -49,10 +53,10 @@ export declare class BotController {
* Get bot difficulty settings
* adjust PMC settings to ensure they engage the correct bot types
* @param type what bot the server is requesting settings for
* @param difficulty difficulty level server requested settings for
* @param diffLevel difficulty level server requested settings for
* @returns Difficulty object
*/
getBotDifficulty(type: string, difficulty: string): Difficulty;
getBotDifficulty(type: string, diffLevel: string): Difficulty;
/**
* Generate bot profiles and store in cache
* @param sessionId Session id
@ -61,7 +65,22 @@ export declare class BotController {
*/
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
/**
* Get the difficulty passed in, if its not "asoline", get selected difficulty from config
* On first bot generation bots are generated and stored inside a cache, ready to be used later
* @param request Bot generation request object
* @param pmcProfile Player profile
* @param sessionId Session id
* @returns
*/
protected generateBotsFirstTime(request: IGenerateBotsRequestData, pmcProfile: IPmcData, sessionId: string): IBotBase[];
/**
* Pull a single bot out of cache and return, if cache is empty add bots to it and then return
* @param sessionId Session id
* @param request Bot generation request object
* @returns Single IBotBase object
*/
protected returnSingleBotFromCache(sessionId: string, request: IGenerateBotsRequestData): IBotBase[];
/**
* Get the difficulty passed in, if its not "asonline", get selected difficulty from config
* @param requestedDifficulty
* @returns
*/

36
types/controllers/BuildController.d.ts vendored Normal file
View File

@ -0,0 +1,36 @@
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { ISetMagazineRequest } from "@spt-aki/models/eft/builds/ISetMagazineRequest";
import { IPresetBuildActionRequestData } from "@spt-aki/models/eft/presetBuild/IPresetBuildActionRequestData";
import { IRemoveBuildRequestData } from "@spt-aki/models/eft/presetBuild/IRemoveBuildRequestData";
import { IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
export declare class BuildController {
protected logger: ILogger;
protected hashUtil: HashUtil;
protected eventOutputHolder: EventOutputHolder;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper;
protected saveServer: SaveServer;
constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, saveServer: SaveServer);
/** Handle client/handbook/builds/my/list */
getUserBuilds(sessionID: string): IUserBuilds;
/** Handle client/builds/weapon/save */
saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void;
/** Handle client/builds/equipment/save event */
saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void;
/** Handle client/builds/delete*/
removeBuild(sessionID: string, request: IRemoveBuildRequestData): void;
protected removePlayerBuild(id: string, sessionID: string): void;
/**
* Handle client/builds/magazine/save
*/
createMagazineTemplate(sessionId: string, request: ISetMagazineRequest): void;
}

View File

@ -0,0 +1,10 @@
import { IClientLogRequest } from "@spt-aki/models/spt/logging/IClientLogRequest";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
export declare class ClientLogController {
protected logger: ILogger;
constructor(logger: ILogger);
/**
* Handle /singleplayer/log
*/
clientLog(logRequest: IClientLogRequest): void;
}

View File

@ -1,14 +1,14 @@
import { ProfileHelper } from "../helpers/ProfileHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { ISuit } from "../models/eft/common/tables/ITrader";
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";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
import { LocalisationService } from "../services/LocalisationService";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { ISuit } from "@spt-aki/models/eft/common/tables/ITrader";
import { ClothingItem, IBuyClothingRequestData } from "@spt-aki/models/eft/customization/IBuyClothingRequestData";
import { IWearClothingRequestData } from "@spt-aki/models/eft/customization/IWearClothingRequestData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
export declare class CustomizationController {
protected logger: ILogger;
protected eventOutputHolder: EventOutputHolder;

View File

@ -1,34 +1,27 @@
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 { 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";
import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot";
import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper";
import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse";
import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse";
import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData";
import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewResponseData";
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile";
import { MessageType } from "@spt-aki/models/enums/MessageType";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { MailSendService } from "@spt-aki/services/MailSendService";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class DialogueController {
protected logger: ILogger;
protected saveServer: SaveServer;
protected timeUtil: TimeUtil;
protected 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);
protected dialogueChatBots: IDialogueChatBot[];
constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]);
registerChatBot(chatBot: IDialogueChatBot): void;
/** Handle onUpdate spt event */
update(): void;
/**
@ -117,18 +110,11 @@ export declare class DialogueController {
* Get all uncollected items attached to mail in a particular dialog
* @param dialogueId Dialog to get mail attachments from
* @param sessionId Session id
* @returns
* @returns 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

View File

@ -1,36 +1,41 @@
import { ApplicationContext } from "../context/ApplicationContext";
import { HideoutHelper } from "../helpers/HideoutHelper";
import { HttpServerHelper } from "../helpers/HttpServerHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { PreAkiModLoader } from "../loaders/PreAkiModLoader";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { 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";
import { ApplicationContext } from "@spt-aki/context/ApplicationContext";
import { HideoutHelper } from "@spt-aki/helpers/HideoutHelper";
import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { PreAkiModLoader } from "@spt-aki/loaders/PreAkiModLoader";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse";
import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse";
import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse";
import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveResponse";
import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest";
import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse";
import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails";
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig";
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig";
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
import { ILootConfig } from "@spt-aki/models/spt/config/ILootConfig";
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { CustomLocationWaveService } from "@spt-aki/services/CustomLocationWaveService";
import { GiftService } from "@spt-aki/services/GiftService";
import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { OpenZoneService } from "@spt-aki/services/OpenZoneService";
import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService";
import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService";
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class GameController {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
@ -49,30 +54,30 @@ export declare class GameController {
protected seasonalEventService: SeasonalEventService;
protected itemBaseClassService: ItemBaseClassService;
protected giftService: GiftService;
protected raidTimeAdjustmentService: RaidTimeAdjustmentService;
protected applicationContext: ApplicationContext;
protected configServer: ConfigServer;
protected os: any;
protected httpConfig: IHttpConfig;
protected coreConfig: ICoreConfig;
protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig;
protected hideoutConfig: IHideoutConfig;
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);
protected botConfig: IBotConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer);
load(): void;
/**
* Handle client/game/start
*/
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
protected adjustLocationBotValues(): void;
/**
* Out of date/incorrectly made trader mods forget this data
*/
protected checkTraderRepairValuesExist(): 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;
/**
@ -95,6 +100,10 @@ export declare class GameController {
* Handle client/game/keepalive
*/
getKeepAlive(sessionId: string): IGameKeepAliveResponse;
/**
* Handle singleplayer/settings/getRaidTime
*/
getRaidTime(sessionId: string, request: IGetRaidTimeRequest): IGetRaidTimeResponse;
/**
* BSG have two values for shotgun dispersion, we make sure both have the same value
*/
@ -107,8 +116,7 @@ export declare class GameController {
protected flagAllItemsInDbAsSellableOnFlea(): void;
/**
* When player logs in, iterate over all active effects and reduce timer
* TODO - add body part HP regen
* @param pmcProfile
* @param pmcProfile Profile to adjust values for
*/
protected updateProfileHealthValues(pmcProfile: IPmcData): void;
/**
@ -125,7 +133,8 @@ export declare class GameController {
*/
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
* 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;
/**
@ -134,7 +143,7 @@ export declare class GameController {
*/
protected saveActiveModsToProfile(fullProfile: IAkiProfile): void;
/**
* Check for any missing assorts inside each traders assort.json data, checking against traders qeustassort.json
* Check for any missing assorts inside each traders assort.json data, checking against traders questassort.json
*/
protected validateQuestAssortUnlocksExist(): void;
/**

View File

@ -1,5 +1,5 @@
import { HandbookHelper } from "../helpers/HandbookHelper";
import { DatabaseServer } from "../servers/DatabaseServer";
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
export declare class HandbookController {
protected databaseServer: DatabaseServer;
protected handbookHelper: HandbookHelper;

View File

@ -1,19 +1,19 @@
import { HealthHelper } from "../helpers/HealthHelper";
import { InventoryHelper } from "../helpers/InventoryHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData";
import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData";
import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData";
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
import { IWorkoutData } from "../models/eft/health/IWorkoutData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { 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";
import { HealthHelper } from "@spt-aki/helpers/HealthHelper";
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IHealthTreatmentRequestData } from "@spt-aki/models/eft/health/IHealthTreatmentRequestData";
import { IOffraidEatRequestData } from "@spt-aki/models/eft/health/IOffraidEatRequestData";
import { IOffraidHealRequestData } from "@spt-aki/models/eft/health/IOffraidHealRequestData";
import { ISyncHealthRequestData } from "@spt-aki/models/eft/health/ISyncHealthRequestData";
import { IWorkoutData } from "@spt-aki/models/eft/health/IWorkoutData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { PaymentService } from "@spt-aki/services/PaymentService";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
export declare class HealthController {
protected logger: ILogger;
protected jsonUtil: JsonUtil;

View File

@ -1,42 +1,44 @@
import { ScavCaseRewardGenerator } from "../generators/ScavCaseRewardGenerator";
import { HideoutHelper } from "../helpers/HideoutHelper";
import { InventoryHelper } from "../helpers/InventoryHelper";
import { PaymentHelper } from "../helpers/PaymentHelper";
import { PresetHelper } from "../helpers/PresetHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase";
import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData";
import { 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";
import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData";
import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData";
import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData";
import { IHideoutTakeItemOutRequestData } from "../models/eft/hideout/IHideoutTakeItemOutRequestData";
import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData";
import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData";
import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData";
import { IQteData } from "../models/eft/hideout/IQteData";
import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { HideoutAreas } from "../models/enums/HideoutAreas";
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
import { FenceService } from "../services/FenceService";
import { LocalisationService } from "../services/LocalisationService";
import { PlayerService } from "../services/PlayerService";
import { HashUtil } from "../utils/HashUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
import { ScavCaseRewardGenerator } from "@spt-aki/generators/ScavCaseRewardGenerator";
import { HideoutHelper } from "@spt-aki/helpers/HideoutHelper";
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper";
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { HideoutArea, ITaskConditionCounter, Product } from "@spt-aki/models/eft/common/tables/IBotBase";
import { HideoutUpgradeCompleteRequestData } from "@spt-aki/models/eft/hideout/HideoutUpgradeCompleteRequestData";
import { IHandleQTEEventRequestData } from "@spt-aki/models/eft/hideout/IHandleQTEEventRequestData";
import { IHideoutArea, Stage } from "@spt-aki/models/eft/hideout/IHideoutArea";
import { IHideoutCancelProductionRequestData } from "@spt-aki/models/eft/hideout/IHideoutCancelProductionRequestData";
import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData";
import { IHideoutImproveAreaRequestData } from "@spt-aki/models/eft/hideout/IHideoutImproveAreaRequestData";
import { IHideoutProduction } from "@spt-aki/models/eft/hideout/IHideoutProduction";
import { IHideoutPutItemInRequestData } from "@spt-aki/models/eft/hideout/IHideoutPutItemInRequestData";
import { IHideoutScavCaseStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutScavCaseStartRequestData";
import { IHideoutSingleProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutSingleProductionStartRequestData";
import { IHideoutTakeItemOutRequestData } from "@spt-aki/models/eft/hideout/IHideoutTakeItemOutRequestData";
import { IHideoutTakeProductionRequestData } from "@spt-aki/models/eft/hideout/IHideoutTakeProductionRequestData";
import { IHideoutToggleAreaRequestData } from "@spt-aki/models/eft/hideout/IHideoutToggleAreaRequestData";
import { IHideoutUpgradeRequestData } from "@spt-aki/models/eft/hideout/IHideoutUpgradeRequestData";
import { IQteData } from "@spt-aki/models/eft/hideout/IQteData";
import { IRecordShootingRangePoints } from "@spt-aki/models/eft/hideout/IRecordShootingRangePoints";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas";
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { FenceService } from "@spt-aki/services/FenceService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { PlayerService } from "@spt-aki/services/PlayerService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class HideoutController {
protected logger: ILogger;
protected hashUtil: HashUtil;
@ -44,6 +46,7 @@ export declare class HideoutController {
protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil;
protected inventoryHelper: InventoryHelper;
protected itemHelper: ItemHelper;
protected saveServer: SaveServer;
protected playerService: PlayerService;
protected presetHelper: PresetHelper;
@ -57,34 +60,34 @@ export declare class HideoutController {
protected configServer: ConfigServer;
protected jsonUtil: JsonUtil;
protected fenceService: FenceService;
protected static nameBackendCountersCrafting: string;
/** Key used in TaskConditionCounters array */
protected static nameTaskConditionCountersCrafting: string;
protected hideoutConfig: IHideoutConfig;
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService);
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService);
/**
* Handle HideoutUpgrade event
* Start a hideout area upgrade
* @param pmcData Player profile
* @param request upgrade start request
* @param sessionID Session id
* @returns IItemEventRouterResponse
* @param output Client response
*/
startUpgrade(pmcData: IPmcData, request: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
startUpgrade(pmcData: IPmcData, request: IHideoutUpgradeRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/**
* Handle HideoutUpgradeComplete event
* Complete a hideout area upgrade
* @param pmcData Player profile
* @param request Completed upgrade request
* @param sessionID Session id
* @returns IItemEventRouterResponse
* @param output Client response
*/
upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/**
* 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
@ -101,8 +104,7 @@ export declare class HideoutController {
*/
protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void;
/**
*
* @param output Objet to send to client
* @param output Object to send to client
* @param sessionID Session/player id
* @param areaType Hideout area that had stash added
* @param hideoutDbData Hideout area that caused addition of stash
@ -203,26 +205,23 @@ export declare class HideoutController {
* @param pmcData Player profile
* @param request Remove production from area request
* @param output Output object to update
* @returns IItemEventRouterResponse
*/
protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): void;
/**
* Get the "CounterHoursCrafting" TaskConditionCounter from a profile
* @param pmcData Profile to get counter from
* @param recipe Recipe being crafted
* @returns ITaskConditionCounter
*/
protected getHoursCraftingTaskConditionCounter(pmcData: IPmcData, recipe: IHideoutProduction): ITaskConditionCounter;
/**
* Handles generating case rewards and sending to player inventory
* @param sessionID Session id
* @param pmcData Player profile
* @param request Get rewards from scavcase craft request
* @param output Output object to update
* @returns IItemEventRouterResponse
*/
protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
/**
* Start area production for item by adding production to profiles' Hideout.Production array
* @param pmcData Player profile
* @param request Start production request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
registerProduction(pmcData: IPmcData, request: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): void;
/**
* Get quick time event list for hideout
* // TODO - implement this
@ -237,7 +236,7 @@ export declare class HideoutController {
* @param pmcData Profile to adjust
* @param request QTE result object
*/
handleQTEEventOutcome(sessionId: string, pmcData: IPmcData, request: IHandleQTEEventRequestData): IItemEventRouterResponse;
handleQTEEventOutcome(sessionId: string, pmcData: IPmcData, request: IHandleQTEEventRequestData, output: IItemEventRouterResponse): void;
/**
* Record a high score from the shooting range into a player profiles overallcounters
* @param sessionId Session id
@ -245,14 +244,22 @@ export declare class HideoutController {
* @param request shooting range score request
* @returns IItemEventRouterResponse
*/
recordShootingRangePoints(sessionId: string, pmcData: IPmcData, request: IRecordShootingRangePoints): IItemEventRouterResponse;
recordShootingRangePoints(sessionId: string, pmcData: IPmcData, request: IRecordShootingRangePoints): void;
/**
* Handle client/game/profile/items/moving - HideoutImproveArea
* @param sessionId Session id
* @param pmcData profile to improve area in
* @param request improve area request data
* @param pmcData Profile to improve area in
* @param request Improve area request data
*/
improveArea(sessionId: string, pmcData: IPmcData, request: IHideoutImproveAreaRequestData): IItemEventRouterResponse;
/**
* Handle client/game/profile/items/moving HideoutCancelProductionCommand
* @param sessionId Session id
* @param pmcData Profile with craft to cancel
* @param request Cancel production request data
* @returns IItemEventRouterResponse
*/
cancelProduction(sessionId: string, pmcData: IPmcData, request: IHideoutCancelProductionRequestData): IItemEventRouterResponse;
/**
* Function called every x seconds as part of onUpdate event
*/

View File

@ -1,27 +1,36 @@
import { ApplicationContext } from "../context/ApplicationContext";
import { PlayerScavGenerator } from "../generators/PlayerScavGenerator";
import { HealthHelper } from "../helpers/HealthHelper";
import { InRaidHelper } from "../helpers/InRaidHelper";
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 { 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";
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";
import { ApplicationContext } from "@spt-aki/context/ApplicationContext";
import { PlayerScavGenerator } from "@spt-aki/generators/PlayerScavGenerator";
import { HealthHelper } from "@spt-aki/helpers/HealthHelper";
import { InRaidHelper } from "@spt-aki/helpers/InRaidHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { IRegisterPlayerRequestData } from "@spt-aki/models/eft/inRaid/IRegisterPlayerRequestData";
import { ISaveProgressRequestData } from "@spt-aki/models/eft/inRaid/ISaveProgressRequestData";
import { PlayerRaidEndState } from "@spt-aki/models/enums/PlayerRaidEndState";
import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig";
import { IBTRConfig } from "@spt-aki/models/spt/config/IBTRConfig";
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig";
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
import { ITraderServiceModel } from "@spt-aki/models/spt/services/ITraderServiceModel";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { InsuranceService } from "@spt-aki/services/InsuranceService";
import { MailSendService } from "@spt-aki/services/MailSendService";
import { MatchBotDetailsCacheService } from "@spt-aki/services/MatchBotDetailsCacheService";
import { PmcChatResponseService } from "@spt-aki/services/PmcChatResponseService";
import { TraderServicesService } from "@spt-aki/services/TraderServicesService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
/**
* Logic for handling In Raid callbacks
*/
@ -39,13 +48,21 @@ export declare class InraidController {
protected playerScavGenerator: PlayerScavGenerator;
protected healthHelper: HealthHelper;
protected traderHelper: TraderHelper;
protected traderServicesService: TraderServicesService;
protected insuranceService: InsuranceService;
protected inRaidHelper: InRaidHelper;
protected applicationContext: ApplicationContext;
protected configServer: ConfigServer;
protected mailSendService: MailSendService;
protected randomUtil: RandomUtil;
protected airdropConfig: IAirdropConfig;
protected inraidConfig: IInRaidConfig;
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);
protected btrConfig: IBTRConfig;
protected inRaidConfig: IInRaidConfig;
protected traderConfig: ITraderConfig;
protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig;
protected hideoutConfig: IHideoutConfig;
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil);
/**
* Save locationId to active profiles inraid object AND app context
* @param sessionID Session id
@ -62,21 +79,19 @@ export declare class InraidController {
savePostRaidProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
/**
* Handle updating player profile post-pmc raid
* @param sessionID session id
* @param offraidData post-raid data
* @param sessionID Session id
* @param postRaidRequest Post-raid data
*/
protected savePmcProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
protected savePmcProgress(sessionID: string, postRaidRequest: ISaveProgressRequestData): void;
/**
* Make changes to pmc profile after they've died in raid,
* Make changes to PMC profile after they've died in raid,
* Alter body part 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;
protected performPostRaidActionsWhenDead(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData, sessionID: string): IPmcData;
/**
* Adjust player characters body part hp post-raid
* @param postRaidSaveRequest post raid data
@ -86,15 +101,41 @@ export declare class InraidController {
/**
* Reduce body part hp to % of max
* @param pmcData profile to edit
* @param multipler multipler to apply to max health
* @param multiplier multiplier to apply to max health
*/
protected reducePmcHealthToPercent(pmcData: IPmcData, multipler: number): void;
protected reducePmcHealthToPercent(pmcData: IPmcData, multiplier: number): void;
/**
* Handle updating the profile post-pscav raid
* @param sessionID session id
* @param offraidData post-raid data of raid
* @param sessionID Session id
* @param postRaidRequest Post-raid data of raid
*/
protected savePlayerScavProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
protected savePlayerScavProgress(sessionID: string, postRaidRequest: ISaveProgressRequestData): void;
/**
* merge two dictionaries together
* Prioritise pair that has true as a value
* @param primary main dictionary
* @param secondary Secondary dictionary
*/
protected mergePmcAndScavEncyclopedias(primary: IPmcData, secondary: IPmcData): void;
/**
* Post-scav-raid any charisma increase must be propigated into PMC profile
* @param postRaidServerScavProfile Scav profile after adjustments made from raid
* @param postRaidServerPmcProfile Pmc profile after raid
* @param preRaidScavCharismaProgress charisma progress value pre-raid
*/
protected updatePmcCharismaSkillPostScavRaid(postRaidServerScavProfile: IPmcData, postRaidServerPmcProfile: IPmcData, preRaidScavCharismaProgress: number): void;
/**
* Does provided profile contain any condition counters
* @param profile Profile to check for condition counters
* @returns Profile has condition counters
*/
protected profileHasConditionCounters(profile: IPmcData): boolean;
/**
* Scav quest progress isnt transferred automatically from scav to pmc, we do this manually
* @param scavProfile Scav profile with quest progress post-raid
* @param pmcProfile Server pmc profile to copy scav quest progress into
*/
protected migrateScavQuestProgressToPmcProfile(scavProfile: IPmcData, pmcProfile: IPmcData): void;
/**
* Is the player dead after a raid - dead is anything other than "survived" / "runner"
* @param statusOnExit exit value from offraidData object
@ -120,9 +161,8 @@ export declare class InraidController {
* @param pmcData Pmc profile
* @param offraidData Post-raid save request
* @param scavData Scav profile
* @param sessionID Session id
*/
protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void;
protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData): void;
/**
* Get the inraid config from configs/inraid.json
* @returns InRaid Config
@ -133,4 +173,20 @@ export declare class InraidController {
* @returns Airdrop config
*/
getAirdropConfig(): IAirdropConfig;
/**
* Get BTR config from configs/btr.json
* @returns Airdrop config
*/
getBTRConfig(): IBTRConfig;
/**
* Handle singleplayer/traderServices/getTraderServices
* @returns Trader services data
*/
getTraderServices(sessionId: string, traderId: string): ITraderServiceModel[];
/**
* Handle singleplayer/traderServices/itemDelivery
*/
itemDelivery(sessionId: string, traderId: string, items: Item[]): void;
getTraitorScavHostileChance(url: string, sessionID: string): number;
getSandboxMaxPatrolValue(url: string, sessionID: string): number;
}

View File

@ -1,29 +1,32 @@
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";
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";
import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData";
import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData";
import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { Insurance } from "@spt-aki/models/eft/profile/IAkiProfile";
import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { InsuranceService } from "@spt-aki/services/InsuranceService";
import { MailSendService } from "@spt-aki/services/MailSendService";
import { PaymentService } from "@spt-aki/services/PaymentService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { MathUtil } from "@spt-aki/utils/MathUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class InsuranceController {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected mathUtil: MathUtil;
protected hashUtil: HashUtil;
protected eventOutputHolder: EventOutputHolder;
protected timeUtil: TimeUtil;
protected saveServer: SaveServer;
@ -37,7 +40,8 @@ export declare class InsuranceController {
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, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer);
protected roubleTpl: string;
constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer);
/**
* Process insurance items of all profiles prior to being given back to the player through the mail service.
*
@ -67,67 +71,108 @@ export declare class InsuranceController {
*/
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.
* Count all items in all insurance packages.
* @param insurance
* @returns
*/
protected findItemsToDelete(insured: Insurance): string[];
protected countAllInsuranceItems(insurance: Insurance[]): number;
/**
* Filters an item based on its existence in the database, raid moddability, and slot requirements.
* Remove an insurance package from a profile using the package's system data information.
*
* @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.
* @param sessionID The session ID of the profile to remove the package from.
* @param index The array index of the insurance package to remove.
* @returns void
*/
protected groupChildrenByParent(item: Item, childrenGroupedByParent: Map<string, Item[]>): void;
protected removeInsurancePackageFromProfile(sessionID: string, insPackage: Insurance): 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.
* Finds the items that should be deleted based on the given Insurance object.
*
* @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 rootItemParentID - The ID that should be assigned to all "hideout"/root items.
* @param insured - The insurance object containing the items to evaluate for deletion.
* @returns A Set containing the IDs of items that should be deleted.
*/
protected findItemsToDelete(rootItemParentID: string, insured: Insurance): Set<string>;
/**
* Initialize a Map object that holds main-parents to all of their attachments. Note that "main-parent" in this
* context refers to the parent item that an attachment is attached to. For example, a suppressor attached to a gun,
* not the backpack that the gun is located in (the gun's parent).
*
* @param rootItemParentID - The ID that should be assigned to all "hideout"/root items.
* @param insured - The insurance object containing the items to evaluate.
* @param itemsMap - A Map object for quick item look-up by item ID.
* @returns A Map object containing parent item IDs to arrays of their attachment items.
*/
protected populateParentAttachmentsMap(rootItemParentID: string, insured: Insurance, itemsMap: Map<string, Item>): Map<string, Item[]>;
/**
* Remove attachments that can not be moddable in-raid from the parentAttachmentsMap. If no moddable attachments
* remain, the parent is removed from the map as well.
*
* @param parentAttachmentsMap - A Map object containing parent item IDs to arrays of their attachment items.
* @param itemsMap - A Map object for quick item look-up by item ID.
* @returns A Map object containing parent item IDs to arrays of their attachment items which are not moddable in-raid.
*/
protected removeNonModdableAttachments(parentAttachmentsMap: Map<string, Item[]>, itemsMap: Map<string, Item>): Map<string, Item[]>;
/**
* Process "regular" insurance items. Any insured item that is not an attached, attachment is considered a "regular"
* item. This method iterates over them, preforming item deletion rolls to see if they should be deleted. If so,
* they (and their attached, attachments, if any) are marked for deletion in the toDelete Set.
*
* @param insured The insurance object containing the items to evaluate.
* @param toDelete A Set to keep track of items marked for deletion.
* @param parentAttachmentsMap A Map object containing parent item IDs to arrays of their attachment items.
* @returns void
*/
protected processRegularItems(insured: Insurance, toDelete: Set<string>, parentAttachmentsMap: Map<string, Item[]>): void;
/**
* Process parent items and their attachments, updating the toDelete Set accordingly.
*
* @param mainParentToAttachmentsMap A Map object containing parent item IDs to arrays of their attachment items.
* @param itemsMap A Map object for quick item look-up by item ID.
* @param traderId The trader ID from the Insurance object.
* @param toDelete A Set object to keep track of items marked for deletion.
*/
protected processAttachments(mainParentToAttachmentsMap: Map<string, Item[]>, itemsMap: Map<string, Item>, traderId: string, toDelete: Set<string>): void;
/**
* Takes an array of attachment items that belong to the same main-parent item, sorts them in descending order by
* their maximum price. For each attachment, a roll is made to determine if a deletion should be made. Once the
* number of deletions has been counted, the attachments are added to the toDelete Set, starting with the most
* valuable attachments first.
*
* @param attachments The array of attachment items to sort, filter, and roll.
* @param traderId The ID of the trader to that has ensured these items.
* @param toDelete The array that accumulates the IDs of the items to be deleted.
* @returns void
*/
protected sortAndFilterChildren(children: Item[], traderId: string, toDelete: string[]): void;
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): void;
/**
* Sorts the attachment items by their max price in descending order.
*
* @param attachments The array of attachments items.
* @returns An array of items enriched with their max price and common locale-name.
*/
protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[];
/**
* Logs the details of each attachment item.
*
* @param attachments The array of attachment items.
*/
protected logAttachmentsDetails(attachments: EnrichedItem[]): void;
/**
* Counts the number of successful rolls for the attachment items.
*
* @param attachments The array of attachment items.
* @param traderId The ID of the trader that has insured these attachments.
* @returns The number of successful rolls.
*/
protected countSuccessfulRolls(attachments: Item[], traderId: string): number;
/**
* Marks the most valuable attachments for deletion based on the number of successful rolls made.
*
* @param attachments The array of attachment items.
* @param successfulRolls The number of successful rolls.
* @param toDelete The array that accumulates the IDs of the items to be deleted.
*/
protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set<string>): void;
/**
* Remove items from the insured items that should not be returned to the player.
*
@ -135,26 +180,24 @@ export declare class InsuranceController {
* @param toDelete The items that should be deleted.
* @returns void
*/
protected removeItemsFromInsurance(insured: Insurance, toDelete: string[]): void;
protected removeItemsFromInsurance(insured: Insurance, toDelete: Set<string>): void;
/**
* Handle sending the insurance message to the user that potentially contains the valid insurance items.
*
* @param sessionID The session ID that should receive the insurance message.
* @param insurance The context of insurance to use.
* @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;
protected sendMail(sessionID: string, insurance: Insurance): void;
/**
* Determines whether a valid insured item should be removed from the player's inventory based on a random roll and
* Determines whether a 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.
* @param insuredItem Optional. The item to roll for. Only used for logging.
* @returns true if the insured item should be removed from inventory, false otherwise, or null on error.
*/
protected rollForItemDelete(insuredItem: Item, traderId: string, itemsBeingDeleted: string[]): boolean;
protected rollForDelete(traderId: string, insuredItem?: Item): boolean | null;
/**
* Handle Insure event
* Add insurance to an item
@ -175,3 +218,8 @@ export declare class InsuranceController {
*/
cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData;
}
interface EnrichedItem extends Item {
name: string;
maxPrice: number;
}
export {};

View File

@ -1,39 +1,44 @@
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 { QuestHelper } from "../helpers/QuestHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IInventoryBindRequestData } from "../models/eft/inventory/IInventoryBindRequestData";
import { IInventoryCreateMarkerRequestData } from "../models/eft/inventory/IInventoryCreateMarkerRequestData";
import { IInventoryDeleteMarkerRequestData } from "../models/eft/inventory/IInventoryDeleteMarkerRequestData";
import { IInventoryEditMarkerRequestData } from "../models/eft/inventory/IInventoryEditMarkerRequestData";
import { IInventoryExamineRequestData } from "../models/eft/inventory/IInventoryExamineRequestData";
import { IInventoryFoldRequestData } from "../models/eft/inventory/IInventoryFoldRequestData";
import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData";
import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData";
import { IInventoryReadEncyclopediaRequestData } from "../models/eft/inventory/IInventoryReadEncyclopediaRequestData";
import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData";
import { IInventorySortRequestData } from "../models/eft/inventory/IInventorySortRequestData";
import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData";
import { IInventorySwapRequestData } from "../models/eft/inventory/IInventorySwapRequestData";
import { IInventoryTagRequestData } from "../models/eft/inventory/IInventoryTagRequestData";
import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryToggleRequestData";
import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData";
import { IOpenRandomLootContainerRequestData } from "../models/eft/inventory/IOpenRandomLootContainerRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { DatabaseServer } from "../servers/DatabaseServer";
import { FenceService } from "../services/FenceService";
import { LocalisationService } from "../services/LocalisationService";
import { RagfairOfferService } from "../services/RagfairOfferService";
import { HashUtil } from "../utils/HashUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { LootGenerator } from "@spt-aki/generators/LootGenerator";
import { HideoutHelper } from "@spt-aki/helpers/HideoutHelper";
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper";
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IInventoryBindRequestData } from "@spt-aki/models/eft/inventory/IInventoryBindRequestData";
import { IInventoryCreateMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryCreateMarkerRequestData";
import { IInventoryDeleteMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryDeleteMarkerRequestData";
import { IInventoryEditMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryEditMarkerRequestData";
import { IInventoryExamineRequestData } from "@spt-aki/models/eft/inventory/IInventoryExamineRequestData";
import { IInventoryFoldRequestData } from "@spt-aki/models/eft/inventory/IInventoryFoldRequestData";
import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData";
import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData";
import { IInventoryReadEncyclopediaRequestData } from "@spt-aki/models/eft/inventory/IInventoryReadEncyclopediaRequestData";
import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData";
import { IInventorySortRequestData } from "@spt-aki/models/eft/inventory/IInventorySortRequestData";
import { IInventorySplitRequestData } from "@spt-aki/models/eft/inventory/IInventorySplitRequestData";
import { IInventorySwapRequestData } from "@spt-aki/models/eft/inventory/IInventorySwapRequestData";
import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInventoryTagRequestData";
import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData";
import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData";
import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData";
import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData";
import { ISetFavoriteItems } from "@spt-aki/models/eft/inventory/ISetFavoriteItems";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { FenceService } from "@spt-aki/services/FenceService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { PlayerService } from "@spt-aki/services/PlayerService";
import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
export declare class InventoryController {
protected logger: ILogger;
protected hashUtil: HashUtil;
@ -45,14 +50,16 @@ export declare class InventoryController {
protected presetHelper: PresetHelper;
protected inventoryHelper: InventoryHelper;
protected questHelper: QuestHelper;
protected hideoutHelper: HideoutHelper;
protected ragfairOfferService: RagfairOfferService;
protected profileHelper: ProfileHelper;
protected paymentHelper: PaymentHelper;
protected localisationService: LocalisationService;
protected playerService: PlayerService;
protected lootGenerator: LootGenerator;
protected eventOutputHolder: EventOutputHolder;
protected 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);
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
/**
* Move Item
* change location of item with parentId and slotId
@ -61,55 +68,52 @@ export declare class InventoryController {
* @param pmcData Profile
* @param moveRequest Move request data
* @param sessionID Session id
* @returns IItemEventRouterResponse
* @param output Client response
*/
moveItem(pmcData: IPmcData, moveRequest: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
moveItem(pmcData: IPmcData, moveRequest: IInventoryMoveRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/**
* 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;
protected appendTraderExploitErrorResponse(output: IItemEventRouterResponse): void;
/**
* Handle Remove event
* Implements functionality "Discard" from Main menu (Stash etc.)
* Removes item from PMC Profile
*/
discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse;
discardItem(pmcData: IPmcData, request: IInventoryRemoveRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/**
* Split Item
* spliting 1 stack into 2
* @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile)
* @param request Split request
* @param sessionID Session/player id
* @param output Client response
* @returns IItemEventRouterResponse
*/
splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;
splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/**
* 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
* @param output Client response
* @returns IItemEventRouterResponse
*/
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse;
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/**
* 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
* @param output Client response
* @returns IItemEventRouterResponse
*/
transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse;
transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/**
* Swap Item
* its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment
@ -119,7 +123,7 @@ export declare class InventoryController {
/**
* Handles folding of Weapons
*/
foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
foldItem(pmcData: IPmcData, request: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Toggles "Toggleable" items like night vision goggles and face shields.
* @param pmcData player profile
@ -138,26 +142,38 @@ export declare class InventoryController {
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Bind an inventory item to the quick access menu at bottom of player screen
* Handle bind event
* @param pmcData Player profile
* @param bindRequest Reqeust object
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
bindItem(pmcData: IPmcData, bindRequest: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
bindItem(pmcData: IPmcData, bindRequest: IInventoryBindRequestData, sessionID: string): void;
/**
* Unbind an inventory item from quick access menu at bottom of player screen
* Handle unbind event
* @param pmcData Player profile
* @param bindRequest Request object
* @param sessionID Session id
* @param output Client response
*/
unbindItem(pmcData: IPmcData, request: IInventoryBindRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/**
* Handles examining an item
* @param pmcData player profile
* @param body request object
* @param sessionID session id
* @param output Client response
* @returns response
*/
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse;
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], fullProfile: IAkiProfile): void;
/**
* Get the tplid of an item from the examine request object
* @param body response request
* @returns tplid
* @param request Response request
* @returns tplId
*/
protected getExaminedItemTpl(body: IInventoryExamineRequestData): string;
protected getExaminedItemTpl(request: IInventoryExamineRequestData): string;
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle ApplyInventoryChanges
@ -165,33 +181,33 @@ export declare class InventoryController {
* @param pmcData Player profile
* @param request sort request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
sortInventory(pmcData: IPmcData, request: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse;
sortInventory(pmcData: IPmcData, request: IInventorySortRequestData, sessionID: string): void;
/**
* Add note to a map
* @param pmcData Player profile
* @param request Add marker request
* @param sessionID Session id
* @param output Client response
* @returns IItemEventRouterResponse
*/
createMapMarker(pmcData: IPmcData, request: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse;
createMapMarker(pmcData: IPmcData, request: IInventoryCreateMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/**
* Delete a map marker
* @param pmcData Player profile
* @param request Delete marker request
* @param sessionID Session id
* @returns IItemEventRouterResponse
* @param output Client response
*/
deleteMapMarker(pmcData: IPmcData, request: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse;
deleteMapMarker(pmcData: IPmcData, request: IInventoryDeleteMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/**
* Edit an existing map marker
* @param pmcData Player profile
* @param request Edit marker request
* @param sessionID Session id
* @returns IItemEventRouterResponse
* @param output Client response
*/
editMapMarker(pmcData: IPmcData, request: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;
editMapMarker(pmcData: IPmcData, request: IInventoryEditMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/**
* Strip out characters from note string that are not: letter/numbers/unicode/spaces
* @param mapNoteText Marker text to sanitise
@ -202,9 +218,11 @@ export declare class InventoryController {
* 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
* @param body Open loot container request data
* @param sessionID Session id
* @returns IItemEventRouterResponse
* @param output Client response
*/
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string, output: IItemEventRouterResponse): void;
redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): void;
setFavoriteItem(pmcData: IPmcData, request: ISetFavoriteItems, sessionId: string): void;
}

View File

@ -1,20 +1,26 @@
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, 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";
import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { PreAkiModLoader } from "@spt-aki/loaders/PreAkiModLoader";
import { IChangeRequestData } from "@spt-aki/models/eft/launcher/IChangeRequestData";
import { ILoginRequestData } from "@spt-aki/models/eft/launcher/ILoginRequestData";
import { IRegisterData } from "@spt-aki/models/eft/launcher/IRegisterData";
import { Info, ModDetails } from "@spt-aki/models/eft/profile/IAkiProfile";
import { IConnectResponse } from "@spt-aki/models/eft/profile/IConnectResponse";
import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig";
import { IPackageJsonData } from "@spt-aki/models/spt/mod/IPackageJsonData";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class LauncherController {
protected logger: ILogger;
protected hashUtil: HashUtil;
protected timeUtil: TimeUtil;
protected randomUtil: RandomUtil;
protected saveServer: SaveServer;
protected httpServerHelper: HttpServerHelper;
protected profileHelper: ProfileHelper;
@ -23,17 +29,19 @@ export declare class LauncherController {
protected preAkiModLoader: PreAkiModLoader;
protected configServer: ConfigServer;
protected coreConfig: ICoreConfig;
constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer);
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer);
connect(): IConnectResponse;
/**
* Get descriptive text for each of the profile edtions a player can choose
* @returns
* Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type e.g. "Edge Of Darkness"
* @returns Dictionary of profile types with related descriptive text
*/
protected getProfileDescriptions(): Record<string, string>;
find(sessionIdKey: string): Info;
login(info: ILoginRequestData): string;
register(info: IRegisterData): string;
protected createAccount(info: IRegisterData): string;
protected generateProfileId(): string;
protected formatID(timeStamp: number, counter: number): string;
changeUsername(info: IChangeRequestData): string;
changePassword(info: IChangeRequestData): string;
wipe(info: IRegisterData): string;

View File

@ -1,22 +1,25 @@
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 { 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";
import { ApplicationContext } from "@spt-aki/context/ApplicationContext";
import { LocationGenerator } from "@spt-aki/generators/LocationGenerator";
import { LootGenerator } from "@spt-aki/generators/LootGenerator";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { ILocationBase } from "@spt-aki/models/eft/common/ILocationBase";
import { ILocationsGenerateAllResponse } from "@spt-aki/models/eft/common/ILocationsSourceDestinationBase";
import { IAirdropLootResult } from "@spt-aki/models/eft/location/IAirdropLootResult";
import { IGetLocationRequestData } from "@spt-aki/models/eft/location/IGetLocationRequestData";
import { AirdropTypeEnum } from "@spt-aki/models/enums/AirdropType";
import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig";
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
import { LootRequest } from "@spt-aki/models/spt/services/LootRequest";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class LocationController {
protected jsonUtil: JsonUtil;
protected hashUtil: HashUtil;
@ -25,13 +28,16 @@ export declare class LocationController {
protected logger: ILogger;
protected locationGenerator: LocationGenerator;
protected localisationService: LocalisationService;
protected raidTimeAdjustmentService: RaidTimeAdjustmentService;
protected itemFilterService: ItemFilterService;
protected lootGenerator: LootGenerator;
protected databaseServer: DatabaseServer;
protected timeUtil: TimeUtil;
protected configServer: ConfigServer;
protected applicationContext: ApplicationContext;
protected airdropConfig: IAirdropConfig;
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);
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext);
/**
* Handle client/location/getLocalloot
* Get a location (map) with generated loot data
@ -55,7 +61,7 @@ export declare class LocationController {
generateAll(sessionId: string): ILocationsGenerateAllResponse;
/**
* Handle client/location/getAirdropLoot
* Get loot for an airdop container
* Get loot for an airdrop container
* Generates it randomly based on config/airdrop.json values
* @returns Array of LootItem objects
*/

View File

@ -1,27 +1,35 @@
import { ApplicationContext } from "../context/ApplicationContext";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData";
import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData";
import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData";
import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData";
import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData";
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
import { 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";
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
import { BotLootCacheService } from "../services/BotLootCacheService";
import { MatchLocationService } from "../services/MatchLocationService";
import { ProfileSnapshotService } from "../services/ProfileSnapshotService";
import { ApplicationContext } from "@spt-aki/context/ApplicationContext";
import { LootGenerator } from "@spt-aki/generators/LootGenerator";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData";
import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData";
import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse";
import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData";
import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData";
import { IJoinMatchResult } from "@spt-aki/models/eft/match/IJoinMatchResult";
import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig";
import { IMatchConfig } from "@spt-aki/models/spt/config/IMatchConfig";
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { BotGenerationCacheService } from "@spt-aki/services/BotGenerationCacheService";
import { BotLootCacheService } from "@spt-aki/services/BotLootCacheService";
import { MailSendService } from "@spt-aki/services/MailSendService";
import { MatchLocationService } from "@spt-aki/services/MatchLocationService";
import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class MatchController {
protected logger: ILogger;
protected saveServer: SaveServer;
protected timeUtil: TimeUtil;
protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected profileHelper: ProfileHelper;
protected matchLocationService: MatchLocationService;
protected traderHelper: TraderHelper;
@ -29,22 +37,21 @@ export declare class MatchController {
protected configServer: ConfigServer;
protected profileSnapshotService: ProfileSnapshotService;
protected botGenerationCacheService: BotGenerationCacheService;
protected mailSendService: MailSendService;
protected lootGenerator: LootGenerator;
protected applicationContext: ApplicationContext;
protected matchConfig: IMatchConfig;
protected inraidConfig: IInRaidConfig;
protected inRaidConfig: IInRaidConfig;
protected traderConfig: ITraderConfig;
protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext);
constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, mailSendService: MailSendService, lootGenerator: LootGenerator, applicationContext: ApplicationContext);
getEnabled(): boolean;
/** 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;
/** Handle match/group/start_game */
joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult;
/** Handle client/match/group/status */
getGroupStatus(info: IGetGroupStatusRequestData): any;
getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse;
/**
* Handle /client/raid/configuration
* @param request Raid config request
@ -59,6 +66,19 @@ export declare class MatchController {
protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: string): string;
/** Handle client/match/offline/end */
endOfflineRaid(info: IEndOfflineRaidRequestData, sessionId: string): void;
/**
* Did player take a COOP extract
* @param extractName Name of extract player took
* @returns True if coop extract
*/
protected extractWasViaCoop(extractName: string): boolean;
protected sendCoopTakenFenceMessage(sessionId: string): void;
/**
* Handle when a player extracts using a coop extract - add rep to fence
* @param pmcData Profile
* @param extractName Name of extract taken
*/
protected handleCoopExtract(pmcData: IPmcData, extractName: string): void;
/**
* Was extract by car
* @param extractName name of extract
@ -73,10 +93,11 @@ export declare class MatchController {
*/
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
* Get the fence rep gain from using a car or coop extract
* @param pmcData Profile
* @param baseGain amount gained for the first extract
* @param extractCount Number of times extract was taken
* @returns Fence standing after taking extract
*/
protected updateFenceStandingInProfile(pmcData: IPmcData, fenceId: string, extractName: string): void;
protected getFenceStandingAfterExtract(pmcData: IPmcData, baseGain: number, extractCount: number): number;
}

View File

@ -1,7 +1,7 @@
import { IPmcData } from "../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { INoteActionData } from "../models/eft/notes/INoteActionData";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { INoteActionData } from "@spt-aki/models/eft/notes/INoteActionData";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
export declare class NoteController {
protected eventOutputHolder: EventOutputHolder;
constructor(eventOutputHolder: EventOutputHolder);

View File

@ -1,7 +1,7 @@
import { NotifierHelper } from "../helpers/NotifierHelper";
import { NotificationService } from "../services/NotificationService";
import { INotifierChannel } from "../models/eft/notifier/INotifier";
import { HttpServerHelper } from "../helpers/HttpServerHelper";
import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper";
import { NotifierHelper } from "@spt-aki/helpers/NotifierHelper";
import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier";
import { NotificationService } from "@spt-aki/services/NotificationService";
export declare class NotifierController {
protected notifierHelper: NotifierHelper;
protected httpServerHelper: HttpServerHelper;

View File

@ -2,35 +2,17 @@ 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 { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData";
import { IUserBuilds } from "../models/eft/profile/IAkiProfile";
import { ILogger } from "../models/spt/utils/ILogger";
import { WeaponBuild } from "../models/eft/profile/IAkiProfile";
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(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;
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;
}

View File

@ -1,8 +1,10 @@
import { PresetHelper } from "../helpers/PresetHelper";
import { DatabaseServer } from "../servers/DatabaseServer";
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
export declare class PresetController {
protected logger: ILogger;
protected presetHelper: PresetHelper;
protected databaseServer: DatabaseServer;
constructor(presetHelper: PresetHelper, databaseServer: DatabaseServer);
constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer);
initialize(): void;
}

View File

@ -1,28 +1,32 @@
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";
import { PlayerScavGenerator } from "@spt-aki/generators/PlayerScavGenerator";
import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IMiniProfile } from "@spt-aki/models/eft/launcher/IMiniProfile";
import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData";
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
import { IGetOtherProfileRequest } from "@spt-aki/models/eft/profile/IGetOtherProfileRequest";
import { IGetOtherProfileResponse } from "@spt-aki/models/eft/profile/IGetOtherProfileResponse";
import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData";
import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData";
import { IProfileCreateRequestData } from "@spt-aki/models/eft/profile/IProfileCreateRequestData";
import { ISearchFriendRequestData } from "@spt-aki/models/eft/profile/ISearchFriendRequestData";
import { ISearchFriendResponse } from "@spt-aki/models/eft/profile/ISearchFriendResponse";
import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { MailSendService } from "@spt-aki/services/MailSendService";
import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService";
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class ProfileController {
protected logger: ILogger;
protected hashUtil: HashUtil;
@ -32,6 +36,7 @@ export declare class ProfileController {
protected itemHelper: ItemHelper;
protected profileFixerService: ProfileFixerService;
protected localisationService: LocalisationService;
protected seasonalEventService: SeasonalEventService;
protected mailSendService: MailSendService;
protected playerScavGenerator: PlayerScavGenerator;
protected eventOutputHolder: EventOutputHolder;
@ -39,7 +44,7 @@ export declare class ProfileController {
protected dialogueHelper: DialogueHelper;
protected questHelper: QuestHelper;
protected 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);
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper);
/**
* Handle /launcher/profiles
*/
@ -54,8 +59,16 @@ export declare class ProfileController {
getCompleteProfile(sessionID: string): IPmcData[];
/**
* Handle client/game/profile/create
* @param info Client reqeust object
* @param sessionID Player id
* @returns Profiles _id value
*/
createProfile(info: IProfileCreateRequestData, sessionID: string): void;
createProfile(info: IProfileCreateRequestData, sessionID: string): string;
/**
* make profiles pmcData.Inventory.equipment unique
* @param pmcData Profile to update
*/
protected updateInventoryEquipmentId(pmcData: IPmcData): void;
/**
* Delete a profile
* @param sessionID Id of profile to delete
@ -98,4 +111,9 @@ export declare class ProfileController {
* Handle client/game/profile/search
*/
getFriends(info: ISearchFriendRequestData, sessionID: string): ISearchFriendResponse[];
/**
* Handle client/profile/status
*/
getProfileStatus(sessionId: string): GetProfileStatusResponseData;
getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse;
}

View File

@ -1,31 +1,32 @@
import { DialogueHelper } from "../helpers/DialogueHelper";
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 { 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";
import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData";
import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData";
import { IQuestConfig } from "../models/spt/config/IQuestConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { LocaleService } from "../services/LocaleService";
import { LocalisationService } from "../services/LocalisationService";
import { 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";
import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper";
import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { IQuest, IQuestCondition } from "@spt-aki/models/eft/common/tables/IQuest";
import { IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IAcceptQuestRequestData } from "@spt-aki/models/eft/quests/IAcceptQuestRequestData";
import { ICompleteQuestRequestData } from "@spt-aki/models/eft/quests/ICompleteQuestRequestData";
import { IFailQuestRequestData } from "@spt-aki/models/eft/quests/IFailQuestRequestData";
import { IHandoverQuestRequestData } from "@spt-aki/models/eft/quests/IHandoverQuestRequestData";
import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { LocaleService } from "@spt-aki/services/LocaleService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { MailSendService } from "@spt-aki/services/MailSendService";
import { PlayerService } from "@spt-aki/services/PlayerService";
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class QuestController {
protected logger: ILogger;
protected timeUtil: TimeUtil;
@ -68,12 +69,6 @@ export declare class QuestController {
* @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
@ -82,7 +77,7 @@ export declare class QuestController {
* @param pmcData Profile to update
* @param acceptedQuest Quest accepted
* @param sessionID Session id
* @returns client response
* @returns Client response
*/
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
/**
@ -113,6 +108,18 @@ export declare class QuestController {
* @returns ItemEvent client response
*/
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Return a list of quests that would fail when supplied quest is completed
* @param completedQuestId quest completed id
* @returns array of IQuest objects
*/
protected getQuestsFailedByCompletingQuest(completedQuestId: string, pmcProfile: IPmcData): IQuest[];
/**
* Remove a quest entirely from a profile
* @param sessionId Player id
* @param questIdToRemove Qid of quest to remove
*/
protected removeQuestFromScavProfile(sessionId: string, questIdToRemove: string): void;
/**
* Return quests that have different statuses
* @param preQuestStatusus Quests before
@ -127,7 +134,7 @@ export declare class QuestController {
* @param completedQuestId Completed quest id
* @param questRewards Rewards given to player
*/
protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Reward[]): void;
protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Item[]): void;
/**
* Look for newly available quests after completing a quest with a requirement to wait x minutes (time-locked) before being available and add data to profile
* @param pmcData Player profile to update
@ -135,12 +142,6 @@ export declare class QuestController {
* @param completedQuestId Quest just completed
*/
protected addTimeLockedQuestsToProfile(pmcData: IPmcData, quests: IQuest[], completedQuestId: string): void;
/**
* Returns a list of quests that should be failed when a quest is completed
* @param completedQuestId quest completed id
* @returns array of quests
*/
protected getQuestsFailedByCompletingQuest(completedQuestId: string): IQuest[];
/**
* Fail the provided quests
* Update quest in profile, otherwise add fresh quest object with failed status
@ -173,7 +174,7 @@ export declare class QuestController {
* @param output Response to send to user
* @returns IItemEventRouterResponse
*/
protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: Item, handoverRequirements: AvailableForConditions, output: IItemEventRouterResponse): IItemEventRouterResponse;
protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: Item, handoverRequirements: IQuestCondition, output: IItemEventRouterResponse): IItemEventRouterResponse;
/**
* Increment a backend counter stored value by an amount,
* Create counter if it does not exist
@ -182,5 +183,13 @@ export declare class QuestController {
* @param questId quest id counter is associated with
* @param counterValue value to increment the backend counter with
*/
protected updateProfileBackendCounterValue(pmcData: IPmcData, conditionId: string, questId: string, counterValue: number): void;
protected updateProfileTaskConditionCounterValue(pmcData: IPmcData, conditionId: string, questId: string, counterValue: number): void;
/**
* Handle /client/game/profile/items/moving - QuestFail
* @param pmcData Pmc profile
* @param request Fail qeust request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
failQuest(pmcData: IPmcData, request: IFailQuestRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
}

View File

@ -1,42 +1,44 @@
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
import { HandbookHelper } from "../helpers/HandbookHelper";
import { InventoryHelper } from "../helpers/InventoryHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { PaymentHelper } from "../helpers/PaymentHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { RagfairHelper } from "../helpers/RagfairHelper";
import { RagfairOfferHelper } from "../helpers/RagfairOfferHelper";
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
import { TraderHelper } from "../helpers/TraderHelper";
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 { IAddOfferRequestData, Requirement } from "../models/eft/ragfair/IAddOfferRequestData";
import { IExtendOfferRequestData } from "../models/eft/ragfair/IExtendOfferRequestData";
import { IGetItemPriceResult } from "../models/eft/ragfair/IGetItemPriceResult";
import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPriceRequestData";
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";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { RagfairServer } from "../servers/RagfairServer";
import { SaveServer } from "../servers/SaveServer";
import { LocalisationService } from "../services/LocalisationService";
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";
import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator";
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { RagfairHelper } from "@spt-aki/helpers/RagfairHelper";
import { RagfairOfferHelper } from "@spt-aki/helpers/RagfairOfferHelper";
import { RagfairSellHelper } from "@spt-aki/helpers/RagfairSellHelper";
import { RagfairSortHelper } from "@spt-aki/helpers/RagfairSortHelper";
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
import { IAddOfferRequestData, Requirement } from "@spt-aki/models/eft/ragfair/IAddOfferRequestData";
import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOfferRequestData";
import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult";
import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData";
import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult";
import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest";
import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData";
import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData";
import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { RagfairServer } from "@spt-aki/servers/RagfairServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { PaymentService } from "@spt-aki/services/PaymentService";
import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService";
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
import { RagfairRequiredItemsService } from "@spt-aki/services/RagfairRequiredItemsService";
import { RagfairTaxService } from "@spt-aki/services/RagfairTaxService";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
/**
* Handle RagfairCallback events
*/
@ -68,11 +70,26 @@ export declare class RagfairController {
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, 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);
/**
* Handles client/ragfair/find
* Returns flea offers that match required search parameters
* @param sessionID Player id
* @param searchRequest Search request data
* @returns IGetOffersResult
*/
getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult;
/**
* Handle client/ragfair/offer/findbyid
* Occurs when searching for `#x` on flea
* @param sessionId Player id
* @param request Request data
* @returns IRagfairOffer
*/
getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer;
/**
* Get offers for the client based on type of search being performed
* @param searchRequest Client search request data
* @param itemsToAdd comes from ragfairHelper.filterCategories()
* @param itemsToAdd Comes from ragfairHelper.filterCategories()
* @param traderAssorts Trader assorts
* @param pmcProfile Player profile
* @returns array of offers
@ -81,18 +98,10 @@ export declare class RagfairController {
/**
* Get categories for the type of search being performed, linked/required/all
* @param searchRequest Client search request data
* @param offers ragfair offers to get categories for
* @returns record with tpls + counts
* @param offers Ragfair offers to get categories for
* @returns record with templates + counts
*/
protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
/**
* Add Required offers to offers result
* @param searchRequest Client search request data
* @param assorts
* @param pmcProfile Player profile
* @param result Result object being sent back to client
*/
protected addRequiredOffersToResult(searchRequest: ISearchRequestData, assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData, result: IGetOffersResult): void;
protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
/**
* Add index to all offers passed in (0-indexed)
* @param offers Offers to add index value to
@ -100,17 +109,30 @@ export declare class RagfairController {
protected addIndexValueToOffers(offers: IRagfairOffer[]): void;
/**
* Update a trader flea offer with buy restrictions stored in the traders assort
* @param offer flea offer to update
* @param profile full profile of player
* @param offer Flea offer to update
* @param fullProfile Players full profile
*/
protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, profile: IAkiProfile): void;
protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, fullProfile: IAkiProfile): void;
/**
* Adjust ragfair offer stack count to match same value as traders assort stack count
* @param offer Flea offer to adjust
* @param offer Flea offer to adjust stack size of
*/
protected setTraderOfferStackSize(offer: IRagfairOffer): void;
/**
* Is the flea search being performed a 'linked' search type
* @param info Search request
* @returns True if it is a 'linked' search type
*/
protected isLinkedSearch(info: ISearchRequestData): boolean;
/**
* Is the flea search being performed a 'required' search type
* @param info Search request
* @returns True if it is a 'required' search type
*/
protected isRequiredSearch(info: ISearchRequestData): boolean;
/**
* Check all profiles and sell player offers / send player money for listing if it sold
*/
update(): void;
/**
* Called when creating an offer on flea, fills values in top right corner
@ -152,25 +174,33 @@ export declare class RagfairController {
*/
protected calculateRequirementsPriceInRub(requirements: Requirement[]): number;
/**
* Using item ids from flea offer request, find corrispnding items from player inventory and return as array
* Using item ids from flea offer request, find corresponding items from player inventory and return as array
* @param pmcData Player profile
* @param itemIdsFromFleaOfferRequest Ids from request
* @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;
protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): {
items: Item[] | null;
errorMessage: string | null;
};
createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): 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
* @param removeRequest Remove offer request
* @param sessionId Players id
* @returns IItemEventRouterResponse
*/
removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse;
extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
removeOffer(removeRequest: IRemoveOfferRequestData, sessionId: string): IItemEventRouterResponse;
/**
* Extend a ragfair offers listing time
* @param extendRequest Extend offer request
* @param sessionId Players id
* @returns IItemEventRouterResponse
*/
extendOffer(extendRequest: IExtendOfferRequestData, sessionId: string): IItemEventRouterResponse;
/**
* Create a basic trader request object with price and currency type
* @param currency What currency: RUB, EURO, USD

View File

@ -1,16 +1,17 @@
import { QuestHelper } from "../helpers/QuestHelper";
import { RepairHelper } from "../helpers/RepairHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionDataRequest";
import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest";
import { IRepairConfig } from "../models/spt/config/IRepairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { DatabaseServer } from "../servers/DatabaseServer";
import { PaymentService } from "../services/PaymentService";
import { RepairService } from "../services/RepairService";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
import { RepairHelper } from "@spt-aki/helpers/RepairHelper";
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IRepairActionDataRequest } from "@spt-aki/models/eft/repair/IRepairActionDataRequest";
import { ITraderRepairActionDataRequest } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest";
import { IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { PaymentService } from "@spt-aki/services/PaymentService";
import { RepairService } from "@spt-aki/services/RepairService";
export declare class RepairController {
protected logger: ILogger;
protected eventOutputHolder: EventOutputHolder;
@ -20,8 +21,9 @@ export declare class RepairController {
protected paymentService: PaymentService;
protected repairHelper: RepairHelper;
protected repairService: RepairService;
protected profileHelper: ProfileHelper;
protected repairConfig: IRepairConfig;
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService);
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper);
/**
* Handle TraderRepair event
* Repair with trader

View File

@ -1,81 +1,44 @@
import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { PresetHelper } from "../helpers/PresetHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { Exit } from "../models/eft/common/ILocationBase";
import { IPmcData } from "../models/eft/common/IPmcData";
import { TraderInfo } from "../models/eft/common/tables/IBotBase";
import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPmcDataRepeatableQuest, IRepeatableQuest, IReward, IRewards } from "../models/eft/common/tables/IRepeatableQuests";
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 { 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";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { PaymentService } from "../services/PaymentService";
import { ProfileFixerService } from "../services/ProfileFixerService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil";
import { ObjectId } from "../utils/ObjectId";
import { ProbabilityObject, ProbabilityObjectArray, RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
export interface IQuestTypePool {
types: string[];
pool: IQuestPool;
}
export interface IQuestPool {
Exploration: IExplorationPool;
Elimination: IEliminationPool;
}
export interface IExplorationPool {
locations: Partial<Record<ELocationName, string[]>>;
}
export interface IEliminationPool {
targets: IEliminationTargetPool;
}
export interface IEliminationTargetPool {
Savage?: ITargetLocation;
AnyPmc?: ITargetLocation;
bossBully?: ITargetLocation;
bossGluhar?: ITargetLocation;
bossKilla?: ITargetLocation;
bossSanitar?: ITargetLocation;
bossTagilla?: ITargetLocation;
bossKojaniy?: ITargetLocation;
}
export interface ITargetLocation {
locations: string[];
}
import { RepeatableQuestGenerator } from "@spt-aki/generators/RepeatableQuestGenerator";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
import { RepeatableQuestHelper } from "@spt-aki/helpers/RepeatableQuestHelper";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IRepeatableQuestChangeRequest } from "@spt-aki/models/eft/quests/IRepeatableQuestChangeRequest";
import { ELocationName } from "@spt-aki/models/enums/ELocationName";
import { IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { PaymentService } from "@spt-aki/services/PaymentService";
import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { ObjectId } from "@spt-aki/utils/ObjectId";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class RepeatableQuestController {
protected timeUtil: TimeUtil;
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected timeUtil: TimeUtil;
protected randomUtil: RandomUtil;
protected httpResponse: HttpResponseUtil;
protected mathUtil: MathUtil;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper;
protected presetHelper: PresetHelper;
protected profileHelper: ProfileHelper;
protected profileFixerService: ProfileFixerService;
protected handbookHelper: HandbookHelper;
protected ragfairServerHelper: RagfairServerHelper;
protected eventOutputHolder: EventOutputHolder;
protected localisationService: LocalisationService;
protected paymentService: PaymentService;
protected objectId: ObjectId;
protected itemFilterService: ItemFilterService;
protected repeatableQuestGenerator: RepeatableQuestGenerator;
protected repeatableQuestHelper: RepeatableQuestHelper;
protected questHelper: QuestHelper;
protected configServer: ConfigServer;
protected questConfig: IQuestConfig;
constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, handbookHelper: HandbookHelper, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer);
constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer);
/**
* Handle client/repeatalbeQuests/activityPeriods
* Returns an array of objects in the format of repeatable quests to the client.
@ -97,11 +60,19 @@ export declare class RepeatableQuestController {
* (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards)
* The new quests generated are again persisted in profile.RepeatableQuests
*
* @param {string} _info Request from client
* @param {string} sessionID Player's session id
*
* @param {string} sessionId Player's session id
* @returns {array} array of "repeatableQuestObjects" as descibed above
* @returns {array} Array of "repeatableQuestObjects" as descibed above
*/
getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[];
/**
* Get the number of quests to generate - takes into account charisma state of player
* @param repeatableConfig Config
* @param pmcData Player profile
* @returns Quest count
*/
protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number;
/**
* Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists
* @param repeatableConfig daily/weekly config
@ -109,103 +80,10 @@ export declare class RepeatableQuestController {
* @returns IPmcDataRepeatableQuest
*/
protected getRepeatableQuestSubTypeFromProfile(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): IPmcDataRepeatableQuest;
/**
* This method is called by GetClientRepeatableQuests and creates one element of quest type format (see assets/database/templates/repeatableQuests.json).
* It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest
*/
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
*/
generateDebugDailies(dailiesPool: any, factory: any, number: number): any;
/**
* Generates the base object of quest type format given as templates in assets/database/templates/repeatableQuests.json
* The templates include Elimination, Completion and Extraction quest types
*
* @param {string} type quest type: "Elimination", "Completion" or "Extraction"
* @param {string} traderId trader from which the quest will be provided
* @param {string} side scav daily or pmc daily/weekly quest
* @returns {object} a object which contains the base elements for repeatable quests of the requests type
* (needs to be filled with reward and conditions by called to make a valid quest)
*/
protected generateRepeatableTemplate(type: string, traderId: string, side: string): IRepeatableQuest;
/**
* Generates a valid Exploration quest
*
* @param {integer} pmcLevel player's level for reward generation
* @param {string} traderId trader from which the quest will be provided
* @param {object} questTypePool Pools for quests (used to avoid redundant quests)
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
* @returns {object} object of quest type format for "Exploration" (see assets/database/templates/repeatableQuests.json)
*/
protected generateExplorationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IExploration;
/**
* Generates a valid Completion quest
*
* @param {integer} pmcLevel player's level for requested items and reward generation
* @param {string} traderId trader from which the quest will be provided
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
* @returns {object} object of quest type format for "Completion" (see assets/database/templates/repeatableQuests.json)
*/
protected generateCompletionQuest(pmcLevel: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): ICompletion;
/**
* Generates a valid Elimination quest
*
* @param {integer} pmcLevel player's level for requested items and reward generation
* @param {string} traderId trader from which the quest will be provided
* @param {object} questTypePool Pools for quests (used to avoid redundant quests)
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
* @returns {object} object of quest type format for "Elimination" (see assets/database/templates/repeatableQuests.json)
*/
protected generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination;
/**
* 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
*/
protected getQuestLocationByMapId(locationKey: string): string;
/**
* Exploration repeatable quests can specify a required extraction point.
* This method creates the according object which will be appended to the conditions array
*
* @param {string} exit The exit name to generate the condition for
* @returns {object} Exit condition
*/
protected generateExplorationExitCondition(exit: Exit): IExplorationCondition;
/**
* A repeatable quest, besides some more or less static components, exists of reward and condition (see assets/database/templates/repeatableQuests.json)
* This is a helper method for GenerateCompletionQuest to create a completion condition (of which a completion quest theoretically can have many)
*
* @param {string} targetItemId id of the item to request
* @param {integer} value amount of items of this specific type to request
* @returns {object} object of "Completion"-condition
*/
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.
*
* @param {string} location the location on which to fulfill the elimination quest
* @returns {object} object of "Elimination"-location-subcondition
*/
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.
*
* @param {string} target array of target npcs e.g. "AnyPmc", "Savage"
* @param {array} bodyParts array of body parts with which to kill e.g. ["stomach", "thorax"]
* @param {number} distance distance from which to kill (currently only >= supported)
* @returns {object} object of "Elimination"-kill-subcondition
*/
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
@ -215,53 +93,25 @@ export declare class RepeatableQuestController {
* @returns IQuestTypePool
*/
protected generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool;
protected createBaseQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool;
/**
* Generate the reward for a mission. A reward can consist of
* - Experience
* - Money
* - Items
* - Trader Reputation
*
* The reward is dependent on the player level as given by the wiki. The exact mapping of pmcLevel to
* experience / money / items / trader reputation can be defined in QuestConfig.js
*
* There's also a random variation of the reward the spread of which can be also defined in the config.
*
* Additonaly, a scaling factor w.r.t. quest difficulty going from 0.2...1 can be used
*
* @param {integer} pmcLevel player's level
* @param {number} difficulty a reward scaling factor goint from 0.2 to 1
* @param {string} traderId the trader for reputation gain (and possible in the future filtering of reward item type based on trader)
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
* @returns {object} object of "Reward"-type that can be given for a repeatable mission
* Return the locations this PMC is allowed to get daily quests for based on their level
* @param locations The original list of locations
* @param pmcLevel The level of the player PMC
* @returns A filtered list of locations that allow the player PMC level to access it
*/
protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards;
protected getAllowedLocations(locations: Record<ELocationName, string[]>, pmcLevel: number): Partial<Record<ELocationName, string[]>>;
/**
* Helper to create a reward item structured as required by the client
*
* @param {string} tpl itemId of the rewarded item
* @param {integer} value amount of items to give
* @param {integer} index all rewards will be appended to a list, for unkown reasons the client wants the index
* @returns {object} object of "Reward"-item-type
* Return true if the given pmcLevel is allowed on the given location
* @param location The location name to check
* @param pmcLevel The level of the pmc
* @returns True if the given pmc level is allowed to access the given location
*/
protected generateRewardItem(tpl: string, value: number, index: number, preset?: any): IReward;
protected isPmcLevelAllowedOnLocation(location: string, pmcLevel: number): boolean;
debugLogRepeatableQuestIds(pmcData: IPmcData): void;
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)
* @param repeatableQuestConfig config file
* @returns a list of rewardable items [[_tpl, itemTemplate],...]
*/
protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [string, ITemplateItem][];
/**
* Checks if an id is a valid item. Valid meaning that it's an item that may be a reward
* or content of bot loot. Items that are tested as valid may be in a player backpack or stash.
* @param {string} tpl template id of item to check
* @returns boolean: true if item is valid reward
*/
protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean;
changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
}

View File

@ -1,29 +1,39 @@
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 { 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 {
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { TradeHelper } from "@spt-aki/helpers/TradeHelper";
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ITraderBase } from "@spt-aki/models/eft/common/tables/ITrader";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
import { IProcessBaseTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBaseTradeRequestData";
import { IOfferRequest, IProcessRagfairTradeRequestData } from "@spt-aki/models/eft/trade/IProcessRagfairTradeRequestData";
import { ISellScavItemsToFenceRequestData } from "@spt-aki/models/eft/trade/ISellScavItemsToFenceRequestData";
import { Traders } from "@spt-aki/models/enums/Traders";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { RagfairServer } from "@spt-aki/servers/RagfairServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { MailSendService } from "@spt-aki/services/MailSendService";
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class TradeController {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected eventOutputHolder: EventOutputHolder;
protected tradeHelper: TradeHelper;
protected timeUtil: TimeUtil;
protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected itemHelper: ItemHelper;
protected profileHelper: ProfileHelper;
protected traderHelper: TraderHelper;
@ -32,26 +42,51 @@ declare class TradeController {
protected httpResponse: HttpResponseUtil;
protected localisationService: LocalisationService;
protected ragfairPriceService: RagfairPriceService;
protected mailSendService: MailSendService;
protected configServer: ConfigServer;
protected roubleTpl: string;
protected ragfairConfig: IRagfairConfig;
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);
constructor(logger: ILogger, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer);
/** 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;
confirmRagfairTrading(pmcData: IPmcData, request: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Sell all sellable items to a trader from inventory
* WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD
* Buy an item off the flea sold by a trader
* @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
* @param pmcData Player profile
* @param fleaOffer Offer being purchased
* @param requestOffer request data from client
* @param output Output to send back to client
*/
protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse;
protected buyTraderItemFromRagfair(sessionId: string, pmcData: IPmcData, fleaOffer: IRagfairOffer, requestOffer: IOfferRequest, output: IItemEventRouterResponse): void;
/**
* Buy an item off the flea sold by a PMC
* @param sessionId Session id
* @param pmcData Player profile
* @param fleaOffer Offer being purchased
* @param requestOffer Request data from client
* @param output Output to send back to client
*/
protected buyPmcItemFromRagfair(sessionId: string, pmcData: IPmcData, fleaOffer: IRagfairOffer, requestOffer: IOfferRequest, output: IItemEventRouterResponse): void;
/**
* Does Player have necessary trader loyalty to purchase flea offer
* @param sellerIsTrader is seller trader
* @param fleaOffer FLea offer being bought
* @param pmcData Player profile
* @returns True if player can buy offer
*/
protected playerLacksTraderLoyaltyLevelToBuyOffer(fleaOffer: IRagfairOffer, pmcData: IPmcData): boolean;
/** Handle SellAllFromSavage event */
sellScavItemsToFence(pmcData: IPmcData, request: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse;
/**
* Send the specified rouble total to player as mail
* @param sessionId Session id
* @param trader Trader to sell items to
* @param output IItemEventRouterResponse
*/
protected mailMoneyToPlayer(sessionId: string, roublesToSend: number, trader: Traders): void;
/**
* Looks up an items children and gets total handbook price for them
* @param parentItemId parent item that has children we want to sum price of
@ -61,6 +96,4 @@ declare class TradeController {
* @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 };

View File

@ -1,16 +1,20 @@
import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { TraderAssortHelper } from "../helpers/TraderAssortHelper";
import { TraderHelper } from "../helpers/TraderHelper";
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 { FenceBaseAssortGenerator } from "@spt-aki/generators/FenceBaseAssortGenerator";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper";
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
import { ITraderAssort, ITraderBase } from "@spt-aki/models/eft/common/tables/ITrader";
import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { FenceService } from "@spt-aki/services/FenceService";
import { TraderAssortService } from "@spt-aki/services/TraderAssortService";
import { TraderPurchasePersisterService } from "@spt-aki/services/TraderPurchasePersisterService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class TraderController {
protected logger: ILogger;
protected timeUtil: TimeUtil;
protected databaseServer: DatabaseServer;
protected traderAssortHelper: TraderAssortHelper;
protected profileHelper: ProfileHelper;
@ -20,10 +24,12 @@ export declare class TraderController {
protected fenceService: FenceService;
protected fenceBaseAssortGenerator: FenceBaseAssortGenerator;
protected jsonUtil: JsonUtil;
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil);
protected configServer: ConfigServer;
protected traderConfig: ITraderConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil, configServer: ConfigServer);
/**
* Runs when onLoad event is fired
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
* Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService
* Store timestamp of next assort refresh in nextResupply property of traders .base object
*/
load(): void;

View File

@ -1,8 +1,8 @@
import { WeatherGenerator } from "../generators/WeatherGenerator";
import { IWeatherData } from "../models/eft/weather/IWeatherData";
import { IWeatherConfig } from "../models/spt/config/IWeatherConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { WeatherGenerator } from "@spt-aki/generators/WeatherGenerator";
import { IWeatherData } from "@spt-aki/models/eft/weather/IWeatherData";
import { IWeatherConfig } from "@spt-aki/models/spt/config/IWeatherConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
export declare class WeatherController {
protected weatherGenerator: WeatherGenerator;
protected logger: ILogger;

View File

@ -1,7 +1,7 @@
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IWishlistActionData } from "@spt-aki/models/eft/wishlist/IWishlistActionData";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
export declare class WishlistController {
protected eventOutputHolder: EventOutputHolder;
constructor(eventOutputHolder: EventOutputHolder);

10
types/di/Router.d.ts vendored
View File

@ -1,6 +1,6 @@
import { IPmcData } from "../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
export declare class Router {
protected handledRoutes: HandledRoute[];
getTopLevelRoute(): string;
@ -21,11 +21,9 @@ export declare class DynamicRouter extends Router {
getHandledRoutes(): HandledRoute[];
}
export declare class ItemEventRouterDefinition extends Router {
constructor();
handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse;
handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string, output: IItemEventRouterResponse): void;
}
export declare class SaveLoadRouter extends Router {
constructor();
handleLoad(profile: IAkiProfile): IAkiProfile;
}
export declare class HandledRoute {

View File

@ -1,5 +1,5 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "http";
import { IncomingMessage, ServerResponse } from "node:http";
export declare class Serializer {
serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void;
canHandle(something: string): boolean;

View File

@ -1,24 +1,31 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotHelper } from "../helpers/BotHelper";
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { ProbabilityHelper } from "../helpers/ProbabilityHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem";
import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
import { ItemFilterService } from "../services/ItemFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper";
import { BotHelper } from "@spt-aki/helpers/BotHelper";
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
import { ProbabilityHelper } from "@spt-aki/helpers/ProbabilityHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { IPreset } from "@spt-aki/models/eft/common/IGlobals";
import { Mods, ModsChances } from "@spt-aki/models/eft/common/tables/IBotType";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ITemplateItem, Slot } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt-aki/models/enums/ModSpawn";
import { IChooseRandomCompatibleModResult } from "@spt-aki/models/spt/bots/IChooseRandomCompatibleModResult";
import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { BotEquipmentFilterService } from "@spt-aki/services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "@spt-aki/services/BotEquipmentModPoolService";
import { BotModLimits, BotWeaponModLimitService } from "@spt-aki/services/BotWeaponModLimitService";
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { IGenerateEquipmentProperties } from "./BotInventoryGenerator";
import { IFilterPlateModsForSlotByLevelResult } from "./IFilterPlateModsForSlotByLevelResult";
export declare class BotEquipmentModGenerator {
protected logger: ILogger;
protected jsonUtil: JsonUtil;
@ -34,45 +41,54 @@ export declare class BotEquipmentModGenerator {
protected botHelper: BotHelper;
protected botGeneratorHelper: BotGeneratorHelper;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected weightedRandomHelper: WeightedRandomHelper;
protected presetHelper: PresetHelper;
protected localisationService: LocalisationService;
protected botEquipmentModPoolService: BotEquipmentModPoolService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer);
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, presetHelper: PresetHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer);
/**
* Check mods are compatible and add to array
* @param equipment Equipment item to add mods to
* @param modPool Mod list to choose frm
* @param parentId parentid of item to add mod to
* @param parentTemplate template objet of item to add mods to
* @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type
* @param botRole the bot role being generated for
* @param forceSpawn should this mod be forced to spawn
* @returns Item + compatible mods as an array
*/
generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, botRole: string, forceSpawn?: boolean): Item[];
generateModsForEquipment(equipment: Item[], parentId: string, parentTemplate: ITemplateItem, settings: IGenerateEquipmentProperties, shouldForceSpawn?: boolean): Item[];
/**
* Filter a bots plate pool based on its current level
* @param settings Bot equipment generation settings
* @param modSlot Armor slot being filtered
* @param existingPlateTplPool Plates tpls to choose from
* @param armorItem
* @returns Array of plate tpls to choose from
*/
protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult;
/**
* Add mods to a weapon using the provided mod pool
* @param sessionId session id
* @param weapon Weapon to add mods to
* @param modPool Pool of compatible mods to attach to weapon
* @param weaponParentId parentId of weapon
* @param weaponId parentId of weapon
* @param parentTemplate Weapon which mods will be generated on
* @param modSpawnChances Mod spawn chances
* @param ammoTpl Ammo tpl to use when generating magazines/cartridges
* @param botRole Role of bot weapon is generated for
* @param botLevel lvel of the bot weapon is being generated for
* @param modLimits limits placed on certian mod types per gun
* @param botLevel Level of the bot weapon is being generated for
* @param modLimits limits placed on certain mod types per gun
* @param botEquipmentRole role of bot when accessing bot.json equipment config settings
* @returns Weapon + mods array
*/
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[];
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[];
/**
* Is this modslot a front or rear sight
* @param modSlot Slot to check
* @returns true if it's a front/rear sight
*/
protected modIsFrontOrRearSight(modSlot: string): boolean;
protected modIsFrontOrRearSight(modSlot: string, tpl: string): boolean;
/**
* Does the provided mod details show the mod can hold a scope
* @param modSlot e.g. mod_scope, mod_mount
@ -93,18 +109,17 @@ export declare class BotEquipmentModGenerator {
* @param parentTemplate item template
* @returns Slot item
*/
protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot;
protected getModItemSlotFromDb(modSlot: string, parentTemplate: ITemplateItem): Slot;
/**
* Randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
* never return true for an item that has 0% spawn chance
* @param itemSlot slot the item sits in
* @param modSlot slot the mod sits in
* @param modSpawnChances Chances for various mod spawns
* @returns boolean true if it should spawn
* @param botEquipConfig Various config settings for generating this type of bot
* @returns ModSpawn.SPAWN when mod should be spawned, ModSpawn.DEFAULT_MOD when default mod should spawn, ModSpawn.SKIP when mod is skipped
*/
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean;
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
/**
*
* @param modSlot Slot mod will fit into
* @param isRandomisableSlot Will generate a randomised mod pool if true
* @param modsParent Parent slot the item will be a part of
@ -113,16 +128,46 @@ export declare class BotEquipmentModGenerator {
* @param weapon array with only weapon tpl in it, ready for mods to be added
* @param ammoTpl ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine)
* @param parentTemplate Parent item the mod will go into
* @returns ITemplateItem
* @returns itemHelper.getItem() result
*/
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record<string, string[]>, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem];
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record<string, string[]>, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem, modSpawnResult: ModSpawn): [boolean, ITemplateItem];
protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult;
/**
* Filter mod pool down based on various criteria:
* Is slot flagged as randomisable
* Is slot required
* Is slot flagged as default mod only
* @param itemModPool Existing pool of mods to choose
* @param modSpawnResult outcome of random roll to select if mod should be added
* @param parentTemplate Mods parent
* @param weaponTemplate Mods root parent (weapon/equipment)
* @param modSlot name of mod slot to choose for
* @param botEquipBlacklist
* @param isRandomisableSlot is flagged as a randomisable slot
* @returns
*/
protected getModPoolForSlot(itemModPool: Record<string, string[]>, modSpawnResult: ModSpawn, parentTemplate: ITemplateItem, weaponTemplate: ITemplateItem, modSlot: string, botEquipBlacklist: EquipmentFilterDetails, isRandomisableSlot: boolean): string[];
/**
* Get default preset for weapon, get specific weapon presets for edge cases (mp5/silenced dvl)
* @param weaponTemplate
* @param parentItemTpl
* @returns
*/
protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset;
/**
* Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible
* @param weapon Weapon
* @param modTpl Mod to check compatibility with weapon
* @returns True if incompatible
*/
protected weaponModComboIsIncompatible(weapon: Item[], modTpl: string): boolean;
/**
* Create a mod item with parameters as properties
* @param modId _id
* @param modTpl _tpl
* @param parentId parentId
* @param modSlot slotId
* @param modTemplate Used to add additional properites in the upd object
* @param modTemplate Used to add additional properties in the upd object
* @returns Item object
*/
protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item;
@ -135,21 +180,22 @@ export declare class BotEquipmentModGenerator {
/**
* Get a random mod from an items compatible mods Filter array
* @param modTpl ???? default value to return if nothing found
* @param parentSlot item mod will go into, used to get combatible items
* @param parentSlot item mod will go into, used to get compatible items
* @param modSlot Slot to get mod to fill
* @param items items to ensure picked mod is compatible with
* @returns item tpl
*/
protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
/**
* Log errors if mod is not compatible with slot
* @param modToAdd template of mod to check
* @param itemSlot slot the item will be placed in
* @param slotAddedToTemplate slot the item will be placed in
* @param modSlot slot the mod will fill
* @param parentTemplate template of the mods parent item
* @param parentTemplate template of the mods being added
* @param botRole
* @returns true if valid
*/
protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean;
protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean;
/**
* Find mod tpls of a provided type and add to modPool
* @param desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope)
@ -179,15 +225,15 @@ export declare class BotEquipmentModGenerator {
* Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
* This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
* @param items The items where the CylinderMagazine's camora are appended to
* @param modPool modPool which should include available cartrigdes
* @param modPool modPool which should include available cartridges
* @param parentId The CylinderMagazine's UID
* @param parentTemplate The CylinderMagazine's template
*/
protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
/**
* Take a record of camoras and merge the compatable shells into one array
* Take a record of camoras and merge the compatible shells into one array
* @param camorasWithShells camoras we want to merge into one array
* @returns string array of shells fro luitple camora sources
* @returns string array of shells for multiple camora sources
*/
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
/**

View File

@ -1,24 +1,24 @@
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
import { BotHelper } from "../helpers/BotHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
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";
import { BotInventoryGenerator } from "@spt-aki/generators/BotInventoryGenerator";
import { BotLevelGenerator } from "@spt-aki/generators/BotLevelGenerator";
import { BotDifficultyHelper } from "@spt-aki/helpers/BotDifficultyHelper";
import { BotHelper } from "@spt-aki/helpers/BotHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt-aki/models/eft/common/tables/IBotBase";
import { Appearance, Health, IBotType } from "@spt-aki/models/eft/common/tables/IBotType";
import { BotGenerationDetails } from "@spt-aki/models/spt/bots/BotGenerationDetails";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { BotEquipmentFilterService } from "@spt-aki/services/BotEquipmentFilterService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class BotGenerator {
protected logger: ILogger;
protected hashUtil: HashUtil;
@ -48,12 +48,12 @@ export declare class BotGenerator {
*/
generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase;
/**
* Create x number of bots of the type/side/difficulty defined in botGenerationDetails
* Create 1 bots of the type/side/difficulty defined in botGenerationDetails
* @param sessionId Session id
* @param botGenerationDetails details on how to generate bots
* @returns array of bots
* @returns constructed bot
*/
prepareAndGenerateBots(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[];
prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase;
/**
* Get a clone of the database\bots\base.json file
* @returns IBotBase object
@ -78,11 +78,11 @@ export declare class BotGenerator {
/**
* Create a bot nickname
* @param botJsonTemplate x.json from database
* @param isPlayerScav Will bot be player scav
* @param botGenerationDetails
* @param botRole role of bot e.g. assault
* @returns Nickname for bot
*/
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string;
protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, 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
@ -113,8 +113,8 @@ export declare class BotGenerator {
* @param bot bot to update
* @returns updated IBotBase object
*/
protected generateId(bot: IBotBase): IBotBase;
protected generateInventoryID(profile: IBotBase): IBotBase;
protected generateId(bot: IBotBase): void;
protected generateInventoryID(profile: IBotBase): void;
/**
* Randomise a bots game version and account category
* Chooses from all the game versions (standard, eod etc)
@ -127,5 +127,5 @@ export declare class BotGenerator {
* @param bot bot to add dogtag to
* @returns Bot with dogtag added
*/
protected generateDogtag(bot: IBotBase): IBotBase;
protected addDogtagToBot(bot: IBotBase): void;
}

View File

@ -1,21 +1,21 @@
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";
import { EquipmentSlots } from "../models/enums/EquipmentSlots";
import { EquipmentFilterDetails, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
import { BotLootGenerator } from "./BotLootGenerator";
import { BotWeaponGenerator } from "./BotWeaponGenerator";
import { BotEquipmentModGenerator } from "@spt-aki/generators/BotEquipmentModGenerator";
import { BotLootGenerator } from "@spt-aki/generators/BotLootGenerator";
import { BotWeaponGenerator } from "@spt-aki/generators/BotWeaponGenerator";
import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper";
import { BotHelper } from "@spt-aki/helpers/BotHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "@spt-aki/models/eft/common/tables/IBotBase";
import { Chances, Generation, IBotType, Inventory, Mods } from "@spt-aki/models/eft/common/tables/IBotType";
import { EquipmentSlots } from "@spt-aki/models/enums/EquipmentSlots";
import { EquipmentFilterDetails, EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt-aki/models/spt/config/IBotConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { BotEquipmentModPoolService } from "@spt-aki/services/BotEquipmentModPoolService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
export declare class BotInventoryGenerator {
protected logger: ILogger;
protected hashUtil: HashUtil;
@ -51,26 +51,31 @@ export declare class BotInventoryGenerator {
/**
* Add equipment to a bot
* @param templateInventory bot/x.json data from db
* @param equipmentChances Chances items will be added to bot
* @param wornItemChances Chances items will be added to bot
* @param botRole Role bot has (assault/pmcBot)
* @param botInventory Inventory to add equipment to
* @param botLevel Level of bot
*/
protected generateAndAddEquipmentToBot(templateInventory: Inventory, equipmentChances: Chances, botRole: string, botInventory: PmcInventory, botLevel: number): void;
protected generateAndAddEquipmentToBot(templateInventory: Inventory, wornItemChances: Chances, botRole: string, botInventory: PmcInventory, botLevel: number): void;
/**
* Remove non-armored rigs from parameter data
* @param templateInventory
*/
protected filterRigsToThoseWithProtection(templateInventory: Inventory): void;
/**
* Remove armored rigs from parameter data
* @param templateInventory
*/
protected filterRigsToThoseWithoutProtection(templateInventory: Inventory): void;
/**
* Add a piece of equipment with mods to inventory from the provided pools
* @param equipmentSlot Slot to select an item for
* @param equipmentPool Possible items to choose from
* @param modPool Possible mods to apply to item chosen
* @param spawnChances Chances items will be chosen to be added
* @param botRole Role of bot e.g. assault
* @param inventory Inventory to add item into
* @param randomisationDetails settings from bot.json to adjust how item is generated
* @param settings Values to adjust how item is chosen and added to bot
* @returns true when item added
*/
protected generateEquipment(equipmentSlot: string, equipmentPool: Record<string, number>, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory, randomisationDetails: RandomisationDetails): void;
protected generateEquipment(settings: IGenerateEquipmentProperties): boolean;
/**
* Get all possible mods for item and filter down based on equipment blacklist from bot.json config
* @param itemTpl Item mod pool is being retreived and filtered
* @param itemTpl Item mod pool is being retrieved and filtered
* @param equipmentBlacklist blacklist to filter mod pool with
* @returns Filtered pool of mods
*/
@ -112,3 +117,20 @@ export declare class BotInventoryGenerator {
shouldSpawn: boolean;
}, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void;
}
export interface IGenerateEquipmentProperties {
/** Root Slot being generated */
rootEquipmentSlot: string;
/** Equipment pool for root slot being generated */
rootEquipmentPool: Record<string, number>;
modPool: Mods;
/** Dictionary of mod items and their chance to spawn for this bot type */
spawnChances: Chances;
/** Role being generated for */
botRole: string;
/** Level of bot being generated */
botLevel: number;
inventory: PmcInventory;
botEquipmentConfig: EquipmentFilters;
/** Settings from bot.json to adjust how item is generated */
randomisationDetails: RandomisationDetails;
}

View File

@ -1,11 +1,11 @@
import { MinMax } from "../models/common/MinMax";
import { IRandomisedBotLevelResult } from "../models/eft/bot/IRandomisedBotLevelResult";
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";
import { DatabaseServer } from "../servers/DatabaseServer";
import { RandomUtil } from "../utils/RandomUtil";
import { MinMax } from "@spt-aki/models/common/MinMax";
import { IRandomisedBotLevelResult } from "@spt-aki/models/eft/bot/IRandomisedBotLevelResult";
import { IExpTable } from "@spt-aki/models/eft/common/IGlobals";
import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase";
import { BotGenerationDetails } from "@spt-aki/models/spt/bots/BotGenerationDetails";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
export declare class BotLevelGenerator {
protected logger: ILogger;
protected randomUtil: RandomUtil;
@ -20,10 +20,17 @@ export declare class BotLevelGenerator {
*/
generateBotLevel(levelDetails: MinMax, botGenerationDetails: BotGenerationDetails, bot: IBotBase): IRandomisedBotLevelResult;
/**
* Get the highest level a bot can be relative to the players level, but no futher than the max size from globals.exp_table
* Get the highest level a bot can be relative to the players level, but no further than the max size from globals.exp_table
* @param playerLevel Players current level
* @param relativeDeltaMax max delta above player level to go
* @returns highest level possible for bot
*/
protected getHighestRelativeBotLevel(playerLevel: number, relativeDeltaMax: number, levelDetails: MinMax, expTable: IExpTable[]): number;
/**
* Get the lowest level a bot can be relative to the players level, but no lower than 1
* @param playerLevel Players current level
* @param relativeDeltaMin Min delta below player level to go
* @returns lowest level possible for bot
*/
protected getLowestRelativeBotLevel(playerLevel: number, relativeDeltaMin: number, levelDetails: MinMax, expTable: IExpTable[]): number;
}

View File

@ -1,40 +1,46 @@
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 { IBotType, 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 { 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";
import { BotLootCacheService } from "../services/BotLootCacheService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { BotWeaponGenerator } from "./BotWeaponGenerator";
import { BotWeaponGenerator } from "@spt-aki/generators/BotWeaponGenerator";
import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper";
import { BotHelper } from "@spt-aki/helpers/BotHelper";
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "@spt-aki/models/eft/common/tables/IBotBase";
import { IBotType, Inventory, ModsChances } from "@spt-aki/models/eft/common/tables/IBotType";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { EquipmentSlots } from "@spt-aki/models/enums/EquipmentSlots";
import { IItemSpawnLimitSettings } from "@spt-aki/models/spt/bots/IItemSpawnLimitSettings";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { BotLootCacheService } from "@spt-aki/services/BotLootCacheService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
export declare class BotLootGenerator {
protected logger: ILogger;
protected hashUtil: HashUtil;
protected randomUtil: RandomUtil;
protected itemHelper: ItemHelper;
protected jsonUtil: JsonUtil;
protected inventoryHelper: InventoryHelper;
protected databaseServer: DatabaseServer;
protected handbookHelper: HandbookHelper;
protected botGeneratorHelper: BotGeneratorHelper;
protected botWeaponGenerator: BotWeaponGenerator;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected weightedRandomHelper: WeightedRandomHelper;
protected botHelper: BotHelper;
protected botLootCacheService: BotLootCacheService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
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);
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer);
protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings;
/**
* Add loot to bots containers
* @param sessionId Session id
@ -66,80 +72,72 @@ export declare class BotLootGenerator {
*/
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
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit or space limit is reached
* @param pool Pool of items to pick from with weight
* @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 itemSpawnLimits Item spawn limits the bot must adhere to
* @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;
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean): void;
protected createWalletLoot(walletId: string): Item[][];
/**
* Some items need child items to function, add them to the itemToAddChildrenTo array
* @param itemToAddTemplate Db template of item to check
* @param itemToAddChildrenTo Item to add children to
* @param isPmc Is the item being generated for a pmc (affects money/ammo stack sizes)
* @param botRole role bot has that owns item
*/
protected addRequiredChildItemsToParent(itemToAddTemplate: ITemplateItem, itemToAddChildrenTo: Item[], isPmc: boolean, botRole: string): void;
/**
* Add generated weapons to inventory as loot
* @param botInventory inventory to add preset to
* @param equipmentSlot slot to place the preset in (backpack)
* @param templateInventory bots template, assault.json
* @param modChances chances for mods to spawn on weapon
* @param botRole bots role, .e.g. pmcBot
* @param botRole bots role .e.g. pmcBot
* @param isPmc are we generating for a pmc
*/
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
* @returns ITemplateItem object
*/
protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem;
/**
* Get the loot nvalue from botconfig
* @param botRole Role of bot e.g. assault/bosstagilla/sptBear
* @returns nvalue as number
*/
protected getBotLootNValueByRole(botRole: string): number;
/**
* 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 limitCount
*/
protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record<string, number>): void;
protected initItemLimitArray(botRole: string, limitCount: Record<string, number>): void;
/**
* Check if an item has reached its bot-specific spawn limit
* @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 itemSpawnLimits
* @returns true if item has reached spawn limit
*/
protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record<string, number>, itemSpawnLimits: Record<string, number>): boolean;
protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, itemSpawnLimits: IItemSpawnLimitSettings): boolean;
/**
* Randomise the stack size of a money object, uses different values for pmc or scavs
* @param isPmc is this a PMC
* @param itemTemplate item details
* @param moneyItem Money stack to randomise
* @param botRole Role bot has that has money stack
* @param itemTemplate item details from db
* @param moneyItem Money item to randomise
*/
protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void;
protected randomiseMoneyStackSize(botRole: string, itemTemplate: ITemplateItem, moneyItem: Item): void;
/**
* Randomise the size of an ammo stack
* @param isPmc is this a PMC
* @param itemTemplate item details
* @param ammoItem Ammo stack to randomise
* @param isPmc Is ammo on a PMC bot
* @param itemTemplate item details from db
* @param ammoItem Ammo item to randomise
*/
protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void;
/**
* Get spawn limits for a specific bot type from bot.json config
* If no limit found for a non pmc bot, fall back to defaults
* @param isPmc is the bot we want limits for a pmc
* @param botRole what role does the bot have
* @returns Dictionary of tplIds and limit
*/
protected getItemSpawnLimitsForBotType(isPmc: boolean, botRole: string): Record<string, number>;
protected getItemSpawnLimitsForBotType(botRole: string): Record<string, number>;
/**
* Get the parentId or tplId of item inside spawnLimits object if it exists
* @param itemTemplate item we want to look for in spawn limits

View File

@ -1,26 +1,26 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
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";
import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
import { IInventoryMagGen } from "./weapongen/IInventoryMagGen";
import { BotEquipmentModGenerator } from "@spt-aki/generators/BotEquipmentModGenerator";
import { IInventoryMagGen } from "@spt-aki/generators/weapongen/IInventoryMagGen";
import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper";
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "@spt-aki/models/eft/common/tables/IBotBase";
import { GenerationData, Inventory, ModsChances } from "@spt-aki/models/eft/common/tables/IBotType";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { GenerateWeaponResult } from "@spt-aki/models/spt/bots/GenerateWeaponResult";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
import { IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { BotWeaponModLimitService } from "@spt-aki/services/BotWeaponModLimitService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { RepairService } from "@spt-aki/services/RepairService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
export declare class BotWeaponGenerator {
protected jsonUtil: JsonUtil;
protected logger: ILogger;
@ -73,12 +73,13 @@ export declare class BotWeaponGenerator {
*/
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
* Insert a cartridge(s) into a weapon
* Handles all chambers - patron_in_weapon, patron_in_weapon_000 etc
* @param weaponWithModsArray Weapon and mods
* @param ammoTpl Cartridge to add to weapon
* @param desiredSlotId name of slot, e.g. patron_in_weapon
* @param chamberSlotIds name of slots to create or add ammo to
*/
protected addCartridgeToChamber(weaponWithModsArray: Item[], ammoTpl: string, desiredSlotId: string): void;
protected addCartridgeToChamber(weaponWithModsArray: Item[], ammoTpl: string, chamberSlotIds: string[]): void;
/**
* Create array with weapon base as only element and
* add additional properties based on weapon type

View File

@ -1,26 +1,41 @@
import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
import { SeasonalEventService } from "../services/SeasonalEventService";
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
export declare class FenceBaseAssortGenerator {
protected logger: ILogger;
protected hashUtil: HashUtil;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected handbookHelper: HandbookHelper;
protected itemHelper: ItemHelper;
protected presetHelper: PresetHelper;
protected itemFilterService: ItemFilterService;
protected seasonalEventService: SeasonalEventService;
protected configServer: ConfigServer;
protected traderConfig: ITraderConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
/**
* Create base fence assorts dynamically and store in db
* Create base fence assorts dynamically and store in memory
*/
generateFenceBaseAssorts(): void;
protected getItemPrice(itemTpl: string, items: Item[]): number;
protected getAmmoBoxPrice(items: Item[]): number;
/**
* Add soft inserts + armor plates to an armor
* @param armor Armor item array to add mods into
* @param itemDbDetails Armor items db template
*/
protected addChildrenToArmorModSlots(armor: Item[], itemDbDetails: ITemplateItem): void;
/**
* Check if item is valid for being added to fence assorts
* @param item Item to check

View File

@ -0,0 +1,11 @@
export interface IFilterPlateModsForSlotByLevelResult {
result: Result;
plateModTpls: string[];
}
export declare enum Result {
UNKNOWN_FAILURE = -1,
SUCCESS = 1,
NO_DEFAULT_FILTER = 2,
NOT_PLATE_HOLDING_SLOT = 3,
LACKS_PLATE_WEIGHTS = 4
}

View File

@ -1,22 +1,21 @@
import { ContainerHelper } from "../helpers/ContainerHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { PresetHelper } from "../helpers/PresetHelper";
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
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, 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 { ProbabilityObjectArray, RandomUtil } from "../utils/RandomUtil";
import { ContainerHelper } from "@spt-aki/helpers/ContainerHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
import { IContainerMinMax, IStaticContainer } from "@spt-aki/models/eft/common/ILocation";
import { ILocationBase } from "@spt-aki/models/eft/common/ILocationBase";
import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "@spt-aki/models/eft/common/ILooseLoot";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "@spt-aki/models/eft/common/tables/ILootBase";
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { MathUtil } from "@spt-aki/utils/MathUtil";
import { ObjectId } from "@spt-aki/utils/ObjectId";
import { ProbabilityObjectArray, RandomUtil } from "@spt-aki/utils/RandomUtil";
export interface IContainerItem {
items: Item[];
width: number;
@ -34,7 +33,6 @@ export declare class LocationGenerator {
protected jsonUtil: JsonUtil;
protected objectId: ObjectId;
protected randomUtil: RandomUtil;
protected ragfairServerHelper: RagfairServerHelper;
protected itemHelper: ItemHelper;
protected mathUtil: MathUtil;
protected seasonalEventService: SeasonalEventService;
@ -43,7 +41,7 @@ export declare class LocationGenerator {
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected locationConfig: ILocationConfig;
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);
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Create an array of container objects with randomised loot
* @param locationBase Map base to generate containers for
@ -121,11 +119,11 @@ export declare class LocationGenerator {
generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): SpawnpointTemplate[];
/**
* Add forced spawn point loot into loot parameter array
* @param loot array to add forced loot to
* @param forcedSpawnPoints forced loot to add
* @param name of map currently generating forced loot for
* @param lootLocationTemplates array to add forced loot spawn locations to
* @param forcedSpawnPoints forced Forced loot locations that must be added
* @param locationName Name of map currently having force loot created for
*/
protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[], locationName: string): void;
protected addForcedLoot(lootLocationTemplates: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[], locationName: string): void;
/**
* Create array of item (with child items) and return
* @param chosenComposedKey Key we want to look up items for
@ -147,5 +145,5 @@ export declare class LocationGenerator {
* @returns Item object
*/
protected getItemInArray(items: Item[], chosenTpl: string): Item;
protected createStaticLootItem(tpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
}

View File

@ -1,20 +1,21 @@
import { InventoryHelper } from "../helpers/InventoryHelper";
import { ItemHelper } from "../helpers/ItemHelper";
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";
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { IPreset } from "@spt-aki/models/eft/common/IGlobals";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { ISealedAirdropContainerSettings, RewardDetails } from "@spt-aki/models/spt/config/IInventoryConfig";
import { LootItem } from "@spt-aki/models/spt/services/LootItem";
import { LootRequest } from "@spt-aki/models/spt/services/LootRequest";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { RagfairLinkedItemService } from "@spt-aki/services/RagfairLinkedItemService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
type ItemLimit = {
current: number;
max: number;
@ -24,6 +25,7 @@ export declare class LootGenerator {
protected hashUtil: HashUtil;
protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil;
protected jsonUtil: JsonUtil;
protected itemHelper: ItemHelper;
protected presetHelper: PresetHelper;
protected inventoryHelper: InventoryHelper;
@ -31,13 +33,20 @@ export declare class LootGenerator {
protected localisationService: LocalisationService;
protected ragfairLinkedItemService: RagfairLinkedItemService;
protected 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);
constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService);
/**
* Generate a list of items based on configuration options parameter
* @param options parameters to adjust how loot is generated
* @returns An array of loot items
*/
createRandomLoot(options: LootRequest): LootItem[];
/**
* Filter armor items by their main plates protection level
* @param armor Armor preset
* @param options Loot request options
* @returns True item passes checks
*/
protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean;
/**
* Construct item limit record to hold max and current item count for each item type
* @param limits limits as defined in config
@ -71,43 +80,36 @@ 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, IPreset][], itemTypeCounts: Record<string, {
protected findAndAddRandomPresetToLoot(globalDefaultPresets: 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
* @returns Array of item with children arrays
*/
getSealedWeaponCaseLoot(containerSettings: ISealedAirdropContainerSettings): AddItem[];
getSealedWeaponCaseLoot(containerSettings: ISealedAirdropContainerSettings): Item[][];
/**
* Get non-weapon mod rewards for a sealed container
* @param containerSettings Sealed weapon container settings
* @param weaponDetailsDb Details for the weapon to reward player
* @returns AddItem array
* @returns Array of item with children arrays
*/
protected getSealedContainerNonWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, weaponDetailsDb: ITemplateItem): AddItem[];
protected getSealedContainerNonWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, weaponDetailsDb: ITemplateItem): Item[][];
/**
* Iterate over the container weaponModRewardLimits settings and create an array of weapon mods to reward player
* @param containerSettings Sealed weapon container settings
* @param linkedItemsToWeapon All items that can be attached/inserted into weapon
* @param chosenWeaponPreset The weapon preset given to player as reward
* @returns AddItem array
* @returns Array of item with children arrays
*/
protected getSealedContainerWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, linkedItemsToWeapon: ITemplateItem[], chosenWeaponPreset: IPreset): AddItem[];
protected getSealedContainerWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, linkedItemsToWeapon: ITemplateItem[], chosenWeaponPreset: IPreset): Item[][];
/**
* Handle event-related loot containers - currently just the halloween jack-o-lanterns that give food rewards
* @param rewardContainerDetails
* @returns AddItem array
* @returns Array of item with children arrays
*/
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;
getRandomLootContainerLoot(rewardContainerDetails: RewardDetails): Item[][];
}
export {};

View File

@ -1,10 +1,11 @@
import { ItemHelper } from "../helpers/ItemHelper";
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";
import { SeasonalEventService } from "../services/SeasonalEventService";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
/**
* Handle the generation of dynamic PMC loot in pockets and backpacks
* and the removal of blacklisted items
@ -14,22 +15,23 @@ export declare class PMCLootGenerator {
protected databaseServer: DatabaseServer;
protected configServer: ConfigServer;
protected itemFilterService: ItemFilterService;
protected ragfairPriceService: RagfairPriceService;
protected seasonalEventService: SeasonalEventService;
protected pocketLootPool: string[];
protected vestLootPool: string[];
protected backpackLootPool: string[];
protected pocketLootPool: Record<string, number>;
protected vestLootPool: Record<string, number>;
protected backpackLootPool: Record<string, number>;
protected pmcConfig: IPmcConfig;
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService);
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService);
/**
* Create an array of loot items a PMC can have in their pockets
* @returns string array of tpls
*/
generatePMCPocketLootPool(): string[];
generatePMCPocketLootPool(botRole: string): Record<string, number>;
/**
* Create an array of loot items a PMC can have in their vests
* @returns string array of tpls
*/
generatePMCVestLootPool(): string[];
generatePMCVestLootPool(botRole: string): Record<string, number>;
/**
* Check if item has a width/height that lets it fit into a 2x2 slot
* 1x1 / 1x2 / 2x1 / 2x2
@ -41,5 +43,12 @@ export declare class PMCLootGenerator {
* Create an array of loot items a PMC can have in their backpack
* @returns string array of tpls
*/
generatePMCBackpackLootPool(): string[];
generatePMCBackpackLootPool(botRole: string): Record<string, number>;
/**
* Find the greated common divisor of all weights and use it on the passed in dictionary
* @param weightedDict
*/
protected reduceWeightValues(weightedDict: Record<string, number>): void;
protected commonDivisor(numbers: number[]): number;
protected gcd(a: number, b: number): number;
}

View File

@ -1,30 +1,28 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotHelper } from "../helpers/BotHelper";
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Skills, Stats } from "../models/eft/common/tables/IBotBase";
import { IBotType } from "../models/eft/common/tables/IBotType";
import { IPlayerScavConfig, KarmaLevel } from "../models/spt/config/IPlayerScavConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
import { BotLootCacheService } from "../services/BotLootCacheService";
import { FenceService } from "../services/FenceService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { BotGenerator } from "./BotGenerator";
import { BotGenerator } from "@spt-aki/generators/BotGenerator";
import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper";
import { BotHelper } from "@spt-aki/helpers/BotHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IBotBase, Skills, Stats } from "@spt-aki/models/eft/common/tables/IBotBase";
import { IBotType } from "@spt-aki/models/eft/common/tables/IBotType";
import { IPlayerScavConfig, KarmaLevel } from "@spt-aki/models/spt/config/IPlayerScavConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { BotLootCacheService } from "@spt-aki/services/BotLootCacheService";
import { FenceService } from "@spt-aki/services/FenceService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
export declare class PlayerScavGenerator {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer;
protected hashUtil: HashUtil;
protected itemHelper: ItemHelper;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected botGeneratorHelper: BotGeneratorHelper;
protected saveServer: SaveServer;
protected profileHelper: ProfileHelper;
@ -36,13 +34,20 @@ export declare class PlayerScavGenerator {
protected botGenerator: BotGenerator;
protected configServer: ConfigServer;
protected playerScavConfig: IPlayerScavConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer);
constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer);
/**
* Update a player profile to include a new player scav profile
* @param sessionID session id to specify what profile is updated
* @returns profile object
*/
generate(sessionID: string): IPmcData;
/**
* Add items picked from `playerscav.lootItemsToAddChancePercent`
* @param possibleItemsToAdd dict of tpl + % chance to be added
* @param scavData
* @param containersToAddTo Possible slotIds to add loot to
*/
protected addAdditionalLootToPlayerScavContainers(possibleItemsToAdd: Record<string, number>, scavData: IBotBase, containersToAddTo: string[]): void;
/**
* Get the scav karama level for a profile
* Is also the fence trader rep level

View File

@ -1,52 +1,52 @@
import { ItemHelper } from "../helpers/ItemHelper";
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";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
import { IPreset } from "@spt-aki/models/eft/common/IGlobals";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
export declare class RagfairAssortGenerator {
protected jsonUtil: JsonUtil;
protected hashUtil: HashUtil;
protected itemHelper: ItemHelper;
protected presetHelper: PresetHelper;
protected databaseServer: DatabaseServer;
protected seasonalEventService: SeasonalEventService;
protected configServer: ConfigServer;
protected generatedAssortItems: Item[];
protected generatedAssortItems: Item[][];
protected ragfairConfig: IRagfairConfig;
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
protected ragfairItemInvalidBaseTypes: string[];
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
/**
* Get an array of unique items that can be sold on the flea
* @returns array of unique items
* Get an array of arrays that can be sold on the flea
* Each sub array contains item + children (if any)
* @returns array of arrays
*/
getAssortItems(): Item[];
getAssortItems(): Item[][];
/**
* Check internal generatedAssortItems array has objects
* @returns true if array has objects
*/
protected assortsAreGenerated(): boolean;
/**
* Generate an array of items the flea can sell
* @returns array of unique items
* Generate an array of arrays (item + children) the flea can sell
* @returns array of arrays (item + children)
*/
protected generateRagfairAssortItems(): Item[];
protected generateRagfairAssortItems(): Item[][];
/**
* Get presets from globals.json
* @returns Preset object array
* Get presets from globals to add to flea
* ragfairConfig.dynamic.showDefaultPresetsOnly decides if its all presets or just defaults
* @returns IPreset array
*/
protected getPresets(): IPreset[];
/**
* Get default presets from globals.json
* @returns Preset object array
*/
protected getDefaultPresets(): IPreset[];
protected getPresetsToAdd(): 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
* @param id id to add to item
* @returns hydrated Item object
* @returns Hydrated Item object
*/
protected createRagfairAssortItem(tplId: string, id?: string): Item;
protected createRagfairAssortRootItem(tplId: string, id?: string): Item;
}

View File

@ -1,27 +1,26 @@
import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { PaymentHelper } from "../helpers/PaymentHelper";
import { PresetHelper } from "../helpers/PresetHelper";
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IBarterScheme } from "../models/eft/common/tables/ITrader";
import { IRagfairOffer, OfferRequirement } from "../models/eft/ragfair/IRagfairOffer";
import { Dynamic, IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
import { FenceService } from "../services/FenceService";
import { LocalisationService } from "../services/LocalisationService";
import { RagfairCategoriesService } from "../services/RagfairCategoriesService";
import { RagfairOfferService } from "../services/RagfairOfferService";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
import { RagfairAssortGenerator } from "./RagfairAssortGenerator";
import { RagfairAssortGenerator } from "@spt-aki/generators/RagfairAssortGenerator";
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper";
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader";
import { IRagfairOffer, OfferRequirement } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { FenceService } from "@spt-aki/services/FenceService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService";
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class RagfairOfferGenerator {
protected logger: ILogger;
protected jsonUtil: JsonUtil;
@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator {
protected ragfairPriceService: RagfairPriceService;
protected localisationService: LocalisationService;
protected paymentHelper: PaymentHelper;
protected ragfairCategoriesService: RagfairCategoriesService;
protected fenceService: FenceService;
protected itemHelper: ItemHelper;
protected configServer: ConfigServer;
@ -47,7 +45,9 @@ export declare class RagfairOfferGenerator {
tpl: string;
price: number;
}[];
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer);
/** Internal counter to ensure each offer created has a unique value for its intId property */
protected offerCounter: number;
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer);
/**
* Create a flea offer and store it in the Ragfair server offers array
* @param userID Owner of the offer
@ -119,23 +119,28 @@ export declare class RagfairOfferGenerator {
* Create multiple offers for items by using a unique list of items we've generated previously
* @param expiredOffers optional, expired offers to regenerate
*/
generateDynamicOffers(expiredOffers?: Item[]): Promise<void>;
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 assortItemWithChildren Item with its children to process into offers
* @param isExpiredOffer is an expired offer
* @param config Ragfair dynamic config
*/
protected createOffersForItems(assortItemIndex: string, assortItemsToProcess: Item[], expiredOffers: Item[], config: Dynamic): Promise<void>;
protected createOffersFromAssort(assortItemWithChildren: Item[], isExpiredOffer: boolean, config: Dynamic): Promise<void>;
/**
* iterate over an items chidren and look for plates above desired level and remove them
* @param presetWithChildren preset to check for plates
* @param plateSettings Settings
* @returns True if plate removed
*/
protected removeBannedPlatesFromPreset(presetWithChildren: Item[], plateSettings: IArmorPlateBlacklistSettings): boolean;
/**
* Create one flea offer for a specific item
* @param items Item to create offer for
* @param itemWithChildren Item to create offer for
* @param isPreset Is item a weapon preset
* @param itemDetails raw db item details
* @returns Item array
*/
protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise<void>;
protected createSingleOfferForItem(itemWithChildren: 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
@ -145,11 +150,10 @@ export declare class RagfairOfferGenerator {
* Get array of an item with its mods + condition properties (e.g durability)
* Apply randomisation adjustments to condition if item base is found in ragfair.json/dynamic/condition
* @param userID id of owner of item
* @param itemWithMods Item and mods, get condition of first item (only first array item is used)
* @param itemWithMods Item and mods, get condition of first item (only first array item is modified)
* @param itemDetails db details of first item
* @returns
*/
protected randomiseItemUpdProperties(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[];
protected randomiseOfferItemUpdProperties(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): void;
/**
* Get the relevant condition id if item tpl matches in ragfair.json/condition
* @param tpl Item to look for matching condition object
@ -159,24 +163,32 @@ export declare class RagfairOfferGenerator {
/**
* Alter an items condition based on its item base type
* @param conditionSettingsId also the parentId of item being altered
* @param item Item to adjust condition details of
* @param itemWithMods Item to adjust condition details of
* @param itemDetails db item details of first item in array
*/
protected randomiseItemCondition(conditionSettingsId: string, item: Item, itemDetails: ITemplateItem): void;
protected randomiseItemCondition(conditionSettingsId: string, itemWithMods: Item[], itemDetails: ITemplateItem): void;
/**
* Adjust an items durability/maxDurability value
* @param item item (weapon/armor) to adjust
* @param multiplier Value to multiple durability by
* @param item item (weapon/armor) to Adjust
* @param itemDbDetails Weapon details from db
* @param maxMultiplier Value to multiply max durability by
* @param currentMultiplier Value to multiply current durability by
*/
protected randomiseDurabilityValues(item: Item, multiplier: number): void;
protected randomiseWeaponDurability(item: Item, itemDbDetails: ITemplateItem, maxMultiplier: number, currentMultiplier: number): void;
/**
* Randomise the durabiltiy values for an armors plates and soft inserts
* @param armorWithMods Armor item with its child mods
* @param currentMultiplier Chosen multipler to use for current durability value
* @param maxMultiplier Chosen multipler to use for max durability value
*/
protected randomiseArmorDurabilityValues(armorWithMods: Item[], currentMultiplier: number, maxMultiplier: number): void;
/**
* Add missing conditions to an item if needed
* Durabiltiy for repairable items
* HpResource for medical items
* @param item item to add conditions to
* @returns Item with conditions added
*/
protected addMissingConditions(item: Item): Item;
protected addMissingConditions(item: Item): void;
/**
* Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based
* @param offerItems Items for sale in offer
@ -193,10 +205,10 @@ export declare class RagfairOfferGenerator {
}[];
/**
* Create a random currency-based barter scheme for an array of items
* @param offerItems Items on offer
* @param offerWithChildren Items on offer
* @param isPackOffer Is the barter scheme being created for a pack offer
* @param multipler What to multiply the resulting price by
* @returns Barter scheme for offer
*/
protected createCurrencyBarterScheme(offerItems: Item[], isPackOffer: boolean, multipler?: number): IBarterScheme[];
protected createCurrencyBarterScheme(offerWithChildren: Item[], isPackOffer: boolean, multipler?: number): IBarterScheme[];
}

View File

@ -0,0 +1,138 @@
import { RepeatableQuestRewardGenerator } from "@spt-aki/generators/RepeatableQuestRewardGenerator";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { RepeatableQuestHelper } from "@spt-aki/helpers/RepeatableQuestHelper";
import { Exit } from "@spt-aki/models/eft/common/ILocationBase";
import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase";
import { IQuestCondition, IQuestConditionCounterCondition } from "@spt-aki/models/eft/common/tables/IQuest";
import { IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests";
import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { MathUtil } from "@spt-aki/utils/MathUtil";
import { ObjectId } from "@spt-aki/utils/ObjectId";
import { ProbabilityObjectArray, RandomUtil } from "@spt-aki/utils/RandomUtil";
export declare class RepeatableQuestGenerator {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected mathUtil: MathUtil;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper;
protected localisationService: LocalisationService;
protected objectId: ObjectId;
protected repeatableQuestHelper: RepeatableQuestHelper;
protected repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator;
protected configServer: ConfigServer;
protected questConfig: IQuestConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer);
/**
* This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json).
* It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest
* @param pmcLevel Player's level for requested items and reward generation
* @param pmcTraderInfo Players traper standing/rep levels
* @param questTypePool Possible quest types pool
* @param repeatableConfig Repeatable quest config
* @returns IRepeatableQuest
*/
generateRepeatableQuest(pmcLevel: number, pmcTraderInfo: Record<string, TraderInfo>, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
/**
* Generate a randomised Elimination quest
* @param pmcLevel Player's level for requested items and reward generation
* @param traderId Trader from which the quest will be provided
* @param questTypePool Pools for quests (used to avoid redundant quests)
* @param repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
* @returns Object of quest type format for "Elimination" (see assets/database/templates/repeatableQuests.json)
*/
protected generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
/**
* Get a number of kills neded to complete elimination quest
* @param targetKey Target type desired e.g. anyPmc/bossBully/Savage
* @param targetsConfig Config
* @param eliminationConfig Config
* @returns Number of AI to kill
*/
protected getEliminationKillCount(targetKey: string, targetsConfig: ProbabilityObjectArray<string, IBossInfo>, eliminationConfig: IEliminationConfig): number;
/**
* A repeatable quest, besides some more or less static components, exists of reward and condition (see assets/database/templates/repeatableQuests.json)
* This is a helper method for GenerateEliminationQuest to create a location condition.
*
* @param {string} location the location on which to fulfill the elimination quest
* @returns {IEliminationCondition} object of "Elimination"-location-subcondition
*/
protected generateEliminationLocation(location: string[]): IQuestConditionCounterCondition;
/**
* Create kill condition for an elimination quest
* @param target Bot type target of elimination quest e.g. "AnyPmc", "Savage"
* @param targetedBodyParts Body parts player must hit
* @param distance Distance from which to kill (currently only >= supported
* @param allowedWeapon What weapon must be used - undefined = any
* @param allowedWeaponCategory What category of weapon must be used - undefined = any
* @returns IEliminationCondition object
*/
protected generateEliminationCondition(target: string, targetedBodyParts: string[], distance: number, allowedWeapon: string, allowedWeaponCategory: string): IQuestConditionCounterCondition;
/**
* Generates a valid Completion quest
*
* @param {integer} pmcLevel player's level for requested items and reward generation
* @param {string} traderId trader from which the quest will be provided
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
* @returns {object} object of quest type format for "Completion" (see assets/database/templates/repeatableQuests.json)
*/
protected generateCompletionQuest(pmcLevel: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
/**
* A repeatable quest, besides some more or less static components, exists of reward and condition (see assets/database/templates/repeatableQuests.json)
* This is a helper method for GenerateCompletionQuest to create a completion condition (of which a completion quest theoretically can have many)
*
* @param {string} itemTpl id of the item to request
* @param {integer} value amount of items of this specific type to request
* @returns {object} object of "Completion"-condition
*/
protected generateCompletionAvailableForFinish(itemTpl: string, value: number): IQuestCondition;
/**
* Generates a valid Exploration quest
*
* @param {integer} pmcLevel player's level for reward generation
* @param {string} traderId trader from which the quest will be provided
* @param {object} questTypePool Pools for quests (used to avoid redundant quests)
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
* @returns {object} object of quest type format for "Exploration" (see assets/database/templates/repeatableQuests.json)
*/
protected generateExplorationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
/**
* Filter a maps exits to just those for the desired side
* @param locationKey Map id (e.g. factory4_day)
* @param playerSide Scav/Pmc
* @returns Array of Exit objects
*/
protected getLocationExitsForSide(locationKey: string, playerSide: string): Exit[];
protected generatePickupQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
/**
* Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567)
* @param locationKey e.g factory4_day
* @returns guid
*/
protected getQuestLocationByMapId(locationKey: string): string;
/**
* Exploration repeatable quests can specify a required extraction point.
* This method creates the according object which will be appended to the conditions array
*
* @param {string} exit The exit name to generate the condition for
* @returns {object} Exit condition
*/
protected generateExplorationExitCondition(exit: Exit): IQuestConditionCounterCondition;
/**
* Generates the base object of quest type format given as templates in assets/database/templates/repeatableQuests.json
* The templates include Elimination, Completion and Extraction quest types
*
* @param {string} type Quest type: "Elimination", "Completion" or "Extraction"
* @param {string} traderId Trader from which the quest will be provided
* @param {string} side Scav daily or pmc daily/weekly quest
* @returns {object} Object which contains the base elements for repeatable quests of the requests type
* (needs to be filled with reward and conditions by called to make a valid quest)
*/
protected generateRepeatableTemplate(type: string, traderId: string, side: string): IRepeatableQuest;
}

View File

@ -0,0 +1,106 @@
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { IQuestReward, IQuestRewards } from "@spt-aki/models/eft/common/tables/IQuest";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { MathUtil } from "@spt-aki/utils/MathUtil";
import { ObjectId } from "@spt-aki/utils/ObjectId";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
export declare class RepeatableQuestRewardGenerator {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected mathUtil: MathUtil;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper;
protected presetHelper: PresetHelper;
protected handbookHelper: HandbookHelper;
protected localisationService: LocalisationService;
protected objectId: ObjectId;
protected itemFilterService: ItemFilterService;
protected seasonalEventService: SeasonalEventService;
protected configServer: ConfigServer;
protected questConfig: IQuestConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
/**
* Generate the reward for a mission. A reward can consist of
* - Experience
* - Money
* - Items
* - Trader Reputation
*
* The reward is dependent on the player level as given by the wiki. The exact mapping of pmcLevel to
* experience / money / items / trader reputation can be defined in QuestConfig.js
*
* There's also a random variation of the reward the spread of which can be also defined in the config.
*
* Additionally, a scaling factor w.r.t. quest difficulty going from 0.2...1 can be used
*
* @param {integer} pmcLevel player's level
* @param {number} difficulty a reward scaling factor from 0.2 to 1
* @param {string} traderId the trader for reputation gain (and possible in the future filtering of reward item type based on trader)
* @param {object} repeatableConfig The configuration for the repeatable kind (daily, weekly) as configured in QuestConfig for the requested quest
* @returns {object} object of "Reward"-type that can be given for a repeatable mission
*/
generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards;
/**
* @param rewardItems List of reward items to filter
* @param roublesBudget The budget remaining for rewards
* @param minPrice The minimum priced item to include
* @returns True if any items remain in `rewardItems`, false otherwise
*/
protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[];
/**
* Get a randomised number a reward items stack size should be based on its handbook price
* @param item Reward item to get stack size for
* @returns Stack size value
*/
protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number;
/**
* Should reward item have stack size increased (25% chance)
* @param item Item to possibly increase stack size of
* @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking
* @returns True if it should
*/
protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean;
protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number;
/**
* Select a number of items that have a colelctive value of the passed in parameter
* @param repeatableConfig Config
* @param roublesBudget Total value of items to return
* @returns Array of reward items that fit budget
*/
protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[];
/**
* Helper to create a reward item structured as required by the client
*
* @param {string} tpl ItemId of the rewarded item
* @param {integer} value Amount of items to give
* @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index
* @returns {object} Object of "Reward"-item-type
*/
protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward;
/**
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
* @param repeatableQuestConfig Config file
* @returns List of rewardable items [[_tpl, itemTemplate],...]
*/
getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][];
/**
* Checks if an id is a valid item. Valid meaning that it's an item that may be a reward
* or content of bot loot. Items that are tested as valid may be in a player backpack or stash.
* @param {string} tpl template id of item to check
* @returns True if item is valid reward
*/
protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean;
protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void;
}

View File

@ -1,39 +1,44 @@
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";
import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "../models/spt/hideout/ScavCaseRewardCountsAndPrices";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { IHideoutScavCase } from "@spt-aki/models/eft/hideout/IHideoutScavCase";
import { IScavCaseConfig } from "@spt-aki/models/spt/config/IScavCaseConfig";
import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt-aki/models/spt/hideout/ScavCaseRewardCountsAndPrices";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
/**
* Handle the creation of randomised scav case rewards
*/
export declare class ScavCaseRewardGenerator {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected jsonUtil: JsonUtil;
protected hashUtil: HashUtil;
protected itemHelper: ItemHelper;
protected presetHelper: PresetHelper;
protected databaseServer: DatabaseServer;
protected ragfairPriceService: RagfairPriceService;
protected seasonalEventService: SeasonalEventService;
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);
constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer);
/**
* Create an array of rewards that will be given to the player upon completing their scav case build
* @param recipeId recipe of the scav case craft
* @returns Product array
*/
generate(recipeId: string): Product[];
generate(recipeId: string): Item[][];
/**
* Get all db items that are not blacklisted in scavcase config or global blacklist
* Store in class field
@ -72,19 +77,8 @@ export declare class ScavCaseRewardGenerator {
* @param rewardItems items to convert
* @returns Product array
*/
protected randomiseContainerItemRewards(rewardItems: ITemplateItem[], rarity: string): Product[];
protected randomiseContainerItemRewards(rewardItems: ITemplateItem[], rarity: string): Item[][];
/**
* Add a randomised stack count to ammo or money items
* @param item money or ammo item
* @param resultItem money or ammo item with a randomise stack size
*/
protected addStackCountToAmmoAndMoney(item: ITemplateItem, resultItem: {
_id: string;
_tpl: string;
upd: Upd;
}, rarity: string): void;
/**
*
* @param dbItems all items from the items.json
* @param itemFilters controls how the dbItems will be filtered and returned (handbook price)
* @returns filtered dbItems array

View File

@ -1,12 +1,12 @@
import { ApplicationContext } from "../context/ApplicationContext";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { IWeather, IWeatherData } from "../models/eft/weather/IWeatherData";
import { WindDirection } from "../models/enums/WindDirection";
import { IWeatherConfig } from "../models/spt/config/IWeatherConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
import { ApplicationContext } from "@spt-aki/context/ApplicationContext";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { IWeather, IWeatherData } from "@spt-aki/models/eft/weather/IWeatherData";
import { WindDirection } from "@spt-aki/models/enums/WindDirection";
import { IWeatherConfig } from "@spt-aki/models/spt/config/IWeatherConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class WeatherGenerator {
protected weightedRandomHelper: WeightedRandomHelper;
protected logger: ILogger;
@ -15,6 +15,7 @@ export declare class WeatherGenerator {
protected applicationContext: ApplicationContext;
protected configServer: ConfigServer;
protected weatherConfig: IWeatherConfig;
private serverStartTimestampMS;
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
@ -28,13 +29,13 @@ export declare class WeatherGenerator {
* @param currentDate current date
* @returns formatted time
*/
protected getBsgFormattedInRaidTime(currentDate: Date): string;
protected getBsgFormattedInRaidTime(): string;
/**
* Get the current in-raid time
* @param currentDate (new Date())
* @returns Date object of current in-raid time
*/
getInRaidTime(currentDate: Date): Date;
getInRaidTime(): Date;
/**
* Get current time formatted to fit BSGs requirement
* @param date date to format into bsg style

View File

@ -1,4 +1,4 @@
import { InventoryMagGen } from "./InventoryMagGen";
import { InventoryMagGen } from "@spt-aki/generators/weapongen/InventoryMagGen";
export interface IInventoryMagGen {
getPriority(): number;
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;

View File

@ -1,6 +1,6 @@
import { Inventory } from "../../models/eft/common/tables/IBotBase";
import { GenerationData } from "../../models/eft/common/tables/IBotType";
import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem";
import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase";
import { GenerationData } from "@spt-aki/models/eft/common/tables/IBotType";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
export declare class InventoryMagGen {
private magCounts;
private magazineTemplate;

View File

@ -1,7 +1,7 @@
import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper";
import { RandomUtil } from "../../../utils/RandomUtil";
import { IInventoryMagGen } from "../IInventoryMagGen";
import { InventoryMagGen } from "../InventoryMagGen";
import { IInventoryMagGen } from "@spt-aki/generators/weapongen/IInventoryMagGen";
import { InventoryMagGen } from "@spt-aki/generators/weapongen/InventoryMagGen";
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
export declare class BarrelInventoryMagGen implements IInventoryMagGen {
protected randomUtil: RandomUtil;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;

View File

@ -1,16 +1,27 @@
import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "../../../helpers/ItemHelper";
import { ILogger } from "../../../models/spt/utils/ILogger";
import { LocalisationService } from "../../../services/LocalisationService";
import { IInventoryMagGen } from "../IInventoryMagGen";
import { InventoryMagGen } from "../InventoryMagGen";
import { IInventoryMagGen } from "@spt-aki/generators/weapongen/IInventoryMagGen";
import { InventoryMagGen } from "@spt-aki/generators/weapongen/InventoryMagGen";
import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper";
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
export declare class ExternalInventoryMagGen implements IInventoryMagGen {
protected logger: ILogger;
protected itemHelper: ItemHelper;
protected localisationService: LocalisationService;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
constructor(logger: ILogger, itemHelper: ItemHelper, localisationService: LocalisationService, botWeaponGeneratorHelper: BotWeaponGeneratorHelper);
protected botGeneratorHelper: BotGeneratorHelper;
protected randomUtil: RandomUtil;
constructor(logger: ILogger, itemHelper: ItemHelper, localisationService: LocalisationService, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
getPriority(): number;
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
process(inventoryMagGen: InventoryMagGen): void;
/**
* Get a random compatible external magazine for a weapon, exclude internal magazines from possible pool
* @param weaponTpl Weapon to get mag for
* @returns tpl of magazine
*/
protected getRandomExternalMagazineForInternalMagazineGun(weaponTpl: string, magazineBlacklist: string[]): ITemplateItem;
}

View File

@ -1,6 +1,6 @@
import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper";
import { IInventoryMagGen } from "../IInventoryMagGen";
import { InventoryMagGen } from "../InventoryMagGen";
import { IInventoryMagGen } from "@spt-aki/generators/weapongen/IInventoryMagGen";
import { InventoryMagGen } from "@spt-aki/generators/weapongen/InventoryMagGen";
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper";
export declare class InternalMagazineInventoryMagGen implements IInventoryMagGen {
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
constructor(botWeaponGeneratorHelper: BotWeaponGeneratorHelper);

Some files were not shown because too many files have changed in this diff Show More