Compare commits
66 Commits
Author | SHA1 | Date | |
---|---|---|---|
8f245bc6d6 | |||
|
10ec79ba47 | ||
78601ef83f | |||
e6d4487a6f | |||
aedfdd8b19 | |||
1b421da7d9 | |||
32d8ae5bc3 | |||
4c7327b11c | |||
38c55e0b62 | |||
a6d1b8ef80 | |||
bb2cd5e29c | |||
27613fd5bf | |||
42d87ddc13 | |||
9712c61b62 | |||
1dd931d2eb | |||
4d4a625292 | |||
cc06f69961 | |||
108ab78799 | |||
671eec11c3 | |||
91e02dc3aa | |||
643f777dc2 | |||
ceb6691223 | |||
562a74abb4 | |||
071b921188 | |||
678f54cdc3 | |||
a1a4388f9c | |||
9ea926cd7c | |||
fdef5eaebf | |||
159b904517 | |||
1cc4eaf237 | |||
4ef0112d3c | |||
119d4540de | |||
4bb8616e27 | |||
9acf51b0b0 | |||
239bb45dc1 | |||
5051a6daa9 | |||
503b6ba3a2 | |||
b85c2d01f6 | |||
7a5a98db87 | |||
31d4f1bace | |||
b95543a0d1 | |||
958632e9a1 | |||
de9619a654 | |||
6b63df76bf | |||
93067c68c0 | |||
34c9a34872 | |||
b651a489bd | |||
f658185b83 | |||
cfc58e6397 | |||
d538bd3962 | |||
383f1a5fc4 | |||
73e5775fd6 | |||
4ed3ec2fed | |||
a6ec985b47 | |||
4604d4b0a0 | |||
71f561db65 | |||
03d05ecad6 | |||
7b30b35166 | |||
627a256671 | |||
769c5eb2fe | |||
d71ffc4c16 | |||
71c207b165 | |||
0a38405ca5 | |||
97f9a7c234 | |||
831e1dd176 | |||
7a3c064d25 |
@ -1,7 +1,8 @@
|
|||||||
# Exclude these folders from linting
|
# Exclude these folders from linting
|
||||||
node_modules
|
**/node_modules
|
||||||
dist/
|
/tmp
|
||||||
types/
|
/dist
|
||||||
|
/types
|
||||||
|
|
||||||
# Exclude these filetypes from linting
|
# Exclude these filetypes from linting
|
||||||
*.json
|
*.json
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"root": true,
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"plugins": [
|
"plugins": ["@typescript-eslint"],
|
||||||
"@typescript-eslint"
|
|
||||||
],
|
|
||||||
"extends": [
|
"extends": [
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
"plugin:@typescript-eslint/eslint-recommended",
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
@ -17,10 +15,7 @@
|
|||||||
"@typescript-eslint/comma-dangle": 1,
|
"@typescript-eslint/comma-dangle": 1,
|
||||||
"@typescript-eslint/func-call-spacing": 2,
|
"@typescript-eslint/func-call-spacing": 2,
|
||||||
"@typescript-eslint/quotes": 1,
|
"@typescript-eslint/quotes": 1,
|
||||||
"@typescript-eslint/brace-style": [
|
"@typescript-eslint/brace-style": ["warn", "1tbs"],
|
||||||
"warn",
|
|
||||||
"1tbs"
|
|
||||||
],
|
|
||||||
"@typescript-eslint/naming-convention": [
|
"@typescript-eslint/naming-convention": [
|
||||||
"warn",
|
"warn",
|
||||||
{
|
{
|
||||||
@ -47,10 +42,7 @@
|
|||||||
"format": ["UPPER_CASE"]
|
"format": ["UPPER_CASE"]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"@typescript-eslint/indent": [
|
"@typescript-eslint/indent": ["warn", 2],
|
||||||
"warn",
|
|
||||||
2
|
|
||||||
],
|
|
||||||
"@typescript-eslint/no-unused-expressions": [
|
"@typescript-eslint/no-unused-expressions": [
|
||||||
"warn",
|
"warn",
|
||||||
{
|
{
|
||||||
@ -71,5 +63,13 @@
|
|||||||
"allowArgumentsExplicitlyTypedAsAny": true
|
"allowArgumentsExplicitlyTypedAsAny": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["*.mjs", "*.ts"],
|
||||||
|
"env": {
|
||||||
|
"node": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"baselineBulletId": "59e6906286f7746c9f75e847",
|
|
||||||
"baselineBulletPrice": 3000,
|
|
||||||
"bulletDamageMultiplierRedutionFactor": 0.7,
|
|
||||||
"baselineArmourId": "5c0e655586f774045612eeb2",
|
|
||||||
"baselineArmourWeight": 10,
|
|
||||||
"baselineArmourPrice": 200000,
|
|
||||||
"pricePerArmourClassStep": 100000,
|
|
||||||
"armourWeightMultiplierReductionFactor": 0.7,
|
|
||||||
"enableDebug": false,
|
|
||||||
"excludedCategories": ["5b5f78b786f77447ed5636af", "5b47574386f77428ca22b33c"]
|
|
||||||
}
|
|
56
advancedConfig.jsonc
Normal file
56
advancedConfig.jsonc
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
// 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": false,
|
||||||
|
|
||||||
|
// 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,
|
||||||
|
|
||||||
|
// Sale times when slower sales is enabled.
|
||||||
|
"slowerSalesTime": {
|
||||||
|
"min": 5,
|
||||||
|
"max": 10
|
||||||
|
},
|
||||||
|
|
||||||
|
// 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
|
||||||
|
}
|
34
config.json
34
config.json
@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
"startDelayInSeconds": 7,
|
|
||||||
"disableBsgBlacklist": true,
|
|
||||||
"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": "Thicc Items Case",
|
|
||||||
"itemId": "5c0a840b86f7742ffa4f2482",
|
|
||||||
"fleaPriceOverride": 12000000
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
89
config.jsonc
Normal file
89
config.jsonc
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
{
|
||||||
|
// 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,
|
||||||
|
|
||||||
|
// Makes your sales go through slower. Encourages you to sell some items in bulk instead of selling everything to the flea. Around 5 mins. Overwrites `enableFasterSales` if this is true. Default false.
|
||||||
|
"enableSlowerSales": false,
|
||||||
|
|
||||||
|
// 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": [
|
||||||
|
{
|
||||||
|
// Headwear parent id. Affects all items under this parent. ie. Team Wendy Exfil, Airframe etc.,
|
||||||
|
"parentId": "5a341c4086f77401f2541505",
|
||||||
|
"priceMultiplier": 12.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// .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 BEAR (EOD)
|
||||||
|
"itemId": "6662e9aca7e0b43baa3d5f74",
|
||||||
|
"blacklisted": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Dogtag BEAR (Unhinged edition)
|
||||||
|
"itemId": "6662e9cda7e0b43baa3d5f76",
|
||||||
|
"blacklisted": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Dogtag USEC
|
||||||
|
"itemId": "59f32c3b86f77472a31742f0",
|
||||||
|
"blacklisted": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Dogtag USEC (EOD)
|
||||||
|
"itemId": "6662e9f37fa79a6d83730fa0",
|
||||||
|
"blacklisted": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Dogtag USEC (Unhinged edition)
|
||||||
|
"itemId": "6662ea05f6259762c56f3189",
|
||||||
|
"blacklisted": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
15
package.json
15
package.json
@ -1,23 +1,24 @@
|
|||||||
{
|
{
|
||||||
"name": "The Blacklist",
|
"name": "The Blacklist",
|
||||||
"version": "1.0.0",
|
"version": "2.0.2",
|
||||||
"main": "src/mod.js",
|
"main": "src/mod.js",
|
||||||
"license": "MIT",
|
"license": "GPLv3",
|
||||||
"author": "Platinum",
|
"author": "Platinum",
|
||||||
"akiVersion": "3.4.1",
|
"sptVersion": "3.10.*",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"setup": "npm i",
|
"setup": "npm i",
|
||||||
"build": "node ./packageBuild.ts"
|
"build": "node ./packageBuild.ts"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "16.18.10",
|
"@types/node": "~20.11",
|
||||||
"@typescript-eslint/eslint-plugin": "5.46.1",
|
"@typescript-eslint/eslint-plugin": "5.46.1",
|
||||||
"@typescript-eslint/parser": "5.46.1",
|
"@typescript-eslint/parser": "5.46.1",
|
||||||
"bestzip": "2.2.1",
|
"bestzip": "2.2.1",
|
||||||
"eslint": "8.30.0",
|
"eslint": "8.30.0",
|
||||||
"fs-extra": "11.1.0",
|
"fs-extra": "~11.2",
|
||||||
"glob": "8.0.3",
|
"glob": "8.0.3",
|
||||||
"tsyringe": "4.7.0",
|
"tsyringe": "4.8.0",
|
||||||
"typescript": "4.9.4"
|
"typescript": "5.4",
|
||||||
|
"jsonc": "^2.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
7
src/helpers.ts
Normal file
7
src/helpers.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||||
|
|
||||||
|
export function isBulletOrShotgunShell(item: ITemplateItem): boolean {
|
||||||
|
const props = item._props;
|
||||||
|
|
||||||
|
return props.ammoType === "bullet" || props.ammoType === "buckshot";
|
||||||
|
}
|
234
src/mod.ts
234
src/mod.ts
@ -16,155 +16,237 @@
|
|||||||
// along with spt-the-blacklist. If not, see <http://www.gnu.org/licenses/>.
|
// along with spt-the-blacklist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import { DependencyContainer } from "tsyringe";
|
import { DependencyContainer } from "tsyringe";
|
||||||
|
import { jsonc } from "jsonc";
|
||||||
|
import path from "path";
|
||||||
|
|
||||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||||
import { IPostDBLoadMod } from "@spt-aki/models/external/IPostDBLoadMod";
|
import { IPostDBLoadModAsync } from "@spt/models/external/IPostDBLoadModAsync";
|
||||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||||
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
|
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||||
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
|
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||||
import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator";
|
import { IHandbookItem } from "@spt/models/eft/common/tables/IHandbookBase";
|
||||||
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
|
|
||||||
|
|
||||||
import config from "../config.json";
|
import { isBulletOrShotgunShell } from "./helpers";
|
||||||
import advancedConfig from "../advancedConfig.json";
|
import { IGlobals } from "@spt/models/eft/common/IGlobals";
|
||||||
|
|
||||||
class TheBlacklistMod implements IPostDBLoadMod {
|
class TheBlacklistMod implements IPostDBLoadModAsync {
|
||||||
private logger: ILogger;
|
private logger: ILogger;
|
||||||
|
|
||||||
private modName = "[The Blacklist]";
|
private modName = "[The Blacklist]";
|
||||||
|
|
||||||
// We to adjust for pricing using a baseline when mods like SPT Realism are used
|
// We to adjust for pricing using a baseline when mods like SPT Realism are used
|
||||||
private baselineBullet: ITemplateItem;
|
private baselineBullet: ITemplateItem;
|
||||||
private baselineArmour: ITemplateItem;
|
|
||||||
|
|
||||||
|
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.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), config.startDelayInSeconds * 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
private initialiseMod(
|
|
||||||
container: DependencyContainer
|
|
||||||
): void {
|
|
||||||
const databaseServer = container.resolve<DatabaseServer>("DatabaseServer");
|
const databaseServer = container.resolve<DatabaseServer>("DatabaseServer");
|
||||||
const tables = databaseServer.getTables();
|
const tables = databaseServer.getTables();
|
||||||
const configServer = container.resolve<ConfigServer>("ConfigServer");
|
const configServer = container.resolve<ConfigServer>("ConfigServer");
|
||||||
const ragfairConfig = configServer.getConfig<IRagfairConfig>(ConfigTypes.RAGFAIR);
|
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 itemTable = tables.templates.items;
|
||||||
const handbookItems = tables.templates.handbook.Items;
|
const handbookItems = tables.templates.handbook.Items;
|
||||||
const prices = tables.templates.prices;
|
const prices = tables.templates.prices;
|
||||||
|
const globals = tables.globals;
|
||||||
|
|
||||||
ragfairConfig.dynamic.blacklist.enableBsgList = !config.disableBsgBlacklist;
|
this.baselineBullet = itemTable[this.advancedConfig.baselineBulletId];
|
||||||
|
|
||||||
this.baselineBullet = itemTable[advancedConfig.baselineBulletId];
|
this.updateRagfairConfig(ragfairConfig);
|
||||||
this.baselineArmour = itemTable[advancedConfig.baselineArmourId];
|
this.updateGlobals(globals);
|
||||||
|
|
||||||
let blacklistedItemsCount = 0;
|
|
||||||
|
|
||||||
// Find all items to update by looping through handbook which is a better indicator of useable items.
|
// Find all items to update by looping through handbook which is a better indicator of useable items.
|
||||||
handbookItems.forEach(handbookItem => {
|
handbookItems.forEach(handbookItem => {
|
||||||
const item = itemTable[handbookItem.Id];
|
const item = itemTable[handbookItem.Id];
|
||||||
const customItemConfig = config.customItemConfigs.find(conf => conf.itemId === item._id);
|
|
||||||
const originalPrice = prices[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.
|
const customItemConfig = this.config.customItemConfigs.find(conf => conf.itemId === item._id || conf.parentId === item._parent);
|
||||||
if (customItemConfig?.fleaPriceOverride) {
|
|
||||||
prices[item._id] = customItemConfig.fleaPriceOverride;
|
// We found a custom item config override to use. That's all we care about for this item. Move on to the next item.
|
||||||
this.debug(`Updated ${item._id} - ${item._name} flea price from ${originalPrice} to ${prices[item._id]} (price override).`);
|
if (customItemConfig && this.updateItemUsingCustomItemConfig(customItemConfig, item, prices, originalPrice, ragfairConfig)) {
|
||||||
blacklistedItemsCount++;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const itemProps = item._props;
|
const itemProps = item._props;
|
||||||
|
|
||||||
|
if (isBulletOrShotgunShell(item)) {
|
||||||
|
this.updateAmmoPrice(item, prices);
|
||||||
|
}
|
||||||
|
|
||||||
if (!itemProps.CanSellOnRagfair) {
|
if (!itemProps.CanSellOnRagfair) {
|
||||||
// Some blacklisted items are hard to balance or just shouldn't be allowed so we will keep them blacklisted.
|
// 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);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
itemProps.CanSellOnRagfair = config.disableBsgBlacklist;
|
prices[item._id] = this.getUpdatedPrice(handbookItem, item, prices);
|
||||||
|
|
||||||
prices[item._id] = this.getUpdatedPrice(item, prices);
|
|
||||||
|
|
||||||
if (!prices[item._id]) {
|
if (!prices[item._id]) {
|
||||||
this.debug(`There are no flea prices for ${item._id} - ${item._name}!`);
|
this.debug(`There are no flea prices for ${item._id} - ${item._name}!`);
|
||||||
return;
|
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]}.`);
|
this.debug(`Updated ${item._id} - ${item._name} flea price from ${originalPrice} to ${prices[item._id]}.`);
|
||||||
|
|
||||||
blacklistedItemsCount++;
|
this.blacklistedItemsUpdatedCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
const itemSpecificPriceMultiplier = customItemConfig?.priceMultiplier || 1;
|
|
||||||
prices[item._id] *= itemSpecificPriceMultiplier;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Typescript hack to call protected method
|
this.logger.success(`${this.modName}: Success! Found ${this.blacklistedItemsUpdatedCount} blacklisted & ${this.nonBlacklistedItemsUpdatedCount} non-blacklisted items to update.`);
|
||||||
(ragfairPriceService as any).generateDynamicPrices();
|
|
||||||
ragfairOfferGenerator.generateDynamicOffers().then(() => {
|
if (this.config.useBalancedPricingForAllAmmo) {
|
||||||
this.logger.success(`${this.modName}: Success! Found ${blacklistedItemsCount} blacklisted items to update.`);
|
this.logger.success(`${this.modName}: config.useBalancedPricingForAllAmmo is enabled! Updated ${this.ammoPricesUpdatedCount} ammo prices.`);
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private getUpdatedPrice(item: ITemplateItem, prices: Record<string, number>): number | undefined {
|
private updateRagfairConfig(ragfairConfig: IRagfairConfig) {
|
||||||
// Note that this price can be affected by other mods like Lua's market updater.
|
ragfairConfig.dynamic.blacklist.enableBsgList = !this.config.disableBsgBlacklist;
|
||||||
const currentFleaPrice = prices[item._id];
|
|
||||||
let newPrice: number;
|
|
||||||
|
|
||||||
if (item._props.ammoType === "bullet") {
|
if (this.advancedConfig.useTraderPriceForOffersIfHigher != null) {
|
||||||
newPrice = this.getUpdatedAmmoPrice(item);
|
ragfairConfig.dynamic.useTraderPriceForOffersIfHigher = !!this.advancedConfig.useTraderPriceForOffersIfHigher;
|
||||||
} else if (Number(item._props.armorClass) > 0 && item._props.armorZone?.some(zone => zone === "Chest")) {
|
|
||||||
newPrice = this.getUpdatedArmourPrice(item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Avoids NaN. Also we shouldn't have any prices of 0.
|
if (!this.config.enableSlowerSales && this.config.enableFasterSales && !isNaN(this.advancedConfig.runIntervalSecondsOverride)) {
|
||||||
const price = newPrice || currentFleaPrice;
|
ragfairConfig.runIntervalValues.outOfRaid = this.advancedConfig.runIntervalSecondsOverride;
|
||||||
return price && price * config.blacklistedItemPriceMultiplier;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private getUpdatedAmmoPrice(item: ITemplateItem) {
|
if (this.config.enableSlowerSales && this.advancedConfig.slowerSalesTime) {
|
||||||
|
ragfairConfig.sell.time = this.advancedConfig.slowerSalesTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.config.enableScarceOffers) {
|
||||||
|
this.updateRagfairConfigToHaveScarceOffers(ragfairConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
ragfairConfig.dynamic.barter.chancePercent = 0;
|
||||||
|
ragfairConfig.dynamic.pack.chancePercent = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private updateGlobals(globals: IGlobals) {
|
||||||
|
const ragfairConfig = globals.config.RagFair;
|
||||||
|
|
||||||
|
if (this.config.addExtraOfferSlot) {
|
||||||
|
for (const settingForBracket of ragfairConfig.maxActiveOfferCount) {
|
||||||
|
settingForBracket.count += this.advancedConfig.extraOfferSlotsToAdd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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.`);
|
||||||
|
|
||||||
|
ragfairConfig.dynamic.blacklist.custom.push(item._id);
|
||||||
|
|
||||||
|
if (item._props.CanSellOnRagfair) {
|
||||||
|
this.nonBlacklistedItemsUpdatedCount++
|
||||||
|
}
|
||||||
|
|
||||||
|
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 baselinePen = this.baselineBullet._props.PenetrationPower;
|
||||||
const baselineDamage = this.baselineBullet._props.Damage;
|
const baselineDamage = this.baselineBullet._props.Damage;
|
||||||
|
|
||||||
const penetrationMultiplier = item._props.PenetrationPower / baselinePen;
|
const basePenetrationMultiplier = item._props.PenetrationPower / baselinePen;
|
||||||
const baseDamageMultiplier = item._props.Damage / baselineDamage;
|
const baseDamageMultiplier = item._props.Damage / baselineDamage;
|
||||||
|
|
||||||
|
let penetrationMultiplier: number;
|
||||||
|
|
||||||
|
// 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 = 3 * basePenetrationMultiplier - 2;
|
||||||
|
} else {
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
|
||||||
// Reduces the effect of the damage multiplier so high DMG rounds aren't super expensive.
|
// 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:
|
// 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.
|
// 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 getUpdatedPrice(handbookItem: IHandbookItem, item: ITemplateItem, prices: Record<string, number>): number | undefined {
|
||||||
private getUpdatedArmourPrice(item: ITemplateItem) {
|
// If a flea price doesn't exist for an item, we can multiply its handbook price which usually exists.
|
||||||
const baselineArmourClass = Number(this.baselineArmour._props.armorClass);
|
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.
|
return handbookPrice * this.advancedConfig.handbookPriceMultiplier;
|
||||||
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.
|
return prices[item._id] * this.config.blacklistedItemPriceMultiplier;
|
||||||
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private debug(message: string) {
|
private debug(message: string) {
|
||||||
if (advancedConfig.enableDebug) {
|
if (this.advancedConfig.enableDebug) {
|
||||||
this.logger.debug(`${this.modName}: ${message}`);
|
this.logger.debug(`${this.modName}: ${message}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,18 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"module": "CommonJS",
|
"module": "NodeNext",
|
||||||
"target": "es2020",
|
"target": "ES2022",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "NodeNext",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"downlevelIteration": true,
|
"downlevelIteration": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"outDir": "tmp",
|
"outDir": "tmp",
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"@spt-aki/*": ["./types/*"]
|
"@spt/*": ["./types/*"],
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"lib": [
|
},
|
||||||
"es2020"
|
"exclude": ["node_modules", "dist", "tmp"],
|
||||||
],
|
|
||||||
"include": [
|
|
||||||
"src/*",
|
|
||||||
"src/**/*"
|
|
||||||
]
|
|
||||||
}
|
}
|
2
types/ErrorHandler.d.ts
vendored
2
types/ErrorHandler.d.ts
vendored
@ -2,5 +2,5 @@ export declare class ErrorHandler {
|
|||||||
private logger;
|
private logger;
|
||||||
private readLine;
|
private readLine;
|
||||||
constructor();
|
constructor();
|
||||||
handleCriticalError(err: any): void;
|
handleCriticalError(err: Error): void;
|
||||||
}
|
}
|
||||||
|
2
types/Program.d.ts
vendored
2
types/Program.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
export declare class Program {
|
export declare class Program {
|
||||||
private errorHandler;
|
private errorHandler;
|
||||||
constructor();
|
constructor();
|
||||||
start(): void;
|
start(): Promise<void>;
|
||||||
}
|
}
|
||||||
|
3
types/TYPES.d.ts
vendored
3
types/TYPES.d.ts
vendored
@ -1,3 +0,0 @@
|
|||||||
export declare const TYPES: {
|
|
||||||
[name: string]: symbol;
|
|
||||||
};
|
|
21
types/callbacks/AchievementCallbacks.d.ts
vendored
Normal file
21
types/callbacks/AchievementCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { AchievementController } from "@spt/controllers/AchievementController";
|
||||||
|
import { ProfileController } from "@spt/controllers/ProfileController";
|
||||||
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
|
import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse";
|
||||||
|
import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse";
|
||||||
|
import { HttpResponseUtil } from "@spt/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>;
|
||||||
|
}
|
27
types/callbacks/BotCallbacks.d.ts
vendored
27
types/callbacks/BotCallbacks.d.ts
vendored
@ -1,15 +1,19 @@
|
|||||||
import { BotController } from "../controllers/BotController";
|
import { ApplicationContext } from "@spt/context/ApplicationContext";
|
||||||
import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData";
|
import { BotController } from "@spt/controllers/BotController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IGenerateBotsRequestData } from "@spt/models/eft/bot/IGenerateBotsRequestData";
|
||||||
import { IBotBase } from "../models/eft/common/tables/IBotBase";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IBotBase } from "@spt/models/eft/common/tables/IBotBase";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IDifficulties } from "@spt/models/eft/common/tables/IBotType";
|
||||||
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
export declare class BotCallbacks {
|
export declare class BotCallbacks {
|
||||||
protected botController: BotController;
|
protected botController: BotController;
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
constructor(botController: BotController, httpResponse: HttpResponseUtil);
|
protected applicationContext: ApplicationContext;
|
||||||
|
constructor(botController: BotController, httpResponse: HttpResponseUtil, applicationContext: ApplicationContext);
|
||||||
/**
|
/**
|
||||||
* Handle singleplayer/settings/bot/limit
|
* Handle singleplayer/settings/bot/limit
|
||||||
|
* Is called by client to define each bot roles wave limit
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
getBotLimit(url: string, info: IEmptyRequestData, sessionID: string): string;
|
getBotLimit(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
@ -18,16 +22,21 @@ export declare class BotCallbacks {
|
|||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string;
|
getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
|
/**
|
||||||
|
* Handle singleplayer/settings/bot/difficulties
|
||||||
|
* @returns dictionary of every bot and its diffiulty settings
|
||||||
|
*/
|
||||||
|
getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record<string, IDifficulties>;
|
||||||
/**
|
/**
|
||||||
* Handle client/game/bot/generate
|
* Handle client/game/bot/generate
|
||||||
* @returns IGetBodyResponseData
|
* @returns IGetBodyResponseData
|
||||||
*/
|
*/
|
||||||
generateBots(url: string, info: IGenerateBotsRequestData, sessionID: string): IGetBodyResponseData<IBotBase[]>;
|
generateBots(url: string, info: IGenerateBotsRequestData, sessionID: string): Promise<IGetBodyResponseData<IBotBase[]>>;
|
||||||
/**
|
/**
|
||||||
* Handle singleplayer/settings/bot/maxCap
|
* Handle singleplayer/settings/bot/maxCap
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
getBotCap(): string;
|
getBotCap(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
/**
|
/**
|
||||||
* Handle singleplayer/settings/bot/getBotBehaviours
|
* Handle singleplayer/settings/bot/getBotBehaviours
|
||||||
* @returns string
|
* @returns string
|
||||||
|
34
types/callbacks/BuildsCallbacks.d.ts
vendored
Normal file
34
types/callbacks/BuildsCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import { BuildController } from "@spt/controllers/BuildController";
|
||||||
|
import { ISetMagazineRequest } from "@spt/models/eft/builds/ISetMagazineRequest";
|
||||||
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
|
import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData";
|
||||||
|
import { IPresetBuildActionRequestData } from "@spt/models/eft/presetBuild/IPresetBuildActionRequestData";
|
||||||
|
import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuildRequestData";
|
||||||
|
import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile";
|
||||||
|
import { HttpResponseUtil } from "@spt/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;
|
||||||
|
}
|
18
types/callbacks/BundleCallbacks.d.ts
vendored
18
types/callbacks/BundleCallbacks.d.ts
vendored
@ -1,18 +1,16 @@
|
|||||||
import { BundleLoader } from "../loaders/BundleLoader";
|
import { BundleLoader } from "@spt/loaders/BundleLoader";
|
||||||
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
|
import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
import { HttpFileUtil } from "../utils/HttpFileUtil";
|
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
|
||||||
export declare class BundleCallbacks {
|
export declare class BundleCallbacks {
|
||||||
protected logger: ILogger;
|
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected httpFileUtil: HttpFileUtil;
|
|
||||||
protected bundleLoader: BundleLoader;
|
protected bundleLoader: BundleLoader;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected httpConfig: IHttpConfig;
|
protected httpConfig: IHttpConfig;
|
||||||
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer);
|
constructor(httpResponse: HttpResponseUtil, bundleLoader: BundleLoader, configServer: ConfigServer);
|
||||||
sendBundle(sessionID: string, req: any, resp: any, body: any): any;
|
/**
|
||||||
|
* Handle singleplayer/bundles
|
||||||
|
*/
|
||||||
getBundles(url: string, info: any, sessionID: string): string;
|
getBundles(url: string, info: any, sessionID: string): string;
|
||||||
getBundle(url: string, info: any, sessionID: string): string;
|
getBundle(url: string, info: any, sessionID: string): string;
|
||||||
}
|
}
|
||||||
|
28
types/callbacks/ClientLogCallbacks.d.ts
vendored
Normal file
28
types/callbacks/ClientLogCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import { ClientLogController } from "@spt/controllers/ClientLogController";
|
||||||
|
import { ModLoadOrder } from "@spt/loaders/ModLoadOrder";
|
||||||
|
import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData";
|
||||||
|
import { IClientLogRequest } from "@spt/models/spt/logging/IClientLogRequest";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { HttpResponseUtil } from "@spt/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;
|
||||||
|
}
|
34
types/callbacks/CustomizationCallbacks.d.ts
vendored
34
types/callbacks/CustomizationCallbacks.d.ts
vendored
@ -1,29 +1,35 @@
|
|||||||
import { CustomizationController } from "../controllers/CustomizationController";
|
import { CustomizationController } from "@spt/controllers/CustomizationController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { ISuit } from "../models/eft/common/tables/ITrader";
|
import { ISuit } from "@spt/models/eft/common/tables/ITrader";
|
||||||
import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothingRequestData";
|
import { IBuyClothingRequestData } from "@spt/models/eft/customization/IBuyClothingRequestData";
|
||||||
import { IGetSuitsResponse } from "../models/eft/customization/IGetSuitsResponse";
|
import { IGetSuitsResponse } from "@spt/models/eft/customization/IGetSuitsResponse";
|
||||||
import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData";
|
import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClothingRequestData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
export declare class CustomizationCallbacks {
|
export declare class CustomizationCallbacks {
|
||||||
protected customizationController: CustomizationController;
|
protected customizationController: CustomizationController;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
constructor(customizationController: CustomizationController, saveServer: SaveServer, httpResponse: HttpResponseUtil);
|
constructor(customizationController: CustomizationController, saveServer: SaveServer, httpResponse: HttpResponseUtil);
|
||||||
/**
|
/**
|
||||||
* Handles client/trading/customization/storage
|
* Handle client/trading/customization/storage
|
||||||
* @returns
|
* @returns IGetSuitsResponse
|
||||||
*/
|
*/
|
||||||
getSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetSuitsResponse>;
|
getSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetSuitsResponse>;
|
||||||
/**
|
/**
|
||||||
* Handles client/trading/customization
|
* Handle client/trading/customization
|
||||||
* @returns ISuit[]
|
* @returns ISuit[]
|
||||||
*/
|
*/
|
||||||
getTraderSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISuit[]>;
|
getTraderSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISuit[]>;
|
||||||
|
/**
|
||||||
|
* Handle CustomizationWear event
|
||||||
|
*/
|
||||||
wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle CustomizationBuy event
|
||||||
|
*/
|
||||||
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
75
types/callbacks/DataCallbacks.d.ts
vendored
75
types/callbacks/DataCallbacks.d.ts
vendored
@ -1,59 +1,88 @@
|
|||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { HideoutController } from "@spt/controllers/HideoutController";
|
||||||
import { IGlobals } from "../models/eft/common/IGlobals";
|
import { TraderController } from "@spt/controllers/TraderController";
|
||||||
import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem";
|
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||||
import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { IQuest } from "../models/eft/common/tables/IQuest";
|
import { IGlobals } from "@spt/models/eft/common/IGlobals";
|
||||||
import { IHideoutArea } from "../models/eft/hideout/IHideoutArea";
|
import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem";
|
||||||
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
|
import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase";
|
||||||
import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase";
|
import { IGetItemPricesResponse } from "@spt/models/eft/game/IGetItemPricesResponse";
|
||||||
import { IHideoutSettingsBase } from "../models/eft/hideout/IHideoutSettingsBase";
|
import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IHideoutProductionData } from "@spt/models/eft/hideout/IHideoutProduction";
|
||||||
import { ISettingsBase } from "../models/spt/server/ISettingsBase";
|
import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
|
import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
/**
|
/**
|
||||||
* Handle client requests
|
* Handle client requests
|
||||||
*/
|
*/
|
||||||
export declare class DataCallbacks {
|
export declare class DataCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected timeUtil: TimeUtil;
|
||||||
constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer);
|
protected traderHelper: TraderHelper;
|
||||||
|
protected databaseService: DatabaseService;
|
||||||
|
protected traderController: TraderController;
|
||||||
|
protected hideoutController: HideoutController;
|
||||||
|
constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, traderController: TraderController, hideoutController: HideoutController);
|
||||||
/**
|
/**
|
||||||
* Handles client/settings
|
* Handle client/settings
|
||||||
* @returns ISettingsBase
|
* @returns ISettingsBase
|
||||||
*/
|
*/
|
||||||
getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISettingsBase>;
|
getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISettingsBase>;
|
||||||
/**
|
/**
|
||||||
* Handles client/globals
|
* Handle client/globals
|
||||||
* @returns IGlobals
|
* @returns IGlobals
|
||||||
*/
|
*/
|
||||||
getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGlobals>;
|
getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGlobals>;
|
||||||
/**
|
/**
|
||||||
* Handles client/items
|
* Handle client/items
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string;
|
getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
/**
|
/**
|
||||||
* Handles client/handbook/templates
|
* Handle client/handbook/templates
|
||||||
* @returns IHandbookBase
|
* @returns IHandbookBase
|
||||||
*/
|
*/
|
||||||
getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHandbookBase>;
|
getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHandbookBase>;
|
||||||
/**
|
/**
|
||||||
* Handles client/customization
|
* Handle client/customization
|
||||||
* @returns Record<string, ICustomizationItem
|
* @returns Record<string, ICustomizationItem
|
||||||
*/
|
*/
|
||||||
getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, ICustomizationItem>>;
|
getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, ICustomizationItem>>;
|
||||||
/**
|
/**
|
||||||
* Handles client/account/customization
|
* Handle client/account/customization
|
||||||
* @returns string[]
|
* @returns string[]
|
||||||
*/
|
*/
|
||||||
getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string[]>;
|
getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string[]>;
|
||||||
getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IQuest[]>;
|
/**
|
||||||
|
* Handle client/hideout/settings
|
||||||
|
* @returns IHideoutSettingsBase
|
||||||
|
*/
|
||||||
getHideoutSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutSettingsBase>;
|
getHideoutSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutSettingsBase>;
|
||||||
getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutArea[]>;
|
getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutArea[]>;
|
||||||
gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutProduction[]>;
|
getHideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutProductionData>;
|
||||||
getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutScavCase[]>;
|
getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutScavCase[]>;
|
||||||
|
/**
|
||||||
|
* Handle client/languages
|
||||||
|
*/
|
||||||
getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, string>>;
|
getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, string>>;
|
||||||
|
/**
|
||||||
|
* Handle client/menu/locale
|
||||||
|
*/
|
||||||
getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
||||||
|
/**
|
||||||
|
* Handle client/locale
|
||||||
|
*/
|
||||||
getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string;
|
getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
|
/**
|
||||||
|
* Handle client/hideout/qte/list
|
||||||
|
*/
|
||||||
|
getQteList(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
|
/**
|
||||||
|
* Handle client/items/prices/
|
||||||
|
* Called when viewing a traders assorts
|
||||||
|
*/
|
||||||
|
getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetItemPricesResponse>;
|
||||||
}
|
}
|
||||||
|
119
types/callbacks/DialogueCallbacks.d.ts
vendored
119
types/callbacks/DialogueCallbacks.d.ts
vendored
@ -1,58 +1,111 @@
|
|||||||
import { DialogueController } from "../controllers/DialogueController";
|
import { DialogueController } from "@spt/controllers/DialogueController";
|
||||||
import { OnUpdate } from "../di/OnUpdate";
|
import { OnUpdate } from "@spt/di/OnUpdate";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { IChatServer } from "../models/eft/dialog/IChatServer";
|
import { IUIDRequestData } from "@spt/models/eft/common/request/IUIDRequestData";
|
||||||
import { IFriendRequestData } from "../models/eft/dialog/IFriendRequestData";
|
import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt/models/eft/dialog/IAcceptFriendRequestData";
|
||||||
import { IGetAllAttachmentsRequestData } from "../models/eft/dialog/IGetAllAttachmentsRequestData";
|
import { IAddUserGroupMailRequest } from "@spt/models/eft/dialog/IAddUserGroupMailRequest";
|
||||||
import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse";
|
import { IChangeGroupMailOwnerRequest } from "@spt/models/eft/dialog/IChangeGroupMailOwnerRequest";
|
||||||
import { IGetChatServerListRequestData } from "../models/eft/dialog/IGetChatServerListRequestData";
|
import { IChatServer } from "@spt/models/eft/dialog/IChatServer";
|
||||||
import { IGetFriendListDataResponse } from "../models/eft/dialog/IGetFriendListDataResponse";
|
import { IClearMailMessageRequest } from "@spt/models/eft/dialog/IClearMailMessageRequest";
|
||||||
import { IGetMailDialogInfoRequestData } from "../models/eft/dialog/IGetMailDialogInfoRequestData";
|
import { ICreateGroupMailRequest } from "@spt/models/eft/dialog/ICreateGroupMailRequest";
|
||||||
import { IGetMailDialogListRequestData } from "../models/eft/dialog/IGetMailDialogListRequestData";
|
import { IDeleteFriendRequest } from "@spt/models/eft/dialog/IDeleteFriendRequest";
|
||||||
import { IGetMailDialogViewRequestData } from "../models/eft/dialog/IGetMailDialogViewRequestData";
|
import { IFriendRequestData } from "@spt/models/eft/dialog/IFriendRequestData";
|
||||||
import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDialogViewResponseData";
|
import { IFriendRequestSendResponse } from "@spt/models/eft/dialog/IFriendRequestSendResponse";
|
||||||
import { IPinDialogRequestData } from "../models/eft/dialog/IPinDialogRequestData";
|
import { IGetAllAttachmentsRequestData } from "@spt/models/eft/dialog/IGetAllAttachmentsRequestData";
|
||||||
import { IRemoveDialogRequestData } from "../models/eft/dialog/IRemoveDialogRequestData";
|
import { IGetAllAttachmentsResponse } from "@spt/models/eft/dialog/IGetAllAttachmentsResponse";
|
||||||
import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest";
|
import { IGetChatServerListRequestData } from "@spt/models/eft/dialog/IGetChatServerListRequestData";
|
||||||
import { ISetDialogReadRequestData } from "../models/eft/dialog/ISetDialogReadRequestData";
|
import { IGetFriendListDataResponse } from "@spt/models/eft/dialog/IGetFriendListDataResponse";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetMailDialogInfoRequestData } from "@spt/models/eft/dialog/IGetMailDialogInfoRequestData";
|
||||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
import { IGetMailDialogListRequestData } from "@spt/models/eft/dialog/IGetMailDialogListRequestData";
|
||||||
import { DialogueInfo } from "../models/eft/profile/IAkiProfile";
|
import { IGetMailDialogViewRequestData } from "@spt/models/eft/dialog/IGetMailDialogViewRequestData";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { IGetMailDialogViewResponseData } from "@spt/models/eft/dialog/IGetMailDialogViewResponseData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IPinDialogRequestData } from "@spt/models/eft/dialog/IPinDialogRequestData";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { IRemoveDialogRequestData } from "@spt/models/eft/dialog/IRemoveDialogRequestData";
|
||||||
export declare class DialogueCallbacks extends OnUpdate {
|
import { IRemoveMailMessageRequest } from "@spt/models/eft/dialog/IRemoveMailMessageRequest";
|
||||||
|
import { IRemoveUserGroupMailRequest } from "@spt/models/eft/dialog/IRemoveUserGroupMailRequest";
|
||||||
|
import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest";
|
||||||
|
import { ISetDialogReadRequestData } from "@spt/models/eft/dialog/ISetDialogReadRequestData";
|
||||||
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
|
import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData";
|
||||||
|
import { IDialogueInfo } from "@spt/models/eft/profile/ISptProfile";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
|
export declare class DialogueCallbacks implements OnUpdate {
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected dialogueController: DialogueController;
|
protected dialogueController: DialogueController;
|
||||||
constructor(hashUtil: HashUtil, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, dialogueController: DialogueController);
|
constructor(hashUtil: HashUtil, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, dialogueController: DialogueController);
|
||||||
/**
|
/**
|
||||||
* Handles client/friend/list
|
* Handle client/friend/list
|
||||||
* @returns IGetFriendListDataResponse
|
* @returns IGetFriendListDataResponse
|
||||||
*/
|
*/
|
||||||
getFriendList(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetFriendListDataResponse>;
|
getFriendList(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetFriendListDataResponse>;
|
||||||
/**
|
/**
|
||||||
* Handles client/chatServer/list
|
* Handle client/chatServer/list
|
||||||
* @returns
|
* @returns IChatServer[]
|
||||||
*/
|
*/
|
||||||
getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData<IChatServer[]>;
|
getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData<IChatServer[]>;
|
||||||
getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo[]>;
|
/** Handle client/mail/dialog/list */
|
||||||
|
getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData<IDialogueInfo[]>;
|
||||||
|
/** Handle client/mail/dialog/view */
|
||||||
getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData<IGetMailDialogViewResponseData>;
|
getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData<IGetMailDialogViewResponseData>;
|
||||||
getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo>;
|
/** Handle client/mail/dialog/info */
|
||||||
|
getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData<IDialogueInfo>;
|
||||||
|
/** Handle client/mail/dialog/remove */
|
||||||
removeDialog(url: string, info: IRemoveDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
removeDialog(url: string, info: IRemoveDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
/** Handle client/mail/dialog/pin */
|
||||||
pinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
pinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
/** Handle client/mail/dialog/unpin */
|
||||||
unpinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
unpinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
/** Handle client/mail/dialog/read */
|
||||||
setRead(url: string, info: ISetDialogReadRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
setRead(url: string, info: ISetDialogReadRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
/**
|
/**
|
||||||
* Handles client/mail/dialog/getAllAttachments
|
* Handle client/mail/dialog/getAllAttachments
|
||||||
* @returns IGetAllAttachmentsResponse
|
* @returns IGetAllAttachmentsResponse
|
||||||
*/
|
*/
|
||||||
getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData<IGetAllAttachmentsResponse>;
|
getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData<IGetAllAttachmentsResponse | undefined>;
|
||||||
|
/** Handle client/mail/msg/send */
|
||||||
|
sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData<string>;
|
||||||
|
/** Handle client/friend/request/list/outbox */
|
||||||
listOutbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
listOutbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
/**
|
||||||
|
* Handle client/friend/request/list/inbox
|
||||||
|
*/
|
||||||
listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
friendRequest(url: string, request: IFriendRequestData, sessionID: string): INullResponseData;
|
/**
|
||||||
sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData<number>;
|
* Handle client/friend/request/send
|
||||||
|
*/
|
||||||
|
sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData<IFriendRequestSendResponse>;
|
||||||
|
/**
|
||||||
|
* Handle client/friend/request/accept-all
|
||||||
|
*/
|
||||||
|
acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||||
|
/**
|
||||||
|
* Handle client/friend/request/accept
|
||||||
|
*/
|
||||||
|
acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||||
|
/**
|
||||||
|
* Handle client/friend/request/decline
|
||||||
|
*/
|
||||||
|
declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||||
|
/**
|
||||||
|
* Handle client/friend/request/cancel
|
||||||
|
*/
|
||||||
|
cancelFriendRequest(url: string, request: ICancelFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||||
|
/** Handle client/friend/delete */
|
||||||
|
deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData;
|
||||||
|
/** Handle client/friend/ignore/set */
|
||||||
|
ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData;
|
||||||
|
/** Handle client/friend/ignore/remove */
|
||||||
|
unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData;
|
||||||
|
clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
createGroupMail(url: string, info: ICreateGroupMailRequest, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
changeMailGroupOwner(url: string, info: IChangeGroupMailOwnerRequest, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
addUserToMail(url: string, info: IAddUserGroupMailRequest, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
removeUserFromMail(url: string, info: IRemoveUserGroupMailRequest, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
||||||
getRoute(): string;
|
getRoute(): string;
|
||||||
}
|
}
|
||||||
|
89
types/callbacks/GameCallbacks.d.ts
vendored
89
types/callbacks/GameCallbacks.d.ts
vendored
@ -1,23 +1,35 @@
|
|||||||
import { GameController } from "../controllers/GameController";
|
import { GameController } from "@spt/controllers/GameController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { OnLoad } from "@spt/di/OnLoad";
|
||||||
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
|
import { IUIDRequestData } from "@spt/models/eft/common/request/IUIDRequestData";
|
||||||
import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData";
|
import { ICheckVersionResponse } from "@spt/models/eft/game/ICheckVersionResponse";
|
||||||
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
|
import { ICurrentGroupResponse } from "@spt/models/eft/game/ICurrentGroupResponse";
|
||||||
import { IGameLogoutResponseData } from "../models/eft/game/IGameLogoutResponseData";
|
import { IGameConfigResponse } from "@spt/models/eft/game/IGameConfigResponse";
|
||||||
import { IGameStartResponse } from "../models/eft/game/IGameStartResponse";
|
import { IGameEmptyCrcRequestData } from "@spt/models/eft/game/IGameEmptyCrcRequestData";
|
||||||
import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData";
|
import { IGameKeepAliveResponse } from "@spt/models/eft/game/IGameKeepAliveResponse";
|
||||||
import { IServerDetails } from "../models/eft/game/IServerDetails";
|
import { IGameLogoutResponseData } from "@spt/models/eft/game/IGameLogoutResponseData";
|
||||||
import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData";
|
import { IGameModeRequestData } from "@spt/models/eft/game/IGameModeRequestData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGameModeResponse } from "@spt/models/eft/game/IGameModeResponse";
|
||||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
import { IGameStartResponse } from "@spt/models/eft/game/IGameStartResponse";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IGetRaidTimeRequest } from "@spt/models/eft/game/IGetRaidTimeRequest";
|
||||||
import { Watermark } from "../utils/Watermark";
|
import { IGetRaidTimeResponse } from "@spt/models/eft/game/IGetRaidTimeResponse";
|
||||||
declare class GameCallbacks {
|
import { ISendSurveyOpinionRequest } from "@spt/models/eft/game/ISendSurveyOpinionRequest";
|
||||||
|
import { IServerDetails } from "@spt/models/eft/game/IServerDetails";
|
||||||
|
import { ISurveyResponseData } from "@spt/models/eft/game/ISurveyResponseData";
|
||||||
|
import { IVersionValidateRequestData } from "@spt/models/eft/game/IVersionValidateRequestData";
|
||||||
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
|
import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData";
|
||||||
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
|
import { Watermark } from "@spt/utils/Watermark";
|
||||||
|
export declare class GameCallbacks implements OnLoad {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected watermark: Watermark;
|
protected watermark: Watermark;
|
||||||
|
protected saveServer: SaveServer;
|
||||||
protected gameController: GameController;
|
protected gameController: GameController;
|
||||||
constructor(httpResponse: HttpResponseUtil, watermark: Watermark, gameController: GameController);
|
constructor(httpResponse: HttpResponseUtil, watermark: Watermark, saveServer: SaveServer, gameController: GameController);
|
||||||
|
onLoad(): Promise<void>;
|
||||||
|
getRoute(): string;
|
||||||
/**
|
/**
|
||||||
* Handle client/game/version/validate
|
* Handle client/game/version/validate
|
||||||
* @returns INullResponseData
|
* @returns INullResponseData
|
||||||
@ -30,6 +42,7 @@ declare class GameCallbacks {
|
|||||||
gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameStartResponse>;
|
gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameStartResponse>;
|
||||||
/**
|
/**
|
||||||
* Handle client/game/logout
|
* Handle client/game/logout
|
||||||
|
* Save profiles on game close
|
||||||
* @returns IGameLogoutResponseData
|
* @returns IGameLogoutResponseData
|
||||||
*/
|
*/
|
||||||
gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameLogoutResponseData>;
|
gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameLogoutResponseData>;
|
||||||
@ -38,7 +51,22 @@ declare class GameCallbacks {
|
|||||||
* @returns IGameConfigResponse
|
* @returns IGameConfigResponse
|
||||||
*/
|
*/
|
||||||
getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData<IGameConfigResponse>;
|
getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData<IGameConfigResponse>;
|
||||||
|
/**
|
||||||
|
* Handle client/game/mode
|
||||||
|
* @returns IGameModeResponse
|
||||||
|
*/
|
||||||
|
getGameMode(url: string, info: IGameModeRequestData, sessionID: string): IGetBodyResponseData<IGameModeResponse>;
|
||||||
|
/**
|
||||||
|
* Handle client/server/list
|
||||||
|
*/
|
||||||
getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IServerDetails[]>;
|
getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IServerDetails[]>;
|
||||||
|
/**
|
||||||
|
* Handle client/match/group/current
|
||||||
|
*/
|
||||||
|
getCurrentGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICurrentGroupResponse>;
|
||||||
|
/**
|
||||||
|
* Handle client/checkVersion
|
||||||
|
*/
|
||||||
validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICheckVersionResponse>;
|
validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICheckVersionResponse>;
|
||||||
/**
|
/**
|
||||||
* Handle client/game/keepalive
|
* Handle client/game/keepalive
|
||||||
@ -50,6 +78,29 @@ declare class GameCallbacks {
|
|||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
getVersion(url: string, info: IEmptyRequestData, sessionID: string): string;
|
getVersion(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData;
|
/**
|
||||||
|
* Handle /client/report/send & /client/reports/lobby/send
|
||||||
|
* @returns INullResponseData
|
||||||
|
*/
|
||||||
|
reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData;
|
||||||
|
/**
|
||||||
|
* Handle singleplayer/settings/getRaidTime
|
||||||
|
* @returns string
|
||||||
|
*/
|
||||||
|
getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse;
|
||||||
|
/**
|
||||||
|
* Handle /client/survey
|
||||||
|
* @returns INullResponseData
|
||||||
|
*/
|
||||||
|
getSurvey(url: string, request: IEmptyRequestData, sessionId: string): INullResponseData | IGetBodyResponseData<ISurveyResponseData>;
|
||||||
|
/**
|
||||||
|
* Handle client/survey/view
|
||||||
|
* @returns INullResponseData
|
||||||
|
*/
|
||||||
|
getSurveyView(url: string, request: any, sessionId: string): INullResponseData;
|
||||||
|
/**
|
||||||
|
* Handle client/survey/opinion
|
||||||
|
* @returns INullResponseData
|
||||||
|
*/
|
||||||
|
sendSurveyOpinion(url: string, request: ISendSurveyOpinionRequest, sessionId: string): INullResponseData;
|
||||||
}
|
}
|
||||||
export { GameCallbacks };
|
|
||||||
|
6
types/callbacks/HandbookCallbacks.d.ts
vendored
6
types/callbacks/HandbookCallbacks.d.ts
vendored
@ -1,6 +1,6 @@
|
|||||||
import { HandbookController } from "../controllers/HandbookController";
|
import { HandbookController } from "@spt/controllers/HandbookController";
|
||||||
import { OnLoad } from "../di/OnLoad";
|
import { OnLoad } from "@spt/di/OnLoad";
|
||||||
export declare class HandbookCallbacks extends OnLoad {
|
export declare class HandbookCallbacks implements OnLoad {
|
||||||
protected handbookController: HandbookController;
|
protected handbookController: HandbookController;
|
||||||
constructor(handbookController: HandbookController);
|
constructor(handbookController: HandbookController);
|
||||||
onLoad(): Promise<void>;
|
onLoad(): Promise<void>;
|
||||||
|
24
types/callbacks/HealthCallbacks.d.ts
vendored
24
types/callbacks/HealthCallbacks.d.ts
vendored
@ -1,26 +1,26 @@
|
|||||||
import { HealthController } from "../controllers/HealthController";
|
import { HealthController } from "@spt/controllers/HealthController";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData";
|
import { IHealthTreatmentRequestData } from "@spt/models/eft/health/IHealthTreatmentRequestData";
|
||||||
import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData";
|
import { IOffraidEatRequestData } from "@spt/models/eft/health/IOffraidEatRequestData";
|
||||||
import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData";
|
import { IOffraidHealRequestData } from "@spt/models/eft/health/IOffraidHealRequestData";
|
||||||
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
|
import { IWorkoutData } from "@spt/models/eft/health/IWorkoutData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
export declare class HealthCallbacks {
|
export declare class HealthCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected healthController: HealthController;
|
protected healthController: HealthController;
|
||||||
constructor(httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, healthController: HealthController);
|
constructor(httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, healthController: HealthController);
|
||||||
/**
|
/**
|
||||||
* Custom aki server request found in modules/HealthSynchronizer.cs
|
* Custom spt server request found in modules/QTEPatch.cs
|
||||||
* @param url
|
* @param url
|
||||||
* @param info HealthListener.Instance.CurrentHealth class
|
* @param info HealthListener.Instance.CurrentHealth class
|
||||||
* @param sessionID session id
|
* @param sessionID session id
|
||||||
* @returns empty response, no data sent back to client
|
* @returns empty response, no data sent back to client
|
||||||
*/
|
*/
|
||||||
syncHealth(url: string, info: ISyncHealthRequestData, sessionID: string): IGetBodyResponseData<string>;
|
handleWorkoutEffects(url: string, info: IWorkoutData, sessionID: string): IGetBodyResponseData<string>;
|
||||||
/**
|
/**
|
||||||
* Handle Eat
|
* Handle Eat
|
||||||
* @returns IItemEventRouterResponse
|
* @returns IItemEventRouterResponse
|
||||||
|
118
types/callbacks/HideoutCallbacks.d.ts
vendored
118
types/callbacks/HideoutCallbacks.d.ts
vendored
@ -1,96 +1,90 @@
|
|||||||
import { HideoutController } from "../controllers/HideoutController";
|
import { HideoutController } from "@spt/controllers/HideoutController";
|
||||||
import { OnUpdate } from "../di/OnUpdate";
|
import { OnUpdate } from "@spt/di/OnUpdate";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData";
|
import { IHandleQTEEventRequestData } from "@spt/models/eft/hideout/IHandleQTEEventRequestData";
|
||||||
import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData";
|
import { IHideoutCancelProductionRequestData } from "@spt/models/eft/hideout/IHideoutCancelProductionRequestData";
|
||||||
import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData";
|
import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData";
|
||||||
import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData";
|
import { IHideoutContinuousProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutContinuousProductionStartRequestData";
|
||||||
import { IHideoutTakeItemOutRequestData } from "../models/eft/hideout/IHideoutTakeItemOutRequestData";
|
import { IHideoutDeleteProductionRequestData } from "@spt/models/eft/hideout/IHideoutDeleteProductionRequestData";
|
||||||
import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData";
|
import { IHideoutImproveAreaRequestData } from "@spt/models/eft/hideout/IHideoutImproveAreaRequestData";
|
||||||
import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData";
|
import { IHideoutPutItemInRequestData } from "@spt/models/eft/hideout/IHideoutPutItemInRequestData";
|
||||||
import { IHideoutUpgradeCompleteRequestData } from "../models/eft/hideout/IHideoutUpgradeCompleteRequestData";
|
import { IHideoutScavCaseStartRequestData } from "@spt/models/eft/hideout/IHideoutScavCaseStartRequestData";
|
||||||
import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData";
|
import { IHideoutSingleProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutSingleProductionStartRequestData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IHideoutTakeItemOutRequestData } from "@spt/models/eft/hideout/IHideoutTakeItemOutRequestData";
|
||||||
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
|
import { IHideoutTakeProductionRequestData } from "@spt/models/eft/hideout/IHideoutTakeProductionRequestData";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IHideoutToggleAreaRequestData } from "@spt/models/eft/hideout/IHideoutToggleAreaRequestData";
|
||||||
export declare class HideoutCallbacks extends OnUpdate {
|
import { IHideoutUpgradeCompleteRequestData } from "@spt/models/eft/hideout/IHideoutUpgradeCompleteRequestData";
|
||||||
|
import { IHideoutUpgradeRequestData } from "@spt/models/eft/hideout/IHideoutUpgradeRequestData";
|
||||||
|
import { IRecordShootingRangePoints } from "@spt/models/eft/hideout/IRecordShootingRangePoints";
|
||||||
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
|
import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
export declare class HideoutCallbacks implements OnUpdate {
|
||||||
protected hideoutController: HideoutController;
|
protected hideoutController: HideoutController;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected hideoutConfig: IHideoutConfig;
|
protected hideoutConfig: IHideoutConfig;
|
||||||
constructor(hideoutController: HideoutController, // TODO: delay needed
|
constructor(hideoutController: HideoutController, // TODO: delay needed
|
||||||
configServer: ConfigServer);
|
configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Handle HideoutUpgrade
|
* Handle HideoutUpgrade event
|
||||||
* @param pmcData
|
|
||||||
* @param body
|
|
||||||
* @param sessionID
|
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
|
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle HideoutUpgradeComplete
|
* Handle HideoutUpgradeComplete event
|
||||||
* @param pmcData
|
|
||||||
* @param body
|
|
||||||
* @param sessionID
|
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
|
upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle HideoutPutItemsInAreaSlots
|
* Handle HideoutPutItemsInAreaSlots
|
||||||
* @param pmcData
|
|
||||||
* @param body
|
|
||||||
* @param sessionID
|
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
|
putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle HideoutTakeItemsFromAreaSlots
|
* Handle HideoutTakeItemsFromAreaSlots event
|
||||||
* @param pmcData
|
|
||||||
* @param body
|
|
||||||
* @param sessionID
|
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse;
|
takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle HideoutToggleArea
|
* Handle HideoutToggleArea event
|
||||||
* @param pmcData
|
|
||||||
* @param body
|
|
||||||
* @param sessionID
|
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
|
toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle HideoutSingleProductionStart
|
* Handle HideoutSingleProductionStart event
|
||||||
* @param pmcData
|
|
||||||
* @param body
|
|
||||||
* @param sessionID
|
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle HideoutScavCaseProductionStart
|
* Handle HideoutScavCaseProductionStart event
|
||||||
* @param pmcData
|
|
||||||
* @param body
|
|
||||||
* @param sessionID
|
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse;
|
scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle HideoutContinuousProductionStart
|
* Handle HideoutContinuousProductionStart
|
||||||
* @param pmcData
|
|
||||||
* @param body
|
|
||||||
* @param sessionID
|
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle HideoutTakeProduction
|
* Handle HideoutTakeProduction event
|
||||||
* @param pmcData
|
|
||||||
* @param body
|
|
||||||
* @param sessionID
|
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
|
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle HideoutQuickTimeEvent
|
||||||
|
*/
|
||||||
|
handleQTEEvent(pmcData: IPmcData, request: IHandleQTEEventRequestData, sessionId: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/items/moving - RecordShootingRangePoints
|
||||||
|
*/
|
||||||
|
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;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/items/moving - HideoutCircleOfCultistProductionStart
|
||||||
|
*/
|
||||||
|
circleOfCultistProductionStart(pmcData: IPmcData, request: IHideoutCircleOfCultistProductionStartRequestData, sessionId: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/items/moving - HideoutDeleteProductionCommand
|
||||||
|
*/
|
||||||
|
hideoutDeleteProductionCommand(pmcData: IPmcData, request: IHideoutDeleteProductionRequestData, sessionId: string): IItemEventRouterResponse;
|
||||||
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
||||||
getRoute(): string;
|
getRoute(): string;
|
||||||
}
|
}
|
||||||
|
6
types/callbacks/HttpCallbacks.d.ts
vendored
6
types/callbacks/HttpCallbacks.d.ts
vendored
@ -1,6 +1,6 @@
|
|||||||
import { OnLoad } from "../di/OnLoad";
|
import { OnLoad } from "@spt/di/OnLoad";
|
||||||
import { HttpServer } from "../servers/HttpServer";
|
import { HttpServer } from "@spt/servers/HttpServer";
|
||||||
export declare class HttpCallbacks extends OnLoad {
|
export declare class HttpCallbacks implements OnLoad {
|
||||||
protected httpServer: HttpServer;
|
protected httpServer: HttpServer;
|
||||||
constructor(httpServer: HttpServer);
|
constructor(httpServer: HttpServer);
|
||||||
onLoad(): Promise<void>;
|
onLoad(): Promise<void>;
|
||||||
|
33
types/callbacks/InraidCallbacks.d.ts
vendored
33
types/callbacks/InraidCallbacks.d.ts
vendored
@ -1,8 +1,9 @@
|
|||||||
import { InraidController } from "../controllers/InraidController";
|
import { InraidController } from "@spt/controllers/InraidController";
|
||||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
|
import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData";
|
||||||
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
|
import { IRegisterPlayerRequestData } from "@spt/models/eft/inRaid/IRegisterPlayerRequestData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IScavSaveRequestData } from "@spt/models/eft/inRaid/IScavSaveRequestData";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
/**
|
/**
|
||||||
* Handle client requests
|
* Handle client requests
|
||||||
*/
|
*/
|
||||||
@ -12,6 +13,7 @@ export declare class InraidCallbacks {
|
|||||||
constructor(inraidController: InraidController, httpResponse: HttpResponseUtil);
|
constructor(inraidController: InraidController, httpResponse: HttpResponseUtil);
|
||||||
/**
|
/**
|
||||||
* Handle client/location/getLocalloot
|
* Handle client/location/getLocalloot
|
||||||
|
* Store active map in profile + applicationContext
|
||||||
* @param url
|
* @param url
|
||||||
* @param info register player request
|
* @param info register player request
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
@ -19,31 +21,18 @@ export declare class InraidCallbacks {
|
|||||||
*/
|
*/
|
||||||
registerPlayer(url: string, info: IRegisterPlayerRequestData, sessionID: string): INullResponseData;
|
registerPlayer(url: string, info: IRegisterPlayerRequestData, sessionID: string): INullResponseData;
|
||||||
/**
|
/**
|
||||||
* Handle raid/profile/save
|
* Handle raid/profile/scavsave
|
||||||
* @param url
|
* @param url
|
||||||
* @param info Save progress request
|
* @param info Save progress request
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
* @returns Null http response
|
* @returns Null http response
|
||||||
*/
|
*/
|
||||||
saveProgress(url: string, info: ISaveProgressRequestData, sessionID: string): INullResponseData;
|
saveProgress(url: string, info: IScavSaveRequestData, sessionID: string): INullResponseData;
|
||||||
/**
|
|
||||||
* Handle singleplayer/settings/raid/endstate
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
getRaidEndState(): string;
|
|
||||||
/**
|
/**
|
||||||
* Handle singleplayer/settings/raid/menu
|
* Handle singleplayer/settings/raid/menu
|
||||||
* @returns JSON as string
|
* @returns JSON as string
|
||||||
*/
|
*/
|
||||||
getRaidMenuSettings(): string;
|
getRaidMenuSettings(): string;
|
||||||
/**
|
getTraitorScavHostileChance(url: string, info: IEmptyRequestData, sessionId: string): string;
|
||||||
* Handle singleplayer/settings/weapon/durability
|
getBossConvertSettings(url: string, info: IEmptyRequestData, sessionId: string): string;
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
getWeaponDurability(): string;
|
|
||||||
/**
|
|
||||||
* Handle singleplayer/airdrop/config
|
|
||||||
* @returns JSON as string
|
|
||||||
*/
|
|
||||||
getAirdropConfig(): string;
|
|
||||||
}
|
}
|
||||||
|
28
types/callbacks/InsuranceCallbacks.d.ts
vendored
28
types/callbacks/InsuranceCallbacks.d.ts
vendored
@ -1,16 +1,16 @@
|
|||||||
import { InsuranceController } from "../controllers/InsuranceController";
|
import { InsuranceController } from "@spt/controllers/InsuranceController";
|
||||||
import { OnUpdate } from "../di/OnUpdate";
|
import { OnUpdate } from "@spt/di/OnUpdate";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsuranceCostRequestData";
|
import { IGetInsuranceCostRequestData } from "@spt/models/eft/insurance/IGetInsuranceCostRequestData";
|
||||||
import { IGetInsuranceCostResponseData } from "../models/eft/insurance/IGetInsuranceCostResponseData";
|
import { IGetInsuranceCostResponseData } from "@spt/models/eft/insurance/IGetInsuranceCostResponseData";
|
||||||
import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData";
|
import { IInsureRequestData } from "@spt/models/eft/insurance/IInsureRequestData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
|
import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { InsuranceService } from "../services/InsuranceService";
|
import { InsuranceService } from "@spt/services/InsuranceService";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
export declare class InsuranceCallbacks extends OnUpdate {
|
export declare class InsuranceCallbacks implements OnUpdate {
|
||||||
protected insuranceController: InsuranceController;
|
protected insuranceController: InsuranceController;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
@ -23,7 +23,7 @@ export declare class InsuranceCallbacks extends OnUpdate {
|
|||||||
*/
|
*/
|
||||||
getInsuranceCost(url: string, info: IGetInsuranceCostRequestData, sessionID: string): IGetBodyResponseData<IGetInsuranceCostResponseData>;
|
getInsuranceCost(url: string, info: IGetInsuranceCostRequestData, sessionID: string): IGetBodyResponseData<IGetInsuranceCostResponseData>;
|
||||||
/**
|
/**
|
||||||
* Handle Insure
|
* Handle Insure event
|
||||||
* @returns IItemEventRouterResponse
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
88
types/callbacks/InventoryCallbacks.d.ts
vendored
88
types/callbacks/InventoryCallbacks.d.ts
vendored
@ -1,41 +1,63 @@
|
|||||||
import { InventoryController } from "../controllers/InventoryController";
|
import { InventoryController } from "@spt/controllers/InventoryController";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { QuestController } from "@spt/controllers/QuestController";
|
||||||
import { IInventoryBindRequestData } from "../models/eft/inventory/IInventoryBindRequestData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IInventoryCreateMarkerRequestData } from "../models/eft/inventory/IInventoryCreateMarkerRequestData";
|
import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData";
|
||||||
import { IInventoryDeleteMarkerRequestData } from "../models/eft/inventory/IInventoryDeleteMarkerRequestData";
|
import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData";
|
||||||
import { IInventoryEditMarkerRequestData } from "../models/eft/inventory/IInventoryEditMarkerRequestData";
|
import { IInventoryDeleteMarkerRequestData } from "@spt/models/eft/inventory/IInventoryDeleteMarkerRequestData";
|
||||||
import { IInventoryExamineRequestData } from "../models/eft/inventory/IInventoryExamineRequestData";
|
import { IInventoryEditMarkerRequestData } from "@spt/models/eft/inventory/IInventoryEditMarkerRequestData";
|
||||||
import { IInventoryFoldRequestData } from "../models/eft/inventory/IInventoryFoldRequestData";
|
import { IInventoryExamineRequestData } from "@spt/models/eft/inventory/IInventoryExamineRequestData";
|
||||||
import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData";
|
import { IInventoryFoldRequestData } from "@spt/models/eft/inventory/IInventoryFoldRequestData";
|
||||||
import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData";
|
import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData";
|
||||||
import { IInventoryReadEncyclopediaRequestData } from "../models/eft/inventory/IInventoryReadEncyclopediaRequestData";
|
import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData";
|
||||||
import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData";
|
import { IInventoryReadEncyclopediaRequestData } from "@spt/models/eft/inventory/IInventoryReadEncyclopediaRequestData";
|
||||||
import { IInventorySortRequestData } from "../models/eft/inventory/IInventorySortRequestData";
|
import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData";
|
||||||
import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData";
|
import { IInventorySortRequestData } from "@spt/models/eft/inventory/IInventorySortRequestData";
|
||||||
import { IInventorySwapRequestData } from "../models/eft/inventory/IInventorySwapRequestData";
|
import { IInventorySplitRequestData } from "@spt/models/eft/inventory/IInventorySplitRequestData";
|
||||||
import { IInventoryTagRequestData } from "../models/eft/inventory/IInventoryTagRequestData";
|
import { IInventorySwapRequestData } from "@spt/models/eft/inventory/IInventorySwapRequestData";
|
||||||
import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryToggleRequestData";
|
import { IInventoryTagRequestData } from "@spt/models/eft/inventory/IInventoryTagRequestData";
|
||||||
import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData";
|
import { IInventoryToggleRequestData } from "@spt/models/eft/inventory/IInventoryToggleRequestData";
|
||||||
import { IOpenRandomLootContainerRequestData } from "../models/eft/inventory/IOpenRandomLootContainerRequestData";
|
import { IInventoryTransferRequestData } from "@spt/models/eft/inventory/IInventoryTransferRequestData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IOpenRandomLootContainerRequestData } from "@spt/models/eft/inventory/IOpenRandomLootContainerRequestData";
|
||||||
|
import { IPinOrLockItemRequest } from "@spt/models/eft/inventory/IPinOrLockItemRequest";
|
||||||
|
import { IRedeemProfileRequestData } from "@spt/models/eft/inventory/IRedeemProfileRequestData";
|
||||||
|
import { ISetFavoriteItems } from "@spt/models/eft/inventory/ISetFavoriteItems";
|
||||||
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
|
import { IFailQuestRequestData } from "@spt/models/eft/quests/IFailQuestRequestData";
|
||||||
export declare class InventoryCallbacks {
|
export declare class InventoryCallbacks {
|
||||||
protected inventoryController: InventoryController;
|
protected inventoryController: InventoryController;
|
||||||
constructor(inventoryController: InventoryController);
|
protected questController: QuestController;
|
||||||
moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
|
constructor(inventoryController: InventoryController, questController: QuestController);
|
||||||
removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse;
|
/** Handle client/game/profile/items/moving Move event */
|
||||||
splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;
|
moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse;
|
/** Handle Remove event */
|
||||||
transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse;
|
removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
|
/** Handle Split event */
|
||||||
|
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;
|
swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
|
foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
|
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
|
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): 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;
|
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse;
|
/** Handle ApplyInventoryChanges */
|
||||||
createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
|
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
|
/** Handle OpenRandomLootContainer */
|
||||||
|
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;
|
||||||
|
pinOrLock(pmcData: IPmcData, request: IPinOrLockItemRequest, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
20
types/callbacks/ItemEventCallbacks.d.ts
vendored
20
types/callbacks/ItemEventCallbacks.d.ts
vendored
@ -1,13 +1,19 @@
|
|||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { Warning } from "../models/eft/itemEvent/IItemEventRouterBase";
|
import { Warning } from "@spt/models/eft/itemEvent/IItemEventRouterBase";
|
||||||
import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest";
|
import { IItemEventRouterRequest } from "@spt/models/eft/itemEvent/IItemEventRouterRequest";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
import { ItemEventRouter } from "@spt/routers/ItemEventRouter";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
export declare class ItemEventCallbacks {
|
export declare class ItemEventCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected itemEventRouter: ItemEventRouter;
|
protected itemEventRouter: ItemEventRouter;
|
||||||
constructor(httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter);
|
constructor(httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter);
|
||||||
handleEvents(url: string, info: IItemEventRouterRequest, sessionID: string): IGetBodyResponseData<IItemEventRouterResponse>;
|
handleEvents(url: string, info: IItemEventRouterRequest, sessionID: string): Promise<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;
|
protected getErrorCode(warnings: Warning[]): number;
|
||||||
}
|
}
|
||||||
|
23
types/callbacks/LauncherCallbacks.d.ts
vendored
23
types/callbacks/LauncherCallbacks.d.ts
vendored
@ -1,13 +1,13 @@
|
|||||||
import { LauncherController } from "../controllers/LauncherController";
|
import { LauncherController } from "@spt/controllers/LauncherController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData";
|
import { IChangeRequestData } from "@spt/models/eft/launcher/IChangeRequestData";
|
||||||
import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData";
|
import { ILoginRequestData } from "@spt/models/eft/launcher/ILoginRequestData";
|
||||||
import { IRegisterData } from "../models/eft/launcher/IRegisterData";
|
import { IRegisterData } from "@spt/models/eft/launcher/IRegisterData";
|
||||||
import { IRemoveProfileData } from "../models/eft/launcher/IRemoveProfileData";
|
import { IRemoveProfileData } from "@spt/models/eft/launcher/IRemoveProfileData";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
import { Watermark } from "../utils/Watermark";
|
import { Watermark } from "@spt/utils/Watermark";
|
||||||
declare class LauncherCallbacks {
|
export declare class LauncherCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected launcherController: LauncherController;
|
protected launcherController: LauncherController;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
@ -24,5 +24,6 @@ declare class LauncherCallbacks {
|
|||||||
ping(url: string, info: IEmptyRequestData, sessionID: string): string;
|
ping(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string;
|
removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string;
|
||||||
getCompatibleTarkovVersion(): string;
|
getCompatibleTarkovVersion(): string;
|
||||||
|
getLoadedServerMods(): string;
|
||||||
|
getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string;
|
||||||
}
|
}
|
||||||
export { LauncherCallbacks };
|
|
||||||
|
19
types/callbacks/LocationCallbacks.d.ts
vendored
19
types/callbacks/LocationCallbacks.d.ts
vendored
@ -1,15 +1,16 @@
|
|||||||
import { LocationController } from "../controllers/LocationController";
|
import { LocationController } from "@spt/controllers/LocationController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
import { ILocationsGenerateAllResponse } from "@spt/models/eft/common/ILocationsSourceDestinationBase";
|
||||||
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetAirdropLootRequest } from "@spt/models/eft/location/IGetAirdropLootRequest";
|
||||||
import { IGetLocationRequestData } from "../models/eft/location/IGetLocationRequestData";
|
import { IGetAirdropLootResponse } from "@spt/models/eft/location/IGetAirdropLootResponse";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
export declare class LocationCallbacks {
|
export declare class LocationCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected locationController: LocationController;
|
protected locationController: LocationController;
|
||||||
constructor(httpResponse: HttpResponseUtil, locationController: LocationController);
|
constructor(httpResponse: HttpResponseUtil, locationController: LocationController);
|
||||||
|
/** Handle client/locations */
|
||||||
getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILocationsGenerateAllResponse>;
|
getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILocationsGenerateAllResponse>;
|
||||||
getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData<ILocationBase>;
|
/** Handle client/airdrop/loot */
|
||||||
getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): string;
|
getAirdropLoot(url: string, info: IGetAirdropLootRequest, sessionID: string): IGetBodyResponseData<IGetAirdropLootResponse>;
|
||||||
}
|
}
|
||||||
|
99
types/callbacks/MatchCallbacks.d.ts
vendored
99
types/callbacks/MatchCallbacks.d.ts
vendored
@ -1,46 +1,81 @@
|
|||||||
import { MatchController } from "../controllers/MatchController";
|
import { MatchController } from "@spt/controllers/MatchController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IMetrics } from "@spt/models/eft/common/tables/IMatch";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData";
|
||||||
import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData";
|
import { IEndLocalRaidRequestData } from "@spt/models/eft/match/IEndLocalRaidRequestData";
|
||||||
import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData";
|
import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData";
|
||||||
import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData";
|
import { IGroupCharacter } from "@spt/models/eft/match/IGroupCharacter";
|
||||||
import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData";
|
import { IMatchGroupCurrentResponse } from "@spt/models/eft/match/IMatchGroupCurrentResponse";
|
||||||
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
|
import { IMatchGroupInviteSendRequest } from "@spt/models/eft/match/IMatchGroupInviteSendRequest";
|
||||||
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
|
import { IMatchGroupPlayerRemoveRequest } from "@spt/models/eft/match/IMatchGroupPlayerRemoveRequest";
|
||||||
import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData";
|
import { IMatchGroupStartGameRequest } from "@spt/models/eft/match/IMatchGroupStartGameRequest";
|
||||||
import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData";
|
import { IMatchGroupStatusRequest } from "@spt/models/eft/match/IMatchGroupStatusRequest";
|
||||||
import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData";
|
import { IMatchGroupStatusResponse } from "@spt/models/eft/match/IMatchGroupStatusResponse";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IMatchGroupTransferRequest } from "@spt/models/eft/match/IMatchGroupTransferRequest";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResponse";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData";
|
||||||
|
import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest";
|
||||||
|
import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData";
|
||||||
|
import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData";
|
||||||
|
import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
|
import { JsonUtil } from "@spt/utils/JsonUtil";
|
||||||
export declare class MatchCallbacks {
|
export declare class MatchCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
protected matchController: MatchController;
|
protected matchController: MatchController;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer);
|
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseService: DatabaseService);
|
||||||
|
/** Handle client/match/updatePing */
|
||||||
updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData;
|
updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData;
|
||||||
exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||||
|
/** Handle client/match/group/exit_from_menu */
|
||||||
exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||||
|
groupCurrent(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IMatchGroupCurrentResponse>;
|
||||||
startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||||
stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||||
sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData;
|
/** Handle client/match/group/invite/send */
|
||||||
acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData;
|
sendGroupInvite(url: string, info: IMatchGroupInviteSendRequest, sessionID: string): IGetBodyResponseData<string>;
|
||||||
cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData;
|
/** Handle client/match/group/invite/accept */
|
||||||
putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData;
|
acceptGroupInvite(url: string, info: IRequestIdRequest, sessionId: string): IGetBodyResponseData<IGroupCharacter[]>;
|
||||||
getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
/** Handle client/match/group/invite/decline */
|
||||||
serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any> | IGetBodyResponseData<true>;
|
declineGroupInvite(url: string, info: IRequestIdRequest, sessionId: string): IGetBodyResponseData<boolean>;
|
||||||
joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData<IJoinMatchResult[]>;
|
/** Handle client/match/group/invite/cancel */
|
||||||
getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<string>;
|
cancelGroupInvite(url: string, info: IRequestIdRequest, sessionID: string): IGetBodyResponseData<boolean>;
|
||||||
|
/** Handle client/match/group/transfer */
|
||||||
|
transferGroup(url: string, info: IMatchGroupTransferRequest, sessionId: string): IGetBodyResponseData<boolean>;
|
||||||
|
/** Handle client/match/group/invite/cancel-all */
|
||||||
|
cancelAllGroupInvite(url: string, info: IEmptyRequestData, sessionId: string): IGetBodyResponseData<boolean>;
|
||||||
|
putMetrics(url: string, request: IPutMetricsRequestData, sessionId: string): INullResponseData;
|
||||||
|
eventDisconnect(url: string, request: IPutMetricsRequestData, sessionId: string): INullResponseData;
|
||||||
|
serverAvailable(url: string, info: IEmptyRequestData, sessionId: string): IGetBodyResponseData<boolean>;
|
||||||
|
/** Handle match/group/start_game */
|
||||||
|
joinMatch(url: string, info: IMatchGroupStartGameRequest, sessionID: string): IGetBodyResponseData<IProfileStatusResponse>;
|
||||||
|
/** Handle client/getMetricsConfig */
|
||||||
|
getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<IMetrics>;
|
||||||
/**
|
/**
|
||||||
|
* Called periodically while in a group
|
||||||
* Handle client/match/group/status
|
* Handle client/match/group/status
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<any>;
|
getGroupStatus(url: string, info: IMatchGroupStatusRequest, sessionID: string): IGetBodyResponseData<IMatchGroupStatusResponse>;
|
||||||
createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData<any>;
|
/** Handle client/match/group/delete */
|
||||||
deleteGroup(url: string, info: any, sessionID: string): INullResponseData;
|
deleteGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||||
startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData;
|
leaveGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||||
endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData;
|
/** Handle client/match/group/player/remove */
|
||||||
|
removePlayerFromGroup(url: string, info: IMatchGroupPlayerRemoveRequest, sessionID: string): IGetBodyResponseData<boolean>;
|
||||||
|
/** Handle client/match/local/start */
|
||||||
|
startLocalRaid(url: string, info: IStartLocalRaidRequestData, sessionID: string): IGetBodyResponseData<IStartLocalRaidResponseData>;
|
||||||
|
/** Handle client/match/local/end */
|
||||||
|
endLocalRaid(url: string, info: IEndLocalRaidRequestData, 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;
|
||||||
|
/** Handle client/match/group/raid/ready */
|
||||||
|
raidReady(url: string, info: IEmptyRequestData, sessionId: string): IGetBodyResponseData<boolean>;
|
||||||
|
/** Handle client/match/group/raid/not-ready */
|
||||||
|
notRaidReady(url: string, info: IEmptyRequestData, sessionId: string): IGetBodyResponseData<boolean>;
|
||||||
}
|
}
|
||||||
|
26
types/callbacks/ModCallbacks.d.ts
vendored
26
types/callbacks/ModCallbacks.d.ts
vendored
@ -1,24 +1,20 @@
|
|||||||
import { OnLoad } from "../di/OnLoad";
|
import { OnLoad } from "@spt/di/OnLoad";
|
||||||
import { PostAkiModLoader } from "../loaders/PostAkiModLoader";
|
import { PostSptModLoader } from "@spt/loaders/PostSptModLoader";
|
||||||
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
|
import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
import { HttpFileUtil } from "../utils/HttpFileUtil";
|
import { HttpFileUtil } from "@spt/utils/HttpFileUtil";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
declare class ModCallbacks extends OnLoad {
|
export declare class ModCallbacks implements OnLoad {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected httpFileUtil: HttpFileUtil;
|
protected httpFileUtil: HttpFileUtil;
|
||||||
protected postAkiModLoader: PostAkiModLoader;
|
protected postSptModLoader: PostSptModLoader;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected httpConfig: IHttpConfig;
|
protected httpConfig: IHttpConfig;
|
||||||
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, localisationService: LocalisationService, configServer: ConfigServer);
|
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postSptModLoader: PostSptModLoader, localisationService: LocalisationService, configServer: ConfigServer);
|
||||||
onLoad(): Promise<void>;
|
onLoad(): Promise<void>;
|
||||||
getRoute(): string;
|
getRoute(): string;
|
||||||
sendBundle(sessionID: string, req: any, resp: any, body: any): void;
|
|
||||||
getBundles(url: string, info: any, sessionID: string): string;
|
|
||||||
getBundle(url: string, info: any, sessionID: string): string;
|
|
||||||
}
|
}
|
||||||
export { ModCallbacks };
|
|
||||||
|
11
types/callbacks/NoteCallbacks.d.ts
vendored
11
types/callbacks/NoteCallbacks.d.ts
vendored
@ -1,11 +1,14 @@
|
|||||||
import { NoteController } from "../controllers/NoteController";
|
import { NoteController } from "@spt/controllers/NoteController";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { INoteActionData } from "../models/eft/notes/INoteActionData";
|
import { INoteActionData } from "@spt/models/eft/notes/INoteActionData";
|
||||||
export declare class NoteCallbacks {
|
export declare class NoteCallbacks {
|
||||||
protected noteController: NoteController;
|
protected noteController: NoteController;
|
||||||
constructor(noteController: NoteController);
|
constructor(noteController: NoteController);
|
||||||
|
/** Handle AddNote event */
|
||||||
addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle EditNote event */
|
||||||
editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle DeleteNote event */
|
||||||
deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
25
types/callbacks/NotifierCallbacks.d.ts
vendored
25
types/callbacks/NotifierCallbacks.d.ts
vendored
@ -1,16 +1,18 @@
|
|||||||
import { NotifierController } from "../controllers/NotifierController";
|
import { NotifierController } from "@spt/controllers/NotifierController";
|
||||||
import { HttpServerHelper } from "../helpers/HttpServerHelper";
|
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IUIDRequestData } from "@spt/models/eft/common/request/IUIDRequestData";
|
||||||
import { INotifierChannel } from "../models/eft/notifier/INotifier";
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData";
|
import { INotifierChannel } from "@spt/models/eft/notifier/INotifier";
|
||||||
import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse";
|
import { ISelectProfileResponse } from "@spt/models/eft/notifier/ISelectProfileResponse";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
|
import { JsonUtil } from "@spt/utils/JsonUtil";
|
||||||
export declare class NotifierCallbacks {
|
export declare class NotifierCallbacks {
|
||||||
protected httpServerHelper: HttpServerHelper;
|
protected httpServerHelper: HttpServerHelper;
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
|
protected jsonUtil: JsonUtil;
|
||||||
protected notifierController: NotifierController;
|
protected notifierController: NotifierController;
|
||||||
constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController);
|
constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController);
|
||||||
/**
|
/**
|
||||||
* If we don't have anything to send, it's ok to not send anything back
|
* If we don't have anything to send, it's ok to not send anything back
|
||||||
* because notification requests can be long-polling. In fact, we SHOULD wait
|
* because notification requests can be long-polling. In fact, we SHOULD wait
|
||||||
@ -18,12 +20,15 @@ export declare class NotifierCallbacks {
|
|||||||
* and the client would abort the connection due to spam.
|
* and the client would abort the connection due to spam.
|
||||||
*/
|
*/
|
||||||
sendNotification(sessionID: string, req: any, resp: any, data: any): void;
|
sendNotification(sessionID: string, req: any, resp: any, data: any): void;
|
||||||
|
/** Handle push/notifier/get */
|
||||||
|
/** Handle push/notifier/getwebsocket */
|
||||||
getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData<any[]>;
|
getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData<any[]>;
|
||||||
|
/** Handle client/notifier/channel/create */
|
||||||
createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<INotifierChannel>;
|
createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<INotifierChannel>;
|
||||||
/**
|
/**
|
||||||
* Handle client/game/profile/select
|
* Handle client/game/profile/select
|
||||||
* @returns ISelectProfileResponse
|
* @returns ISelectProfileResponse
|
||||||
*/
|
*/
|
||||||
selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData<ISelectProfileResponse>;
|
selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData<ISelectProfileResponse>;
|
||||||
notify(url: string, info: any, sessionID: string): string;
|
notify(url: string, info: any, sessionID: string): string;
|
||||||
}
|
}
|
||||||
|
16
types/callbacks/PresetBuildCallbacks.d.ts
vendored
16
types/callbacks/PresetBuildCallbacks.d.ts
vendored
@ -1,16 +0,0 @@
|
|||||||
import { PresetBuildController } from "../controllers/PresetBuildController";
|
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
|
||||||
import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData";
|
|
||||||
import { WeaponBuild } from "../models/eft/profile/IAkiProfile";
|
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
|
||||||
export declare class PresetBuildCallbacks {
|
|
||||||
protected httpResponse: HttpResponseUtil;
|
|
||||||
protected presetBuildController: PresetBuildController;
|
|
||||||
constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController);
|
|
||||||
getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<WeaponBuild[]>;
|
|
||||||
saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
}
|
|
6
types/callbacks/PresetCallbacks.d.ts
vendored
6
types/callbacks/PresetCallbacks.d.ts
vendored
@ -1,6 +1,6 @@
|
|||||||
import { PresetController } from "../controllers/PresetController";
|
import { PresetController } from "@spt/controllers/PresetController";
|
||||||
import { OnLoad } from "../di/OnLoad";
|
import { OnLoad } from "@spt/di/OnLoad";
|
||||||
export declare class PresetCallbacks extends OnLoad {
|
export declare class PresetCallbacks implements OnLoad {
|
||||||
protected presetController: PresetController;
|
protected presetController: PresetController;
|
||||||
constructor(presetController: PresetController);
|
constructor(presetController: PresetController);
|
||||||
onLoad(): Promise<void>;
|
onLoad(): Promise<void>;
|
||||||
|
90
types/callbacks/ProfileCallbacks.d.ts
vendored
90
types/callbacks/ProfileCallbacks.d.ts
vendored
@ -1,34 +1,41 @@
|
|||||||
import { ProfileController } from "../controllers/ProfileController";
|
import { ProfileController } from "@spt/controllers/ProfileController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IGetMiniProfileRequestData } from "../models/eft/launcher/IGetMiniProfileRequestData";
|
import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData";
|
||||||
import { GetProfileStatusResponseData } from "../models/eft/profile/GetProfileStatusResponseData";
|
import { IGetMiniProfileRequestData } from "@spt/models/eft/launcher/IGetMiniProfileRequestData";
|
||||||
import { IProfileChangeNicknameRequestData } from "../models/eft/profile/IProfileChangeNicknameRequestData";
|
import { IGetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData";
|
||||||
import { IProfileChangeVoiceRequestData } from "../models/eft/profile/IProfileChangeVoiceRequestData";
|
import { ICreateProfileResponse } from "@spt/models/eft/profile/ICreateProfileResponse";
|
||||||
import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateRequestData";
|
import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest";
|
||||||
import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData";
|
import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse";
|
||||||
import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse";
|
import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest";
|
||||||
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
|
import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData";
|
||||||
|
import { ISearchFriendRequestData } from "@spt/models/eft/profile/ISearchFriendRequestData";
|
||||||
|
import { ISearchFriendResponse } from "@spt/models/eft/profile/ISearchFriendResponse";
|
||||||
|
import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
/** Handle profile related client events */
|
/** Handle profile related client events */
|
||||||
export declare class ProfileCallbacks {
|
export declare class ProfileCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected profileController: ProfileController;
|
protected profileController: ProfileController;
|
||||||
constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, profileController: ProfileController);
|
protected profileHelper: ProfileHelper;
|
||||||
createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<any>;
|
constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, profileController: ProfileController, profileHelper: ProfileHelper);
|
||||||
/**
|
/**
|
||||||
|
* Handle client/game/profile/create
|
||||||
|
*/
|
||||||
|
createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<ICreateProfileResponse>;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/list
|
||||||
* Get the complete player profile (scav + pmc character)
|
* Get the complete player profile (scav + pmc character)
|
||||||
* @param url
|
|
||||||
* @param info Empty
|
|
||||||
* @param sessionID Session id
|
|
||||||
* @returns Profile object
|
|
||||||
*/
|
*/
|
||||||
getProfileData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
getProfileData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
||||||
/**
|
/**
|
||||||
|
* Handle client/game/profile/savage/regenerate
|
||||||
* Handle the creation of a scav profile for player
|
* Handle the creation of a scav profile for player
|
||||||
* Occurs post-raid and when profile first created immediately after character details are confirmed by player
|
* Occurs post-raid and when profile first created immediately after character details are confirmed by player
|
||||||
* @param url
|
* @param url
|
||||||
@ -39,32 +46,45 @@ export declare class ProfileCallbacks {
|
|||||||
regenerateScav(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
regenerateScav(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
||||||
/**
|
/**
|
||||||
* Handle client/game/profile/voice/change event
|
* Handle client/game/profile/voice/change event
|
||||||
* @param url
|
|
||||||
* @param info Change voice request object
|
|
||||||
* @param sessionID Session id
|
|
||||||
* @returns Client response
|
|
||||||
*/
|
*/
|
||||||
changeVoice(url: string, info: IProfileChangeVoiceRequestData, sessionID: string): INullResponseData;
|
changeVoice(url: string, info: IProfileChangeVoiceRequestData, sessionID: string): INullResponseData;
|
||||||
/**
|
/**
|
||||||
* Handle client/game/profile/nickname/change event
|
* Handle client/game/profile/nickname/change event
|
||||||
* Client allows player to adjust their profile name
|
* Client allows player to adjust their profile name
|
||||||
* @param url
|
|
||||||
* @param info Change nickname request object
|
|
||||||
* @param sessionID Session id
|
|
||||||
* @returns client response
|
|
||||||
*/
|
*/
|
||||||
changeNickname(url: string, info: IProfileChangeNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
changeNickname(url: string, info: IProfileChangeNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/nickname/validate
|
||||||
|
*/
|
||||||
validateNickname(url: string, info: IValidateNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
validateNickname(url: string, info: IValidateNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/nickname/reserved
|
||||||
|
*/
|
||||||
getReservedNickname(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
getReservedNickname(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
||||||
/**
|
/**
|
||||||
|
* Handle client/profile/status
|
||||||
* Called when creating a character when choosing a character face/voice
|
* Called when creating a character when choosing a character face/voice
|
||||||
* @param url
|
|
||||||
* @param info response (empty)
|
|
||||||
* @param sessionID
|
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
getProfileStatus(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<GetProfileStatusResponseData>;
|
getProfileStatus(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetProfileStatusResponseData>;
|
||||||
|
/**
|
||||||
|
* Handle client/profile/view
|
||||||
|
* Called when viewing another players profile
|
||||||
|
*/
|
||||||
|
getOtherProfile(url: string, request: IGetOtherProfileRequest, sessionID: string): IGetBodyResponseData<IGetOtherProfileResponse>;
|
||||||
|
/**
|
||||||
|
* Handle client/profile/settings
|
||||||
|
*/
|
||||||
|
getProfileSettings(url: string, info: IGetProfileSettingsRequest, sessionId: string): IGetBodyResponseData<boolean>;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/search
|
||||||
|
*/
|
||||||
searchFriend(url: string, info: ISearchFriendRequestData, sessionID: string): IGetBodyResponseData<ISearchFriendResponse[]>;
|
searchFriend(url: string, info: ISearchFriendRequestData, sessionID: string): IGetBodyResponseData<ISearchFriendResponse[]>;
|
||||||
|
/**
|
||||||
|
* Handle launcher/profile/info
|
||||||
|
*/
|
||||||
getMiniProfile(url: string, info: IGetMiniProfileRequestData, sessionID: string): string;
|
getMiniProfile(url: string, info: IGetMiniProfileRequestData, sessionID: string): string;
|
||||||
getAllMiniProfiles(url: string, info: any, sessionID: string): string;
|
/**
|
||||||
|
* Handle /launcher/profiles
|
||||||
|
*/
|
||||||
|
getAllMiniProfiles(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
}
|
}
|
||||||
|
47
types/callbacks/QuestCallbacks.d.ts
vendored
47
types/callbacks/QuestCallbacks.d.ts
vendored
@ -1,33 +1,44 @@
|
|||||||
import { QuestController } from "../controllers/QuestController";
|
import { QuestController } from "@spt/controllers/QuestController";
|
||||||
import { RepeatableQuestController } from "../controllers/RepeatableQuestController";
|
import { RepeatableQuestController } from "@spt/controllers/RepeatableQuestController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IQuest } from "../models/eft/common/tables/IQuest";
|
import { IQuest } from "@spt/models/eft/common/tables/IQuest";
|
||||||
import { IPmcDataRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
|
import { IPmcDataRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
|
import { IAcceptQuestRequestData } from "@spt/models/eft/quests/IAcceptQuestRequestData";
|
||||||
import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData";
|
import { ICompleteQuestRequestData } from "@spt/models/eft/quests/ICompleteQuestRequestData";
|
||||||
import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData";
|
import { IHandoverQuestRequestData } from "@spt/models/eft/quests/IHandoverQuestRequestData";
|
||||||
import { IListQuestsRequestData } from "../models/eft/quests/IListQuestsRequestData";
|
import { IListQuestsRequestData } from "@spt/models/eft/quests/IListQuestsRequestData";
|
||||||
import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest";
|
import { IRepeatableQuestChangeRequest } from "@spt/models/eft/quests/IRepeatableQuestChangeRequest";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
export declare class QuestCallbacks {
|
export declare class QuestCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected questController: QuestController;
|
protected questController: QuestController;
|
||||||
protected repeatableQuestController: RepeatableQuestController;
|
protected repeatableQuestController: RepeatableQuestController;
|
||||||
constructor(httpResponse: HttpResponseUtil, questController: QuestController, repeatableQuestController: RepeatableQuestController);
|
constructor(httpResponse: HttpResponseUtil, questController: QuestController, repeatableQuestController: RepeatableQuestController);
|
||||||
|
/**
|
||||||
|
* Handle RepeatableQuestChange event
|
||||||
|
*/
|
||||||
changeRepeatableQuest(pmcData: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
|
changeRepeatableQuest(pmcData: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle QuestAccept event
|
||||||
|
*/
|
||||||
acceptQuest(pmcData: IPmcData, body: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
acceptQuest(pmcData: IPmcData, body: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle QuestComplete event
|
||||||
|
*/
|
||||||
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle QuestHandover event
|
||||||
|
*/
|
||||||
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handle client/quest/list
|
* Handle client/quest/list
|
||||||
* @param url
|
|
||||||
* @param info
|
|
||||||
* @param sessionID
|
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
listQuests(url: string, info: IListQuestsRequestData, sessionID: string): IGetBodyResponseData<IQuest[]>;
|
listQuests(url: string, info: IListQuestsRequestData, sessionID: string): IGetBodyResponseData<IQuest[]>;
|
||||||
|
/**
|
||||||
|
* Handle client/repeatalbeQuests/activityPeriods
|
||||||
|
*/
|
||||||
activityPeriods(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcDataRepeatableQuest[]>;
|
activityPeriods(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcDataRepeatableQuest[]>;
|
||||||
}
|
}
|
||||||
|
78
types/callbacks/RagfairCallbacks.d.ts
vendored
78
types/callbacks/RagfairCallbacks.d.ts
vendored
@ -1,42 +1,62 @@
|
|||||||
import { RagfairController } from "../controllers/RagfairController";
|
import { RagfairController } from "@spt/controllers/RagfairController";
|
||||||
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate";
|
import { OnLoad } from "@spt/di/OnLoad";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { OnUpdate } from "@spt/di/OnUpdate";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData";
|
||||||
import { IAddOfferRequestData } from "../models/eft/ragfair/IAddOfferRequestData";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IExtendOfferRequestData } from "../models/eft/ragfair/IExtendOfferRequestData";
|
import { IAddOfferRequestData } from "@spt/models/eft/ragfair/IAddOfferRequestData";
|
||||||
import { IGetItemPriceResult } from "../models/eft/ragfair/IGetItemPriceResult";
|
import { IExtendOfferRequestData } from "@spt/models/eft/ragfair/IExtendOfferRequestData";
|
||||||
import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPriceRequestData";
|
import { IGetItemPriceResult } from "@spt/models/eft/ragfair/IGetItemPriceResult";
|
||||||
import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
|
import { IGetMarketPriceRequestData } from "@spt/models/eft/ragfair/IGetMarketPriceRequestData";
|
||||||
import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData";
|
import { IGetOffersResult } from "@spt/models/eft/ragfair/IGetOffersResult";
|
||||||
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
|
import { IGetRagfairOfferByIdRequest } from "@spt/models/eft/ragfair/IGetRagfairOfferByIdRequest";
|
||||||
import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData";
|
import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer";
|
||||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
import { IRemoveOfferRequestData } from "@spt/models/eft/ragfair/IRemoveOfferRequestData";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData";
|
||||||
import { RagfairServer } from "../servers/RagfairServer";
|
import { ISendRagfairReportRequestData } from "@spt/models/eft/ragfair/ISendRagfairReportRequestData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IStorePlayerOfferTaxAmountRequestData } from "@spt/models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { RagfairServer } from "@spt/servers/RagfairServer";
|
||||||
|
import { RagfairTaxService } from "@spt/services/RagfairTaxService";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
/**
|
/**
|
||||||
* Handle ragfair related callback events
|
* Handle ragfair related callback events
|
||||||
*/
|
*/
|
||||||
export declare class RagfairCallbacks extends OnLoadOnUpdate {
|
export declare class RagfairCallbacks implements OnLoad, OnUpdate {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected jsonUtil: JsonUtil;
|
|
||||||
protected ragfairServer: RagfairServer;
|
protected ragfairServer: RagfairServer;
|
||||||
protected ragfairController: RagfairController;
|
protected ragfairController: RagfairController;
|
||||||
|
protected ragfairTaxService: RagfairTaxService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer);
|
constructor(httpResponse: HttpResponseUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, ragfairTaxService: RagfairTaxService, configServer: ConfigServer);
|
||||||
onLoad(): Promise<void>;
|
onLoad(): Promise<void>;
|
||||||
getRoute(): string;
|
getRoute(): string;
|
||||||
search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData<IGetOffersResult>;
|
|
||||||
getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData<IGetItemPriceResult>;
|
|
||||||
getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>>;
|
|
||||||
addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
||||||
|
/**
|
||||||
|
* Handle client/ragfair/search
|
||||||
|
* Handle client/ragfair/find
|
||||||
|
*/
|
||||||
|
search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData<IGetOffersResult>;
|
||||||
|
/** Handle client/ragfair/itemMarketPrice */
|
||||||
|
getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData<IGetItemPriceResult>;
|
||||||
|
/** Handle RagFairAddOffer event */
|
||||||
|
addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle RagFairRemoveOffer event */
|
||||||
|
removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle RagFairRenewOffer event */
|
||||||
|
extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle /client/items/prices
|
||||||
|
* Called when clicking an item to list on flea
|
||||||
|
*/
|
||||||
|
getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>>;
|
||||||
|
/** Handle client/reports/ragfair/send */
|
||||||
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
|
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
|
||||||
|
storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData;
|
||||||
|
/** Handle client/ragfair/offer/findbyid */
|
||||||
|
getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData<IRagfairOffer>;
|
||||||
}
|
}
|
||||||
|
32
types/callbacks/RepairCallbacks.d.ts
vendored
32
types/callbacks/RepairCallbacks.d.ts
vendored
@ -1,25 +1,27 @@
|
|||||||
import { RepairController } from "../controllers/RepairController";
|
import { RepairController } from "@spt/controllers/RepairController";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionDataRequest";
|
import { IRepairActionDataRequest } from "@spt/models/eft/repair/IRepairActionDataRequest";
|
||||||
import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest";
|
import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRepairActionDataRequest";
|
||||||
export declare class RepairCallbacks {
|
export declare class RepairCallbacks {
|
||||||
protected repairController: RepairController;
|
protected repairController: RepairController;
|
||||||
constructor(repairController: RepairController);
|
constructor(repairController: RepairController);
|
||||||
/**
|
/**
|
||||||
|
* Handle TraderRepair event
|
||||||
* use trader to repair item
|
* use trader to repair item
|
||||||
* @param pmcData
|
* @param pmcData Player profile
|
||||||
* @param body
|
* @param traderRepairRequest Request object
|
||||||
* @param sessionID
|
* @param sessionID Session id
|
||||||
* @returns
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
traderRepair(pmcData: IPmcData, body: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
|
traderRepair(pmcData: IPmcData, traderRepairRequest: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle Repair event
|
||||||
* Use repair kit to repair item
|
* Use repair kit to repair item
|
||||||
* @param pmcData
|
* @param pmcData Player profile
|
||||||
* @param body
|
* @param repairRequest Request object
|
||||||
* @param sessionID
|
* @param sessionID Session id
|
||||||
* @returns
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
repair(pmcData: IPmcData, body: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
|
repair(pmcData: IPmcData, repairRequest: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
13
types/callbacks/SaveCallbacks.d.ts
vendored
13
types/callbacks/SaveCallbacks.d.ts
vendored
@ -1,8 +1,13 @@
|
|||||||
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate";
|
import { OnLoad } from "@spt/di/OnLoad";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { OnUpdate } from "@spt/di/OnUpdate";
|
||||||
export declare class SaveCallbacks extends OnLoadOnUpdate {
|
import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
|
export declare class SaveCallbacks implements OnLoad, OnUpdate {
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
constructor(saveServer: SaveServer);
|
protected configServer: ConfigServer;
|
||||||
|
protected coreConfig: ICoreConfig;
|
||||||
|
constructor(saveServer: SaveServer, configServer: ConfigServer);
|
||||||
onLoad(): Promise<void>;
|
onLoad(): Promise<void>;
|
||||||
getRoute(): string;
|
getRoute(): string;
|
||||||
onUpdate(secondsSinceLastRun: number): Promise<boolean>;
|
onUpdate(secondsSinceLastRun: number): Promise<boolean>;
|
||||||
|
17
types/callbacks/TradeCallbacks.d.ts
vendored
17
types/callbacks/TradeCallbacks.d.ts
vendored
@ -1,11 +1,18 @@
|
|||||||
import { TradeController } from "../controllers/TradeController";
|
import { TradeController } from "@spt/controllers/TradeController";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
|
import { IProcessBaseTradeRequestData } from "@spt/models/eft/trade/IProcessBaseTradeRequestData";
|
||||||
import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
|
import { IProcessRagfairTradeRequestData } from "@spt/models/eft/trade/IProcessRagfairTradeRequestData";
|
||||||
|
import { ISellScavItemsToFenceRequestData } from "@spt/models/eft/trade/ISellScavItemsToFenceRequestData";
|
||||||
export declare class TradeCallbacks {
|
export declare class TradeCallbacks {
|
||||||
protected tradeController: TradeController;
|
protected tradeController: TradeController;
|
||||||
constructor(tradeController: TradeController);
|
constructor(tradeController: TradeController);
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/items/moving TradingConfirm event
|
||||||
|
*/
|
||||||
processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle RagFairBuyOffer event */
|
||||||
processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle SellAllFromSavage event */
|
||||||
|
sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
31
types/callbacks/TraderCallbacks.d.ts
vendored
31
types/callbacks/TraderCallbacks.d.ts
vendored
@ -1,22 +1,27 @@
|
|||||||
import { TraderController } from "../controllers/TraderController";
|
import { TraderController } from "@spt/controllers/TraderController";
|
||||||
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate";
|
import { OnLoad } from "@spt/di/OnLoad";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { OnUpdate } from "@spt/di/OnUpdate";
|
||||||
import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrader";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
export declare class TraderCallbacks extends OnLoadOnUpdate {
|
import { IModdedTraders } from "@spt/models/spt/config/ITraderConfig";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
|
export declare class TraderCallbacks implements OnLoad, OnUpdate {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected traderController: TraderController;
|
protected traderController: TraderController;
|
||||||
constructor(httpResponse: HttpResponseUtil, traderController: TraderController);
|
protected configServer: ConfigServer;
|
||||||
|
constructor(httpResponse: HttpResponseUtil, // TODO: delay required
|
||||||
|
traderController: TraderController, configServer: ConfigServer);
|
||||||
onLoad(): Promise<void>;
|
onLoad(): Promise<void>;
|
||||||
onUpdate(): Promise<boolean>;
|
onUpdate(): Promise<boolean>;
|
||||||
getRoute(): string;
|
getRoute(): string;
|
||||||
|
/** Handle client/trading/api/traderSettings */
|
||||||
getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]>;
|
getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]>;
|
||||||
/**
|
/** Handle client/trading/api/getTrader */
|
||||||
* Handle client/trading/api/getUserAssortPrice/trader
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, IBarterScheme[][]>>;
|
|
||||||
getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase>;
|
getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase>;
|
||||||
|
/** Handle client/trading/api/getTraderAssort */
|
||||||
getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>;
|
getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>;
|
||||||
|
/** Handle /singleplayer/moddedTraders */
|
||||||
|
getModdedTraderData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IModdedTraders>;
|
||||||
}
|
}
|
||||||
|
13
types/callbacks/WeatherCallbacks.d.ts
vendored
13
types/callbacks/WeatherCallbacks.d.ts
vendored
@ -1,8 +1,9 @@
|
|||||||
import { WeatherController } from "../controllers/WeatherController";
|
import { WeatherController } from "@spt/controllers/WeatherController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { IWeatherData } from "../models/eft/weather/IWeatherData";
|
import { IWeatherData } from "@spt/models/eft/weather/IWeatherData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IGetLocalWeatherResponseData } from "@spt/models/spt/weather/IGetLocalWeatherResponseData";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
export declare class WeatherCallbacks {
|
export declare class WeatherCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected weatherController: WeatherController;
|
protected weatherController: WeatherController;
|
||||||
@ -12,4 +13,6 @@ export declare class WeatherCallbacks {
|
|||||||
* @returns IWeatherData
|
* @returns IWeatherData
|
||||||
*/
|
*/
|
||||||
getWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IWeatherData>;
|
getWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IWeatherData>;
|
||||||
|
/** Handle client/localGame/weather */
|
||||||
|
getLocalWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetLocalWeatherResponseData>;
|
||||||
}
|
}
|
||||||
|
18
types/callbacks/WishlistCallbacks.d.ts
vendored
18
types/callbacks/WishlistCallbacks.d.ts
vendored
@ -1,10 +1,16 @@
|
|||||||
import { WishlistController } from "../controllers/WishlistController";
|
import { WishlistController } from "@spt/controllers/WishlistController";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData";
|
import { IAddToWishlistRequest } from "@spt/models/eft/wishlist/IAddToWishlistRequest";
|
||||||
|
import { IChangeWishlistItemCategoryRequest } from "@spt/models/eft/wishlist/IChangeWishlistItemCategoryRequest";
|
||||||
|
import { IRemoveFromWishlistRequest } from "@spt/models/eft/wishlist/IRemoveFromWishlistRequest";
|
||||||
export declare class WishlistCallbacks {
|
export declare class WishlistCallbacks {
|
||||||
protected wishlistController: WishlistController;
|
protected wishlistController: WishlistController;
|
||||||
constructor(wishlistController: WishlistController);
|
constructor(wishlistController: WishlistController);
|
||||||
addToWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
/** Handle AddToWishList event */
|
||||||
removeFromWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
addToWishlist(pmcData: IPmcData, request: IAddToWishlistRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle RemoveFromWishList event */
|
||||||
|
removeFromWishlist(pmcData: IPmcData, request: IRemoveFromWishlistRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle ChangeWishlistItemCategory */
|
||||||
|
changeWishlistItemCategory(pmcData: IPmcData, request: IChangeWishlistItemCategoryRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
18
types/context/ApplicationContext.d.ts
vendored
18
types/context/ApplicationContext.d.ts
vendored
@ -1,18 +1,20 @@
|
|||||||
import { ContextVariable } from "./ContextVariable";
|
import { ContextVariable } from "@spt/context/ContextVariable";
|
||||||
import { ContextVariableType } from "./ContextVariableType";
|
import { ContextVariableType } from "@spt/context/ContextVariableType";
|
||||||
export declare class ApplicationContext {
|
export declare class ApplicationContext {
|
||||||
private variables;
|
private variables;
|
||||||
private static holderMaxSize;
|
private static holderMaxSize;
|
||||||
/**
|
/**
|
||||||
* Called like:
|
* Called like:
|
||||||
*
|
* ```
|
||||||
* const registerPlayerInfo = this.applicationContext.getLatestValue(ContextVariableType.REGISTER_PLAYER_REQUEST).getValue<IRegisterPlayerRequestData>();
|
* const registerPlayerInfo = this.applicationContext.getLatestValue(ContextVariableType.REGISTER_PLAYER_REQUEST).getValue<IRegisterPlayerRequestData>();
|
||||||
*
|
*
|
||||||
* const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.MATCH_INFO).getValue<IStartOfflineRaidRequestData>();
|
* const activePlayerSessionId = this.applicationContext.getLatestValue(ContextVariableType.SESSION_ID).getValue<string>();
|
||||||
* @param type
|
*
|
||||||
* @returns
|
* const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION).getValue<IGetRaidConfigurationRequestData>();
|
||||||
|
* ```
|
||||||
*/
|
*/
|
||||||
getLatestValue(type: ContextVariableType): ContextVariable;
|
getLatestValue(type: ContextVariableType): ContextVariable | undefined;
|
||||||
getValues(type: ContextVariableType): ContextVariable[];
|
getValues(type: ContextVariableType): ContextVariable[] | undefined;
|
||||||
addValue(type: ContextVariableType, value: any): void;
|
addValue(type: ContextVariableType, value: any): void;
|
||||||
|
clearValues(type: ContextVariableType): void;
|
||||||
}
|
}
|
||||||
|
2
types/context/ContextVariable.d.ts
vendored
2
types/context/ContextVariable.d.ts
vendored
@ -1,4 +1,4 @@
|
|||||||
import { ContextVariableType } from "./ContextVariableType";
|
import { ContextVariableType } from "@spt/context/ContextVariableType";
|
||||||
export declare class ContextVariable {
|
export declare class ContextVariable {
|
||||||
private value;
|
private value;
|
||||||
private timestamp;
|
private timestamp;
|
||||||
|
9
types/context/ContextVariableType.d.ts
vendored
9
types/context/ContextVariableType.d.ts
vendored
@ -2,9 +2,12 @@ export declare enum ContextVariableType {
|
|||||||
/** Logged in users session id */
|
/** Logged in users session id */
|
||||||
SESSION_ID = 0,
|
SESSION_ID = 0,
|
||||||
/** Currently acive raid information */
|
/** Currently acive raid information */
|
||||||
MATCH_INFO = 1,
|
RAID_CONFIGURATION = 1,
|
||||||
/** Timestamp when client first connected */
|
/** SessionID + Timestamp when client first connected, has _ between values */
|
||||||
CLIENT_START_TIMESTAMP = 2,
|
CLIENT_START_TIMESTAMP = 2,
|
||||||
/** When player is loading into map and loot is requested */
|
/** When player is loading into map and loot is requested */
|
||||||
REGISTER_PLAYER_REQUEST = 3
|
REGISTER_PLAYER_REQUEST = 3,
|
||||||
|
RAID_ADJUSTMENTS = 4,
|
||||||
|
/** Data returned from client request object from endLocalRaid() */
|
||||||
|
TRANSIT_INFO = 5
|
||||||
}
|
}
|
||||||
|
23
types/controllers/AchievementController.d.ts
vendored
Normal file
23
types/controllers/AchievementController.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { ICompletedAchievementsResponse } from "@spt/models/eft/profile/ICompletedAchievementsResponse";
|
||||||
|
import { IGetAchievementsResponse } from "@spt/models/eft/profile/IGetAchievementsResponse";
|
||||||
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
/**
|
||||||
|
* Logic for handling In Raid callbacks
|
||||||
|
*/
|
||||||
|
export declare class AchievementController {
|
||||||
|
protected logger: ILogger;
|
||||||
|
protected databaseService: DatabaseService;
|
||||||
|
constructor(logger: ILogger, databaseService: DatabaseService);
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
139
types/controllers/BotController.d.ts
vendored
139
types/controllers/BotController.d.ts
vendored
@ -1,64 +1,136 @@
|
|||||||
import { ApplicationContext } from "../context/ApplicationContext";
|
import { ApplicationContext } from "@spt/context/ApplicationContext";
|
||||||
import { BotGenerator } from "../generators/BotGenerator";
|
import { BotGenerator } from "@spt/generators/BotGenerator";
|
||||||
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
|
import { BotDifficultyHelper } from "@spt/helpers/BotDifficultyHelper";
|
||||||
import { BotHelper } from "../helpers/BotHelper";
|
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper";
|
||||||
import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData";
|
import { MinMax } from "@spt/models/common/MinMax";
|
||||||
import { IBotBase } from "../models/eft/common/tables/IBotBase";
|
import { ICondition, IGenerateBotsRequestData } from "@spt/models/eft/bot/IGenerateBotsRequestData";
|
||||||
import { IBotCore } from "../models/eft/common/tables/IBotCore";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { Difficulty } from "../models/eft/common/tables/IBotType";
|
import { IBotBase } from "@spt/models/eft/common/tables/IBotBase";
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { IBotCore } from "@spt/models/eft/common/tables/IBotCore";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IDifficultyCategories } from "@spt/models/eft/common/tables/IBotType";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails";
|
||||||
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
|
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService";
|
||||||
|
import { SeasonalEventService } from "@spt/services/SeasonalEventService";
|
||||||
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
export declare class BotController {
|
export declare class BotController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected botGenerator: BotGenerator;
|
protected botGenerator: BotGenerator;
|
||||||
protected botHelper: BotHelper;
|
protected botHelper: BotHelper;
|
||||||
protected botDifficultyHelper: BotDifficultyHelper;
|
protected botDifficultyHelper: BotDifficultyHelper;
|
||||||
protected botGenerationCacheService: BotGenerationCacheService;
|
|
||||||
protected localisationService: LocalisationService;
|
|
||||||
protected weightedRandomHelper: WeightedRandomHelper;
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
|
protected botGenerationCacheService: BotGenerationCacheService;
|
||||||
|
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
||||||
|
protected localisationService: LocalisationService;
|
||||||
|
protected seasonalEventService: SeasonalEventService;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected applicationContext: ApplicationContext;
|
protected applicationContext: ApplicationContext;
|
||||||
protected jsonUtil: JsonUtil;
|
protected randomUtil: RandomUtil;
|
||||||
|
protected cloner: ICloner;
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
static readonly pmcTypeLabel = "PMC";
|
protected pmcConfig: IPmcConfig;
|
||||||
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
|
constructor(logger: ILogger, databaseService: DatabaseService, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, weightedRandomHelper: WeightedRandomHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, randomUtil: RandomUtil, cloner: ICloner);
|
||||||
/**
|
/**
|
||||||
* Return the number of bot loadout varieties to be generated
|
* Return the number of bot load-out varieties to be generated
|
||||||
* @param type bot Type we want the loadout gen count for
|
* @param type bot Type we want the load-out gen count for
|
||||||
* @returns number of bots to generate
|
* @returns number of bots to generate
|
||||||
*/
|
*/
|
||||||
getBotPresetGenerationLimit(type: string): number;
|
getBotPresetGenerationLimit(type: string): number;
|
||||||
/**
|
/**
|
||||||
* Get the core.json difficulty settings from database\bots
|
* Handle singleplayer/settings/bot/difficulty
|
||||||
|
* Get the core.json difficulty settings from database/bots
|
||||||
* @returns IBotCore
|
* @returns IBotCore
|
||||||
*/
|
*/
|
||||||
getBotCoreDifficulty(): IBotCore;
|
getBotCoreDifficulty(): IBotCore;
|
||||||
/**
|
/**
|
||||||
* Get bot difficulty settings
|
* Get bot difficulty settings
|
||||||
* adjust PMC settings to ensure they engage the correct bot types
|
* Adjust PMC settings to ensure they engage the correct bot types
|
||||||
* @param type what bot the server is requesting settings for
|
* @param type what bot the server is requesting settings for
|
||||||
* @param difficulty difficulty level server requested settings for
|
* @param diffLevel difficulty level server requested settings for
|
||||||
|
* @param raidConfig OPTIONAL - applicationContext Data stored at start of raid
|
||||||
|
* @param ignoreRaidSettings should raid settings chosen pre-raid be ignored
|
||||||
* @returns Difficulty object
|
* @returns Difficulty object
|
||||||
*/
|
*/
|
||||||
getBotDifficulty(type: string, difficulty: string): Difficulty;
|
getBotDifficulty(type: string, diffLevel: string, raidConfig?: IGetRaidConfigurationRequestData, ignoreRaidSettings?: boolean): IDifficultyCategories;
|
||||||
|
getAllBotDifficulties(): Record<string, any>;
|
||||||
/**
|
/**
|
||||||
* Generate bot profiles and store in cache
|
* Generate bot profiles and store in cache
|
||||||
* @param sessionId Session id
|
* @param sessionId Session id
|
||||||
* @param info bot generation request info
|
* @param info bot generation request info
|
||||||
* @returns IBotBase array
|
* @returns IBotBase array
|
||||||
*/
|
*/
|
||||||
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
|
generate(sessionId: string, info: IGenerateBotsRequestData): Promise<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 IBotBase[]
|
||||||
|
*/
|
||||||
|
protected generateMultipleBotsAndCache(request: IGenerateBotsRequestData, pmcProfile: IPmcData, sessionId: string): Promise<IBotBase[]>;
|
||||||
|
protected getMostRecentRaidSettings(): IGetRaidConfigurationRequestData;
|
||||||
|
/**
|
||||||
|
* Get min/max level range values for a specific map
|
||||||
|
* @param location Map name e.g. factory4_day
|
||||||
|
* @returns MinMax
|
||||||
|
*/
|
||||||
|
protected getPmcLevelRangeForMap(location: string): MinMax;
|
||||||
|
/**
|
||||||
|
* Create a BotGenerationDetails for the bot generator to use
|
||||||
|
* @param condition Client data defining bot type and difficulty
|
||||||
|
* @param pmcProfile Player who is generating bots
|
||||||
|
* @param allPmcsHaveSameNameAsPlayer Should all PMCs have same name as player
|
||||||
|
* @param raidSettings Settings chosen pre-raid by player
|
||||||
|
* @param botCountToGenerate How many bots to generate
|
||||||
|
* @param generateAsPmc Force bot being generated a PMC
|
||||||
|
* @returns BotGenerationDetails
|
||||||
|
*/
|
||||||
|
protected getBotGenerationDetailsForWave(condition: ICondition, pmcProfile: IPmcData, allPmcsHaveSameNameAsPlayer: boolean, raidSettings: IGetRaidConfigurationRequestData, botCountToGenerate: number, generateAsPmc: boolean): IBotGenerationDetails;
|
||||||
|
/**
|
||||||
|
* Get players profile level
|
||||||
|
* @param pmcProfile Profile to get level from
|
||||||
|
* @returns Level as number
|
||||||
|
*/
|
||||||
|
protected getPlayerLevelFromProfile(pmcProfile: IPmcData): number;
|
||||||
|
/**
|
||||||
|
* Generate many bots and store then on the cache
|
||||||
|
* @param condition the condition details to generate the bots with
|
||||||
|
* @param botGenerationDetails the bot details to generate the bot with
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @returns A promise for the bots to be done generating
|
||||||
|
*/
|
||||||
|
protected generateWithBotDetails(condition: ICondition, botGenerationDetails: IBotGenerationDetails, sessionId: string): Promise<void>;
|
||||||
|
/**
|
||||||
|
* Generate a single bot and store in the cache
|
||||||
|
* @param botGenerationDetails the bot details to generate the bot with
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param cacheKey the cache key to store the bot with
|
||||||
|
* @returns A promise for the bot to be stored
|
||||||
|
*/
|
||||||
|
protected generateSingleBotAndStoreInCache(botGenerationDetails: IBotGenerationDetails, sessionId: string, cacheKey: string): Promise<void>;
|
||||||
|
/**
|
||||||
|
* 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): Promise<IBotBase[]>;
|
||||||
|
protected getPmcConversionMinMaxForLocation(requestedBotRole: string, location: string): MinMax;
|
||||||
|
protected updateBotGenerationDetailsToRandomBoss(botGenerationDetails: IBotGenerationDetails, possibleBossTypeWeights: Record<string, number>): void;
|
||||||
|
/**
|
||||||
|
* Get the difficulty passed in, if its not "asonline", get selected difficulty from config
|
||||||
* @param requestedDifficulty
|
* @param requestedDifficulty
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
@ -66,8 +138,9 @@ export declare class BotController {
|
|||||||
/**
|
/**
|
||||||
* Get the max number of bots allowed on a map
|
* Get the max number of bots allowed on a map
|
||||||
* Looks up location player is entering when getting cap value
|
* Looks up location player is entering when getting cap value
|
||||||
|
* @param location The map location cap was requested for
|
||||||
* @returns cap number
|
* @returns cap number
|
||||||
*/
|
*/
|
||||||
getBotCap(): number;
|
getBotCap(location: string): number;
|
||||||
getPmcBotTypes(): Record<string, Record<string, Record<string, number>>>;
|
getAiBotBrainTypes(): any;
|
||||||
}
|
}
|
||||||
|
38
types/controllers/BuildController.d.ts
vendored
Normal file
38
types/controllers/BuildController.d.ts
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
|
import { ISetMagazineRequest } from "@spt/models/eft/builds/ISetMagazineRequest";
|
||||||
|
import { IPresetBuildActionRequestData } from "@spt/models/eft/presetBuild/IPresetBuildActionRequestData";
|
||||||
|
import { IRemoveBuildRequestData } from "@spt/models/eft/presetBuild/IRemoveBuildRequestData";
|
||||||
|
import { IUserBuilds } from "@spt/models/eft/profile/ISptProfile";
|
||||||
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
|
||||||
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
|
export declare class BuildController {
|
||||||
|
protected logger: ILogger;
|
||||||
|
protected hashUtil: HashUtil;
|
||||||
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
|
protected databaseService: DatabaseService;
|
||||||
|
protected profileHelper: ProfileHelper;
|
||||||
|
protected localisationService: LocalisationService;
|
||||||
|
protected itemHelper: ItemHelper;
|
||||||
|
protected saveServer: SaveServer;
|
||||||
|
protected cloner: ICloner;
|
||||||
|
constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, profileHelper: ProfileHelper, localisationService: LocalisationService, itemHelper: ItemHelper, saveServer: SaveServer, cloner: ICloner);
|
||||||
|
/** 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(idToRemove: string, sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Handle client/builds/magazine/save
|
||||||
|
*/
|
||||||
|
createMagazineTemplate(sessionId: string, request: ISetMagazineRequest): void;
|
||||||
|
}
|
10
types/controllers/ClientLogController.d.ts
vendored
Normal file
10
types/controllers/ClientLogController.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { IClientLogRequest } from "@spt/models/spt/logging/IClientLogRequest";
|
||||||
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
export declare class ClientLogController {
|
||||||
|
protected logger: ILogger;
|
||||||
|
constructor(logger: ILogger);
|
||||||
|
/**
|
||||||
|
* Handle /singleplayer/log
|
||||||
|
*/
|
||||||
|
clientLog(logRequest: IClientLogRequest): void;
|
||||||
|
}
|
76
types/controllers/CustomizationController.d.ts
vendored
76
types/controllers/CustomizationController.d.ts
vendored
@ -1,24 +1,70 @@
|
|||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { ISuit } from "../models/eft/common/tables/ITrader";
|
import { ISuit } from "@spt/models/eft/common/tables/ITrader";
|
||||||
import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothingRequestData";
|
import { IBuyClothingRequestData, IPaymentItemForClothing } from "@spt/models/eft/customization/IBuyClothingRequestData";
|
||||||
import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData";
|
import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClothingRequestData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
export declare class CustomizationController {
|
export declare class CustomizationController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper);
|
protected readonly clothingIds: {
|
||||||
|
lowerParentId: string;
|
||||||
|
upperParentId: string;
|
||||||
|
};
|
||||||
|
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper);
|
||||||
|
/**
|
||||||
|
* Get purchasable clothing items from trader that match players side (usec/bear)
|
||||||
|
* @param traderID trader to look up clothing for
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns ISuit array
|
||||||
|
*/
|
||||||
getTraderSuits(traderID: string, sessionID: string): ISuit[];
|
getTraderSuits(traderID: string, sessionID: string): ISuit[];
|
||||||
wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
/**
|
||||||
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
* Handle CustomizationWear event
|
||||||
|
* Equip one to many clothing items to player
|
||||||
|
*/
|
||||||
|
wearClothing(pmcData: IPmcData, wearClothingRequest: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle CustomizationBuy event
|
||||||
|
* Purchase/unlock a clothing item from a trader
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param buyClothingRequest Request object
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
buyClothing(pmcData: IPmcData, buyClothingRequest: IBuyClothingRequestData, sessionId: string): IItemEventRouterResponse;
|
||||||
|
protected getTraderClothingOffer(sessionId: string, offerId: string): ISuit;
|
||||||
|
/**
|
||||||
|
* Has an outfit been purchased by a player
|
||||||
|
* @param suitId clothing id
|
||||||
|
* @param sessionID Session id of profile to check for clothing in
|
||||||
|
* @returns true if already purchased
|
||||||
|
*/
|
||||||
|
protected outfitAlreadyPurchased(suitId: string, sessionID: string): boolean;
|
||||||
|
/**
|
||||||
|
* Update output object and player profile with purchase details
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param itemsToPayForClothingWith Clothing purchased
|
||||||
|
* @param output Client response
|
||||||
|
*/
|
||||||
|
protected payForClothingItems(sessionId: string, pmcData: IPmcData, itemsToPayForClothingWith: IPaymentItemForClothing[], output: IItemEventRouterResponse): void;
|
||||||
|
/**
|
||||||
|
* Update output object and player profile with purchase details for single piece of clothing
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param paymentItemDetails Payment details
|
||||||
|
* @param output Client response
|
||||||
|
*/
|
||||||
|
protected payForClothingItem(sessionId: string, pmcData: IPmcData, paymentItemDetails: IPaymentItemForClothing, output: IItemEventRouterResponse): void;
|
||||||
protected getAllTraderSuits(sessionID: string): ISuit[];
|
protected getAllTraderSuits(sessionID: string): ISuit[];
|
||||||
}
|
}
|
||||||
|
129
types/controllers/DialogueController.d.ts
vendored
129
types/controllers/DialogueController.d.ts
vendored
@ -1,40 +1,85 @@
|
|||||||
import { DialogueHelper } from "../helpers/DialogueHelper";
|
import { IDialogueChatBot } from "@spt/helpers/Dialogue/IDialogueChatBot";
|
||||||
import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse";
|
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
|
||||||
import { IGetFriendListDataResponse } from "../models/eft/dialog/IGetFriendListDataResponse";
|
import { IFriendRequestData } from "@spt/models/eft/dialog/IFriendRequestData";
|
||||||
import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDialogViewResponseData";
|
import { IFriendRequestSendResponse } from "@spt/models/eft/dialog/IFriendRequestSendResponse";
|
||||||
import { DialogueInfo, Message } from "../models/eft/profile/IAkiProfile";
|
import { IGetAllAttachmentsResponse } from "@spt/models/eft/dialog/IGetAllAttachmentsResponse";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { IGetFriendListDataResponse } from "@spt/models/eft/dialog/IGetFriendListDataResponse";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { IGetMailDialogViewRequestData } from "@spt/models/eft/dialog/IGetMailDialogViewRequestData";
|
||||||
|
import { IGetMailDialogViewResponseData } from "@spt/models/eft/dialog/IGetMailDialogViewResponseData";
|
||||||
|
import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest";
|
||||||
|
import { IDialogue, IDialogueInfo, IMessage, ISptProfile, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile";
|
||||||
|
import { MessageType } from "@spt/models/enums/MessageType";
|
||||||
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { MailSendService } from "@spt/services/MailSendService";
|
||||||
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
export declare class DialogueController {
|
export declare class DialogueController {
|
||||||
|
protected logger: ILogger;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected dialogueHelper: DialogueHelper;
|
protected dialogueHelper: DialogueHelper;
|
||||||
constructor(saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper);
|
protected mailSendService: MailSendService;
|
||||||
|
protected localisationService: LocalisationService;
|
||||||
|
protected configServer: ConfigServer;
|
||||||
|
protected dialogueChatBots: IDialogueChatBot[];
|
||||||
|
constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, localisationService: LocalisationService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]);
|
||||||
|
registerChatBot(chatBot: IDialogueChatBot): void;
|
||||||
|
/** Handle onUpdate spt event */
|
||||||
update(): void;
|
update(): void;
|
||||||
|
/**
|
||||||
|
* Handle client/friend/list
|
||||||
|
* @returns IGetFriendListDataResponse
|
||||||
|
*/
|
||||||
getFriendList(sessionID: string): IGetFriendListDataResponse;
|
getFriendList(sessionID: string): IGetFriendListDataResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle client/mail/dialog/list
|
||||||
* Create array holding trader dialogs and mail interactions with player
|
* Create array holding trader dialogs and mail interactions with player
|
||||||
* Set the content of the dialogue on the list tab.
|
* Set the content of the dialogue on the list tab.
|
||||||
* @param sessionID Session Id
|
* @param sessionID Session Id
|
||||||
* @returns array of dialogs
|
* @returns array of dialogs
|
||||||
*/
|
*/
|
||||||
generateDialogueList(sessionID: string): DialogueInfo[];
|
generateDialogueList(sessionID: string): IDialogueInfo[];
|
||||||
/**
|
/**
|
||||||
* Get the content of a dialogue
|
* Get the content of a dialogue
|
||||||
* @param dialogueID Dialog id
|
* @param dialogueID Dialog id
|
||||||
* @param sessionID Session Id
|
* @param sessionID Session Id
|
||||||
* @returns DialogueInfo
|
* @returns DialogueInfo
|
||||||
*/
|
*/
|
||||||
getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo;
|
getDialogueInfo(dialogueID: string, sessionID: string): IDialogueInfo;
|
||||||
/**
|
/**
|
||||||
|
* Get the users involved in a dialog (player + other party)
|
||||||
|
* @param dialog The dialog to check for users
|
||||||
|
* @param messageType What type of message is being sent
|
||||||
|
* @param sessionID Player id
|
||||||
|
* @returns IUserDialogInfo array
|
||||||
|
*/
|
||||||
|
getDialogueUsers(dialog: IDialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined;
|
||||||
|
/**
|
||||||
|
* Handle client/mail/dialog/view
|
||||||
* Handle player clicking 'messenger' and seeing all the messages they've recieved
|
* Handle player clicking 'messenger' and seeing all the messages they've recieved
|
||||||
* Set the content of the dialogue on the details panel, showing all the messages
|
* Set the content of the dialogue on the details panel, showing all the messages
|
||||||
* for the specified dialogue.
|
* for the specified dialogue.
|
||||||
* @param dialogueID Dialog id
|
* @param request Get dialog request
|
||||||
* @param sessionID Session id
|
* @param sessionId Session id
|
||||||
* @returns IGetMailDialogViewResponseData object
|
* @returns IGetMailDialogViewResponseData object
|
||||||
*/
|
*/
|
||||||
generateDialogueView(dialogueID: string, sessionID: string): IGetMailDialogViewResponseData;
|
generateDialogueView(request: IGetMailDialogViewRequestData, sessionId: string): IGetMailDialogViewResponseData;
|
||||||
|
/**
|
||||||
|
* Get dialog from player profile, create if doesn't exist
|
||||||
|
* @param profile Player profile
|
||||||
|
* @param request get dialog request (params used when dialog doesnt exist in profile)
|
||||||
|
* @returns Dialogue
|
||||||
|
*/
|
||||||
|
protected getDialogByIdFromProfile(profile: ISptProfile, request: IGetMailDialogViewRequestData): IDialogue;
|
||||||
|
/**
|
||||||
|
* Get the users involved in a mail between two entities
|
||||||
|
* @param fullProfile Player profile
|
||||||
|
* @param dialogUsers The participants of the mail
|
||||||
|
* @returns IUserDialogInfo array
|
||||||
|
*/
|
||||||
|
protected getProfilesForMail(fullProfile: ISptProfile, dialogUsers?: IUserDialogInfo[]): IUserDialogInfo[];
|
||||||
/**
|
/**
|
||||||
* Get a count of messages with attachments from a particular dialog
|
* Get a count of messages with attachments from a particular dialog
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
@ -47,33 +92,63 @@ export declare class DialogueController {
|
|||||||
* @param messages Messages to check
|
* @param messages Messages to check
|
||||||
* @returns true if uncollected rewards found
|
* @returns true if uncollected rewards found
|
||||||
*/
|
*/
|
||||||
protected messagesHaveUncollectedRewards(messages: Message[]): boolean;
|
protected messagesHaveUncollectedRewards(messages: IMessage[]): boolean;
|
||||||
removeDialogue(dialogueID: string, sessionID: string): void;
|
|
||||||
setDialoguePin(dialogueID: string, shouldPin: boolean, sessionID: string): void;
|
|
||||||
setRead(dialogueIDs: string[], sessionID: string): void;
|
|
||||||
/**
|
/**
|
||||||
* Get all uncollected items attached to mail in a particular dialog
|
* Handle client/mail/dialog/remove
|
||||||
* @param dialogueID Dialog to get mail attachments from
|
* Remove an entire dialog with an entity (trader/user)
|
||||||
* @param sessionID Session id
|
* @param dialogueId id of the dialog to remove
|
||||||
* @returns
|
* @param sessionId Player id
|
||||||
*/
|
*/
|
||||||
getAllAttachments(dialogueID: string, sessionID: string): IGetAllAttachmentsResponse;
|
removeDialogue(dialogueId: string, sessionId: string): void;
|
||||||
|
/** Handle client/mail/dialog/pin && Handle client/mail/dialog/unpin */
|
||||||
|
setDialoguePin(dialogueId: string, shouldPin: boolean, sessionId: string): void;
|
||||||
|
/**
|
||||||
|
* Handle client/mail/dialog/read
|
||||||
|
* Set a dialog to be read (no number alert/attachment alert)
|
||||||
|
* @param dialogueIds Dialog ids to set as read
|
||||||
|
* @param sessionId Player profile id
|
||||||
|
*/
|
||||||
|
setRead(dialogueIds: string[], sessionId: string): void;
|
||||||
|
/**
|
||||||
|
* Handle client/mail/dialog/getAllAttachments
|
||||||
|
* Get all uncollected items attached to mail in a particular dialog
|
||||||
|
* @param dialogueId Dialog to get mail attachments from
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @returns IGetAllAttachmentsResponse
|
||||||
|
*/
|
||||||
|
getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse | undefined;
|
||||||
|
/** client/mail/msg/send */
|
||||||
|
sendMessage(sessionId: string, request: ISendMessageRequest): string;
|
||||||
/**
|
/**
|
||||||
* Get messages from a specific dialog that have items not expired
|
* Get messages from a specific dialog that have items not expired
|
||||||
* @param sessionId Session id
|
* @param sessionId Session id
|
||||||
* @param dialogueId Dialog to get mail attachments from
|
* @param dialogueId Dialog to get mail attachments from
|
||||||
* @returns Message array
|
* @returns Message array
|
||||||
*/
|
*/
|
||||||
protected getActiveMessagesFromDialog(sessionId: string, dialogueId: string): Message[];
|
protected getActiveMessagesFromDialog(sessionId: string, dialogueId: string): IMessage[];
|
||||||
/**
|
/**
|
||||||
* Return array of messages with uncollected items (includes expired)
|
* Return array of messages with uncollected items (includes expired)
|
||||||
* @param messages Messages to parse
|
* @param messages Messages to parse
|
||||||
* @returns messages with items to collect
|
* @returns messages with items to collect
|
||||||
*/
|
*/
|
||||||
protected getMessagesWithAttachments(messages: Message[]): Message[];
|
protected getMessagesWithAttachments(messages: IMessage[]): IMessage[];
|
||||||
/**
|
/**
|
||||||
* Delete expired items. triggers when updating traders.
|
* Delete expired items from all messages in player profile. triggers when updating traders.
|
||||||
* @param sessionID Session id
|
* @param sessionId Session id
|
||||||
*/
|
*/
|
||||||
protected removeExpiredItems(sessionID: string): void;
|
protected removeExpiredItemsFromMessages(sessionId: string): void;
|
||||||
|
/**
|
||||||
|
* Removes expired items from a message in player profile
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param dialogueId Dialog id
|
||||||
|
*/
|
||||||
|
protected removeExpiredItemsFromMessage(sessionId: string, dialogueId: string): void;
|
||||||
|
/**
|
||||||
|
* Has a dialog message expired
|
||||||
|
* @param message Message to check expiry of
|
||||||
|
* @returns true or false
|
||||||
|
*/
|
||||||
|
protected messageHasExpired(message: IMessage): boolean;
|
||||||
|
/** Handle client/friend/request/send */
|
||||||
|
sendFriendRequest(sessionID: string, request: IFriendRequestData): IFriendRequestSendResponse;
|
||||||
}
|
}
|
||||||
|
147
types/controllers/GameController.d.ts
vendored
147
types/controllers/GameController.d.ts
vendored
@ -1,56 +1,137 @@
|
|||||||
import { ApplicationContext } from "../context/ApplicationContext";
|
import { ApplicationContext } from "@spt/context/ApplicationContext";
|
||||||
import { HttpServerHelper } from "../helpers/HttpServerHelper";
|
import { HideoutHelper } from "@spt/helpers/HideoutHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";
|
||||||
import { PreAkiModLoader } from "../loaders/PreAkiModLoader";
|
import { InventoryHelper } from "@spt/helpers/InventoryHelper";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { PreSptModLoader } from "@spt/loaders/PreSptModLoader";
|
||||||
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
|
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
|
||||||
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IServerDetails } from "../models/eft/game/IServerDetails";
|
import { ICheckVersionResponse } from "@spt/models/eft/game/ICheckVersionResponse";
|
||||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
import { ICurrentGroupResponse } from "@spt/models/eft/game/ICurrentGroupResponse";
|
||||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
import { IGameConfigResponse } from "@spt/models/eft/game/IGameConfigResponse";
|
||||||
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
|
import { IGameKeepAliveResponse } from "@spt/models/eft/game/IGameKeepAliveResponse";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IGameModeRequestData } from "@spt/models/eft/game/IGameModeRequestData";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IGetRaidTimeRequest } from "@spt/models/eft/game/IGetRaidTimeRequest";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IGetRaidTimeResponse } from "@spt/models/eft/game/IGetRaidTimeResponse";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { IServerDetails } from "@spt/models/eft/game/IServerDetails";
|
||||||
import { ProfileFixerService } from "../services/ProfileFixerService";
|
import { ISurveyResponseData } from "@spt/models/eft/game/ISurveyResponseData";
|
||||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
import { ISptProfile } from "@spt/models/eft/profile/ISptProfile";
|
||||||
|
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
|
||||||
|
import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig";
|
||||||
|
import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig";
|
||||||
|
import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig";
|
||||||
|
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||||
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { GiftService } from "@spt/services/GiftService";
|
||||||
|
import { ItemBaseClassService } from "@spt/services/ItemBaseClassService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { OpenZoneService } from "@spt/services/OpenZoneService";
|
||||||
|
import { PostDbLoadService } from "@spt/services/PostDbLoadService";
|
||||||
|
import { ProfileActivityService } from "@spt/services/ProfileActivityService";
|
||||||
|
import { ProfileFixerService } from "@spt/services/ProfileFixerService";
|
||||||
|
import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService";
|
||||||
|
import { SeasonalEventService } from "@spt/services/SeasonalEventService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
export declare class GameController {
|
export declare class GameController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected preAkiModLoader: PreAkiModLoader;
|
protected timeUtil: TimeUtil;
|
||||||
|
protected hashUtil: HashUtil;
|
||||||
|
protected preSptModLoader: PreSptModLoader;
|
||||||
protected httpServerHelper: HttpServerHelper;
|
protected httpServerHelper: HttpServerHelper;
|
||||||
|
protected inventoryHelper: InventoryHelper;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
|
protected hideoutHelper: HideoutHelper;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected profileFixerService: ProfileFixerService;
|
protected profileFixerService: ProfileFixerService;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
|
protected postDbLoadService: PostDbLoadService;
|
||||||
|
protected customLocationWaveService: CustomLocationWaveService;
|
||||||
|
protected openZoneService: OpenZoneService;
|
||||||
protected seasonalEventService: SeasonalEventService;
|
protected seasonalEventService: SeasonalEventService;
|
||||||
|
protected itemBaseClassService: ItemBaseClassService;
|
||||||
|
protected giftService: GiftService;
|
||||||
|
protected raidTimeAdjustmentService: RaidTimeAdjustmentService;
|
||||||
|
protected profileActivityService: ProfileActivityService;
|
||||||
protected applicationContext: ApplicationContext;
|
protected applicationContext: ApplicationContext;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected cloner: ICloner;
|
||||||
protected httpConfig: IHttpConfig;
|
protected httpConfig: IHttpConfig;
|
||||||
protected coreConfig: ICoreConfig;
|
protected coreConfig: ICoreConfig;
|
||||||
constructor(logger: ILogger, databaseServer: DatabaseServer, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer);
|
protected ragfairConfig: IRagfairConfig;
|
||||||
|
protected hideoutConfig: IHideoutConfig;
|
||||||
|
protected botConfig: IBotConfig;
|
||||||
|
constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, inventoryHelper: InventoryHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, postDbLoadService: PostDbLoadService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner);
|
||||||
|
load(): void;
|
||||||
|
/**
|
||||||
|
* Handle client/game/start
|
||||||
|
*/
|
||||||
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
|
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
|
||||||
|
protected migrate39xProfile(fullProfile: ISptProfile): void;
|
||||||
|
/**
|
||||||
|
* Handle client/game/config
|
||||||
|
*/
|
||||||
|
getGameConfig(sessionID: string): IGameConfigResponse;
|
||||||
|
/**
|
||||||
|
* Handle client/game/mode
|
||||||
|
*/
|
||||||
|
getGameMode(sessionID: string, info: IGameModeRequestData): any;
|
||||||
|
/**
|
||||||
|
* Handle client/server/list
|
||||||
|
*/
|
||||||
|
getServer(sessionId: string): IServerDetails[];
|
||||||
|
/**
|
||||||
|
* Handle client/match/group/current
|
||||||
|
*/
|
||||||
|
getCurrentGroup(sessionId: string): ICurrentGroupResponse;
|
||||||
|
/**
|
||||||
|
* Handle client/checkVersion
|
||||||
|
*/
|
||||||
|
getValidGameVersion(sessionId: string): ICheckVersionResponse;
|
||||||
|
/**
|
||||||
|
* Handle client/game/keepalive
|
||||||
|
*/
|
||||||
|
getKeepAlive(sessionId: string): IGameKeepAliveResponse;
|
||||||
|
/**
|
||||||
|
* Handle singleplayer/settings/getRaidTime
|
||||||
|
*/
|
||||||
|
getRaidTime(sessionId: string, request: IGetRaidTimeRequest): IGetRaidTimeResponse;
|
||||||
|
/**
|
||||||
|
* Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it
|
||||||
|
* @param pmcProfile Player profile
|
||||||
|
*/
|
||||||
|
protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void;
|
||||||
|
/**
|
||||||
|
* When player logs in, iterate over all active effects and reduce timer
|
||||||
|
* @param pmcProfile Profile to adjust values for
|
||||||
|
*/
|
||||||
|
protected updateProfileHealthValues(pmcProfile: IPmcData): void;
|
||||||
|
/**
|
||||||
|
* Send starting gifts to profile after x days
|
||||||
|
* @param pmcProfile Profile to add gifts to
|
||||||
|
*/
|
||||||
|
protected sendPraporGiftsToNewProfiles(pmcProfile: IPmcData): void;
|
||||||
/**
|
/**
|
||||||
* Get a list of installed mods and save their details to the profile being used
|
* Get a list of installed mods and save their details to the profile being used
|
||||||
* @param fullProfile Profile to add mod details to
|
* @param fullProfile Profile to add mod details to
|
||||||
*/
|
*/
|
||||||
protected saveActiveModsToProfile(fullProfile: IAkiProfile): void;
|
protected saveActiveModsToProfile(fullProfile: ISptProfile): void;
|
||||||
/**
|
/**
|
||||||
* Add the logged in players name to PMC name pool
|
* Add the logged in players name to PMC name pool
|
||||||
* @param pmcProfile
|
* @param pmcProfile Profile of player to get name from
|
||||||
*/
|
*/
|
||||||
protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
|
protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
|
||||||
/**
|
/**
|
||||||
* Blank out the "test" mail message from prapor
|
* Check for a dialog with the key 'undefined', and remove it
|
||||||
|
* @param fullProfile Profile to check for dialog in
|
||||||
*/
|
*/
|
||||||
protected removePraporTestMessage(): void;
|
protected checkForAndRemoveUndefinedDialogs(fullProfile: ISptProfile): void;
|
||||||
/**
|
protected logProfileDetails(fullProfile: ISptProfile): void;
|
||||||
* Make non-trigger-spawned raiders spawn earlier + always
|
getSurvey(sessionId: string): ISurveyResponseData;
|
||||||
*/
|
|
||||||
protected adjustLabsRaiderSpawnRate(): void;
|
|
||||||
protected logProfileDetails(fullProfile: IAkiProfile): void;
|
|
||||||
getGameConfig(sessionID: string): IGameConfigResponse;
|
|
||||||
getServer(): IServerDetails[];
|
|
||||||
getValidGameVersion(): ICheckVersionResponse;
|
|
||||||
}
|
}
|
||||||
|
4
types/controllers/HandbookController.d.ts
vendored
4
types/controllers/HandbookController.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
import { HandbookHelper } from "@spt/helpers/HandbookHelper";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||||
export declare class HandbookController {
|
export declare class HandbookController {
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected handbookHelper: HandbookHelper;
|
protected handbookHelper: HandbookHelper;
|
||||||
|
73
types/controllers/HealthController.d.ts
vendored
73
types/controllers/HealthController.d.ts
vendored
@ -1,16 +1,18 @@
|
|||||||
import { HealthHelper } from "../helpers/HealthHelper";
|
import { HealthHelper } from "@spt/helpers/HealthHelper";
|
||||||
import { InventoryHelper } from "../helpers/InventoryHelper";
|
import { InventoryHelper } from "@spt/helpers/InventoryHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData";
|
import { IHealthTreatmentRequestData } from "@spt/models/eft/health/IHealthTreatmentRequestData";
|
||||||
import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData";
|
import { IOffraidEatRequestData } from "@spt/models/eft/health/IOffraidEatRequestData";
|
||||||
import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData";
|
import { IOffraidHealRequestData } from "@spt/models/eft/health/IOffraidHealRequestData";
|
||||||
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
|
import { IWorkoutData } from "@spt/models/eft/health/IWorkoutData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
import { PaymentService } from "../services/PaymentService";
|
import { PaymentService } from "@spt/services/PaymentService";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
export declare class HealthController {
|
export declare class HealthController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
@ -18,38 +20,41 @@ export declare class HealthController {
|
|||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected inventoryHelper: InventoryHelper;
|
protected inventoryHelper: InventoryHelper;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected healthHelper: HealthHelper;
|
protected healthHelper: HealthHelper;
|
||||||
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, healthHelper: HealthHelper);
|
protected cloner: ICloner;
|
||||||
/**
|
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, httpResponse: HttpResponseUtil, healthHelper: HealthHelper, cloner: ICloner);
|
||||||
* stores in-raid player health
|
|
||||||
* @param pmcData Player profile
|
|
||||||
* @param info Request data
|
|
||||||
* @param sessionID
|
|
||||||
* @param addEffects Should effects found be added or removed from profile
|
|
||||||
*/
|
|
||||||
saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
|
|
||||||
/**
|
/**
|
||||||
* When healing in menu
|
* When healing in menu
|
||||||
* @param pmcData
|
* @param pmcData Player profile
|
||||||
* @param body
|
* @param request Healing request
|
||||||
* @param sessionID
|
* @param sessionID Player id
|
||||||
* @returns
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse;
|
offraidHeal(pmcData: IPmcData, request: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
/**
|
/**
|
||||||
|
* Handle Eat event
|
||||||
|
* Consume food/water outside of a raid
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param request Eat request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
offraidEat(pmcData: IPmcData, request: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle RestoreHealth event
|
||||||
* Occurs on post-raid healing page
|
* Occurs on post-raid healing page
|
||||||
* @param pmcData player profile
|
* @param pmcData player profile
|
||||||
* @param healthTreatmentRequest Request data from client
|
* @param healthTreatmentRequest Request data from client
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
* @returns
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse;
|
healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* iterate over treatment request diff and find effects to remove from player limbs
|
* applies skills from hideout workout.
|
||||||
* @param sessionId
|
* @param pmcData Player profile
|
||||||
* @param profile Profile to update
|
* @param info Request data
|
||||||
* @param treatmentRequest client request
|
* @param sessionID
|
||||||
*/
|
*/
|
||||||
protected removeEffectsAfterPostRaidHeal(sessionId: string, profile: IPmcData, treatmentRequest: IHealthTreatmentRequestData): void;
|
applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void;
|
||||||
}
|
}
|
||||||
|
303
types/controllers/HideoutController.d.ts
vendored
303
types/controllers/HideoutController.d.ts
vendored
@ -1,42 +1,56 @@
|
|||||||
import { ScavCaseRewardGenerator } from "../generators/ScavCaseRewardGenerator";
|
import { ScavCaseRewardGenerator } from "@spt/generators/ScavCaseRewardGenerator";
|
||||||
import { HideoutHelper } from "../helpers/HideoutHelper";
|
import { HideoutHelper } from "@spt/helpers/HideoutHelper";
|
||||||
import { InventoryHelper } from "../helpers/InventoryHelper";
|
import { InventoryHelper } from "@spt/helpers/InventoryHelper";
|
||||||
import { PaymentHelper } from "../helpers/PaymentHelper";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { PresetHelper } from "../helpers/PresetHelper";
|
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData";
|
import { IBotHideoutArea, IProduct, ITaskConditionCounter } from "@spt/models/eft/common/tables/IBotBase";
|
||||||
import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData";
|
import { IHandleQTEEventRequestData } from "@spt/models/eft/hideout/IHandleQTEEventRequestData";
|
||||||
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
|
import { IHideoutArea, IStage } from "@spt/models/eft/hideout/IHideoutArea";
|
||||||
import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData";
|
import { IHideoutCancelProductionRequestData } from "@spt/models/eft/hideout/IHideoutCancelProductionRequestData";
|
||||||
import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData";
|
import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData";
|
||||||
import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData";
|
import { IHideoutContinuousProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutContinuousProductionStartRequestData";
|
||||||
import { IHideoutTakeItemOutRequestData } from "../models/eft/hideout/IHideoutTakeItemOutRequestData";
|
import { IHideoutDeleteProductionRequestData } from "@spt/models/eft/hideout/IHideoutDeleteProductionRequestData";
|
||||||
import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData";
|
import { IHideoutImproveAreaRequestData } from "@spt/models/eft/hideout/IHideoutImproveAreaRequestData";
|
||||||
import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData";
|
import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction";
|
||||||
import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData";
|
import { IHideoutPutItemInRequestData } from "@spt/models/eft/hideout/IHideoutPutItemInRequestData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IHideoutScavCaseStartRequestData } from "@spt/models/eft/hideout/IHideoutScavCaseStartRequestData";
|
||||||
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
|
import { IHideoutSingleProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutSingleProductionStartRequestData";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IHideoutTakeItemOutRequestData } from "@spt/models/eft/hideout/IHideoutTakeItemOutRequestData";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { IHideoutTakeProductionRequestData } from "@spt/models/eft/hideout/IHideoutTakeProductionRequestData";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IHideoutToggleAreaRequestData } from "@spt/models/eft/hideout/IHideoutToggleAreaRequestData";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IHideoutUpgradeCompleteRequestData } from "@spt/models/eft/hideout/IHideoutUpgradeCompleteRequestData";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { IHideoutUpgradeRequestData } from "@spt/models/eft/hideout/IHideoutUpgradeRequestData";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { IQteData, IQteResult } from "@spt/models/eft/hideout/IQteData";
|
||||||
import { PlayerService } from "../services/PlayerService";
|
import { IRecordShootingRangePoints } from "@spt/models/eft/hideout/IRecordShootingRangePoints";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HideoutAreas } from "@spt/models/enums/HideoutAreas";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
|
import { CircleOfCultistService } from "@spt/services/CircleOfCultistService";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { FenceService } from "@spt/services/FenceService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { PlayerService } from "@spt/services/PlayerService";
|
||||||
|
import { ProfileActivityService } from "@spt/services/ProfileActivityService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
export declare class HideoutController {
|
export declare class HideoutController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected inventoryHelper: InventoryHelper;
|
protected inventoryHelper: InventoryHelper;
|
||||||
|
protected itemHelper: ItemHelper;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected playerService: PlayerService;
|
protected playerService: PlayerService;
|
||||||
protected presetHelper: PresetHelper;
|
protected presetHelper: PresetHelper;
|
||||||
@ -47,14 +61,73 @@ export declare class HideoutController {
|
|||||||
protected hideoutHelper: HideoutHelper;
|
protected hideoutHelper: HideoutHelper;
|
||||||
protected scavCaseRewardGenerator: ScavCaseRewardGenerator;
|
protected scavCaseRewardGenerator: ScavCaseRewardGenerator;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
|
protected profileActivityService: ProfileActivityService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected jsonUtil: JsonUtil;
|
protected fenceService: FenceService;
|
||||||
protected static nameBackendCountersCrafting: string;
|
protected circleOfCultistService: CircleOfCultistService;
|
||||||
|
protected cloner: ICloner;
|
||||||
|
/** Key used in TaskConditionCounters array */
|
||||||
|
protected static nameTaskConditionCountersCrafting: string;
|
||||||
protected hideoutConfig: IHideoutConfig;
|
protected hideoutConfig: IHideoutConfig;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil);
|
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, 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, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, circleOfCultistService: CircleOfCultistService, cloner: ICloner);
|
||||||
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
/**
|
/**
|
||||||
|
* Handle HideoutUpgrade event
|
||||||
|
* Start a hideout area upgrade
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param request upgrade start request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @param output Client response
|
||||||
|
*/
|
||||||
|
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
|
||||||
|
* @param output Client response
|
||||||
|
*/
|
||||||
|
upgradeComplete(pmcData: IPmcData, request: IHideoutUpgradeCompleteRequestData, 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 SetWallVisibleIfPrereqsMet(pmcData: IPmcData): void;
|
||||||
|
/**
|
||||||
|
* @param pmcData Profile to edit
|
||||||
|
* @param output Object to send back to client
|
||||||
|
* @param sessionID Session/player id
|
||||||
|
* @param profileParentHideoutArea Current hideout area for profile
|
||||||
|
* @param dbHideoutArea Hideout area being upgraded
|
||||||
|
* @param hideoutStage Stage hideout area is being upgraded to
|
||||||
|
*/
|
||||||
|
protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileParentHideoutArea: IBotHideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: IStage): void;
|
||||||
|
/**
|
||||||
|
* Add stand1/stand2/stand3 inventory items to profile, depending on passed in hideout stage
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param equipmentPresetStage Current EQUIPMENT_PRESETS_STAND stage data
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param equipmentPresetHideoutArea
|
||||||
|
* @param output Response to send back to client
|
||||||
|
*/
|
||||||
|
protected addMissingPresetStandItemsToProfile(sessionId: string, equipmentPresetStage: IStage, pmcData: IPmcData, equipmentPresetHideoutArea: IHideoutArea, output: IItemEventRouterResponse): void;
|
||||||
|
/**
|
||||||
|
* Add an inventory item to profile from a hideout area stage data
|
||||||
|
* @param pmcData Profile to update
|
||||||
|
* @param dbHideoutArea Hideout area from db being upgraded
|
||||||
|
* @param hideoutStage Stage area upgraded to
|
||||||
|
*/
|
||||||
|
protected addUpdateInventoryItemToProfile(sessionId: string, pmcData: IPmcData, dbHideoutArea: IHideoutArea, hideoutStage: IStage): void;
|
||||||
|
/**
|
||||||
|
* @param output Object to send to client
|
||||||
|
* @param sessionID Session/player id
|
||||||
|
* @param areaType Hideout area that had stash added
|
||||||
|
* @param hideoutDbData Hideout area that caused addition of stash
|
||||||
|
* @param hideoutStage Hideout area upgraded to this
|
||||||
|
*/
|
||||||
|
protected addContainerUpgradeToClientOutput(sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: IStage, output: IItemEventRouterResponse): void;
|
||||||
|
/**
|
||||||
|
* Handle HideoutPutItemsInAreaSlots
|
||||||
* Create item in hideout slot item array, remove item from player inventory
|
* Create item in hideout slot item array, remove item from player inventory
|
||||||
* @param pmcData Profile data
|
* @param pmcData Profile data
|
||||||
* @param addItemToHideoutRequest reqeust from client to place item in area slot
|
* @param addItemToHideoutRequest reqeust from client to place item in area slot
|
||||||
@ -62,7 +135,15 @@ export declare class HideoutController {
|
|||||||
* @returns IItemEventRouterResponse object
|
* @returns IItemEventRouterResponse object
|
||||||
*/
|
*/
|
||||||
putItemsInAreaSlots(pmcData: IPmcData, addItemToHideoutRequest: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
|
putItemsInAreaSlots(pmcData: IPmcData, addItemToHideoutRequest: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse;
|
/**
|
||||||
|
* Handle HideoutTakeItemsFromAreaSlots event
|
||||||
|
* Remove item from hideout area and place into player inventory
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param request Take item out of area request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
takeItemsFromAreaSlots(pmcData: IPmcData, request: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Find resource item in hideout area, add copy to player inventory, remove Item from hideout slot
|
* Find resource item in hideout area, add copy to player inventory, remove Item from hideout slot
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
@ -72,10 +153,27 @@ export declare class HideoutController {
|
|||||||
* @param hideoutArea Area fuel is being removed from
|
* @param hideoutArea Area fuel is being removed from
|
||||||
* @returns IItemEventRouterResponse response
|
* @returns IItemEventRouterResponse response
|
||||||
*/
|
*/
|
||||||
protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: HideoutArea): IItemEventRouterResponse;
|
protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: IBotHideoutArea): IItemEventRouterResponse;
|
||||||
toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
|
/**
|
||||||
|
* Handle HideoutToggleArea event
|
||||||
|
* Toggle area on/off
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param request Toggle area request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
toggleArea(pmcData: IPmcData, request: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle HideoutSingleProductionStart event
|
||||||
|
* Start production for an item from hideout area
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param body Start prodution of single item request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle HideoutScavCaseProductionStart event
|
||||||
* Handles event after clicking 'start' on the scav case hideout page
|
* Handles event after clicking 'start' on the scav case hideout page
|
||||||
* @param pmcData player profile
|
* @param pmcData player profile
|
||||||
* @param body client request object
|
* @param body client request object
|
||||||
@ -83,24 +181,123 @@ export declare class HideoutController {
|
|||||||
* @returns item event router response
|
* @returns item event router response
|
||||||
*/
|
*/
|
||||||
scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse;
|
scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Adjust scav case time based on fence standing
|
||||||
|
*
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param productionTime Time to complete scav case in seconds
|
||||||
|
* @returns Adjusted scav case time in seconds
|
||||||
|
*/
|
||||||
|
protected getScavCaseTime(pmcData: IPmcData, productionTime: number): number;
|
||||||
/**
|
/**
|
||||||
* Add generated scav case rewards to player profile
|
* Add generated scav case rewards to player profile
|
||||||
* @param pmcData player profile to add rewards to
|
* @param pmcData player profile to add rewards to
|
||||||
* @param rewards reward items to add to profile
|
* @param rewards reward items to add to profile
|
||||||
|
* @param recipeId recipe id to save into Production dict
|
||||||
*/
|
*/
|
||||||
protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[]): void;
|
protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: IProduct[], recipeId: string): void;
|
||||||
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
|
||||||
/**
|
/**
|
||||||
* Handles giving rewards stored in player profile to player after clicking 'get rewards'
|
* Start production of continuously created item
|
||||||
* @param sessionID
|
* @param pmcData Player profile
|
||||||
* @param pmcData
|
* @param request Continious production request
|
||||||
* @param body
|
* @param sessionID Session id
|
||||||
* @param output
|
* @returns IItemEventRouterResponse
|
||||||
* @returns
|
*/
|
||||||
|
continuousProductionStart(pmcData: IPmcData, request: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle HideoutTakeProduction event
|
||||||
|
* Take completed item out of hideout area and place into player inventory
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param request Remove production from area request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
takeProduction(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Take recipe-type production out of hideout area and place into player inventory
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @param recipe Completed recipe of item
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param request Remove production from area request
|
||||||
|
* @param output Output object to update
|
||||||
|
*/
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): void;
|
||||||
|
/**
|
||||||
|
* Get quick time event list for hideout
|
||||||
|
* // TODO - implement this
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @returns IQteData array
|
||||||
|
*/
|
||||||
|
getQteList(sessionId: string): IQteData[];
|
||||||
|
/**
|
||||||
|
* Handle HideoutQuickTimeEvent on client/game/profile/items/moving
|
||||||
|
* Called after completing workout at gym
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param pmcData Profile to adjust
|
||||||
|
* @param request QTE result object
|
||||||
|
*/
|
||||||
|
handleQTEEventOutcome(sessionId: string, pmcData: IPmcData, request: IHandleQTEEventRequestData, output: IItemEventRouterResponse): void;
|
||||||
|
/**
|
||||||
|
* Apply mild/severe muscle pain after gym use
|
||||||
|
* @param pmcData Profile to apply effect to
|
||||||
|
* @param finishEffect Effect data to apply after completing QTE gym event
|
||||||
|
*/
|
||||||
|
protected handleMusclePain(pmcData: IPmcData, finishEffect: IQteResult): void;
|
||||||
|
/**
|
||||||
|
* Record a high score from the shooting range into a player profiles overallcounters
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param pmcData Profile to update
|
||||||
|
* @param request shooting range score request
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
recordShootingRangePoints(sessionId: string, pmcData: IPmcData, request: IRecordShootingRangePoints): 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
|
||||||
|
*/
|
||||||
|
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;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/items/moving - HideoutCircleOfCultistProductionStart
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param pmcData Profile of crafter
|
||||||
|
* @param request Request data
|
||||||
|
*/
|
||||||
|
circleOfCultistProductionStart(sessionId: string, pmcData: IPmcData, request: IHideoutCircleOfCultistProductionStartRequestData): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Handle HideoutDeleteProductionCommand event
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param request Client request data
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
hideoutDeleteProductionCommand(sessionId: string, pmcData: IPmcData, request: IHideoutDeleteProductionRequestData): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Function called every `hideoutConfig.runIntervalSeconds` seconds as part of onUpdate event
|
||||||
*/
|
*/
|
||||||
protected handleScavCase(sessionID: string, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
|
||||||
registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
update(): void;
|
update(): void;
|
||||||
}
|
}
|
||||||
|
125
types/controllers/InraidController.d.ts
vendored
125
types/controllers/InraidController.d.ts
vendored
@ -1,46 +1,26 @@
|
|||||||
import { ApplicationContext } from "../context/ApplicationContext";
|
import { ApplicationContext } from "@spt/context/ApplicationContext";
|
||||||
import { PlayerScavGenerator } from "../generators/PlayerScavGenerator";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { HealthHelper } from "../helpers/HealthHelper";
|
import { IRegisterPlayerRequestData } from "@spt/models/eft/inRaid/IRegisterPlayerRequestData";
|
||||||
import { InRaidHelper } from "../helpers/InRaidHelper";
|
import { IScavSaveRequestData } from "@spt/models/eft/inRaid/IScavSaveRequestData";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig";
|
||||||
import { QuestHelper } from "../helpers/QuestHelper";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { TraderHelper } from "../helpers/TraderHelper";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
|
|
||||||
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
|
|
||||||
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
|
||||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
|
||||||
import { InsuranceService } from "../services/InsuranceService";
|
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
|
||||||
/**
|
/**
|
||||||
* Logic for handling In Raid callbacks
|
* Logic for handling In Raid callbacks
|
||||||
*/
|
*/
|
||||||
export declare class InraidController {
|
export declare class InraidController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected jsonUtil: JsonUtil;
|
|
||||||
protected timeUtil: TimeUtil;
|
|
||||||
protected databaseServer: DatabaseServer;
|
|
||||||
protected questHelper: QuestHelper;
|
|
||||||
protected itemHelper: ItemHelper;
|
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected playerScavGenerator: PlayerScavGenerator;
|
protected localisationService: LocalisationService;
|
||||||
protected healthHelper: HealthHelper;
|
|
||||||
protected traderHelper: TraderHelper;
|
|
||||||
protected insuranceService: InsuranceService;
|
|
||||||
protected inRaidHelper: InRaidHelper;
|
|
||||||
protected applicationContext: ApplicationContext;
|
protected applicationContext: ApplicationContext;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected airdropConfig: IAirdropConfig;
|
protected inRaidConfig: IInRaidConfig;
|
||||||
protected inraidConfig: IInRaidConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer);
|
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, localisationService: LocalisationService, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Save locationId to active profiles inraid object AND app context
|
* Save locationId to active profiles inraid object AND app context
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
@ -48,85 +28,18 @@ export declare class InraidController {
|
|||||||
*/
|
*/
|
||||||
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
|
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
|
||||||
/**
|
/**
|
||||||
|
* Handle raid/profile/scavsave
|
||||||
* Save profile state to disk
|
* Save profile state to disk
|
||||||
* Handles pmc/pscav
|
* Handles pmc/pscav
|
||||||
* @param offraidData post-raid request data
|
* @param offraidProfileData Post-raid scav profile data
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
*/
|
*/
|
||||||
savePostRaidProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
|
savePostRaidProfileForScav(offraidProfileData: IScavSaveRequestData, sessionID: string): void;
|
||||||
/**
|
|
||||||
* Handle updating player profile post-pmc raid
|
|
||||||
* @param sessionID session id
|
|
||||||
* @param offraidData post-raid data
|
|
||||||
*/
|
|
||||||
protected savePmcProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
|
|
||||||
/**
|
|
||||||
* Make changes to pmc profile after they left raid dead,
|
|
||||||
* alter bodypart hp, handle insurance, delete inventory items, remove carried quest items
|
|
||||||
* @param postRaidSaveRequest post-raid save request
|
|
||||||
* @param pmcData pmc profile
|
|
||||||
* @param insuranceEnabled is insurance enabled
|
|
||||||
* @param preRaidGear gear player had before raid
|
|
||||||
* @param sessionID Session id
|
|
||||||
* @returns Updated profile object
|
|
||||||
*/
|
|
||||||
protected performPostRaidActionsWhenDead(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData, insuranceEnabled: boolean, preRaidGear: Item[], sessionID: string): IPmcData;
|
|
||||||
/**
|
|
||||||
* Adjust player characters bodypart hp if they left raid early
|
|
||||||
* @param postRaidSaveRequest post raid data
|
|
||||||
* @param pmcData player profile
|
|
||||||
*/
|
|
||||||
protected updatePmcHealthPostRaid(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData): void;
|
|
||||||
/**
|
|
||||||
* Reduce body part hp to % of max
|
|
||||||
* @param pmcData profile to edit
|
|
||||||
* @param multipler multipler to apply to max health
|
|
||||||
*/
|
|
||||||
protected reducePmcHealthToPercent(pmcData: IPmcData, multipler: number): void;
|
|
||||||
/**
|
|
||||||
* Handle updating the profile post-pscav raid
|
|
||||||
* @param sessionID session id
|
|
||||||
* @param offraidData post-raid data of raid
|
|
||||||
*/
|
|
||||||
protected savePlayerScavProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
|
|
||||||
/**
|
|
||||||
* Is the player dead after a raid - dead is anything other than "survived" / "runner"
|
|
||||||
* @param statusOnExit exit value from offraidData object
|
|
||||||
* @returns true if dead
|
|
||||||
*/
|
|
||||||
protected isPlayerDead(statusOnExit: string): boolean;
|
|
||||||
/**
|
|
||||||
* Mark inventory items as FiR if player survived raid, otherwise remove FiR from them
|
|
||||||
* @param offraidData Save Progress Request
|
|
||||||
* @param pmcData player profile
|
|
||||||
* @param isPlayerScav Was the player a pScav
|
|
||||||
*/
|
|
||||||
protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void;
|
|
||||||
/**
|
|
||||||
* Update profile after player completes scav raid
|
|
||||||
* @param scavData Scav profile
|
|
||||||
* @param sessionID Session id
|
|
||||||
* @param offraidData Post-raid save request
|
|
||||||
* @param pmcData Pmc profile
|
|
||||||
* @param isDead Is player dead
|
|
||||||
*/
|
|
||||||
protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void;
|
|
||||||
/**
|
|
||||||
* Update profile with scav karma values based on in-raid actions
|
|
||||||
* @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;
|
|
||||||
/**
|
/**
|
||||||
* Get the inraid config from configs/inraid.json
|
* Get the inraid config from configs/inraid.json
|
||||||
* @returns InRaid Config
|
* @returns InRaid Config
|
||||||
*/
|
*/
|
||||||
getInraidConfig(): IInRaidConfig;
|
getInraidConfig(): IInRaidConfig;
|
||||||
/**
|
getTraitorScavHostileChance(url: string, sessionID: string): number;
|
||||||
* Get airdrop config from configs/airdrop.json
|
getBossConvertSettings(url: string, sessionId: string): string[];
|
||||||
* @returns Airdrop config
|
|
||||||
*/
|
|
||||||
getAirdropConfig(): IAirdropConfig;
|
|
||||||
}
|
}
|
||||||
|
227
types/controllers/InsuranceController.d.ts
vendored
227
types/controllers/InsuranceController.d.ts
vendored
@ -1,43 +1,220 @@
|
|||||||
import { DialogueHelper } from "../helpers/DialogueHelper";
|
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||||
import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsuranceCostRequestData";
|
import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper";
|
||||||
import { IGetInsuranceCostResponseData } from "../models/eft/insurance/IGetInsuranceCostResponseData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData";
|
import { IItem } from "@spt/models/eft/common/tables/IItem";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IGetInsuranceCostRequestData } from "@spt/models/eft/insurance/IGetInsuranceCostRequestData";
|
||||||
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
|
import { IGetInsuranceCostResponseData } from "@spt/models/eft/insurance/IGetInsuranceCostResponseData";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IInsureRequestData } from "@spt/models/eft/insurance/IInsureRequestData";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IInsurance } from "@spt/models/eft/profile/ISptProfile";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { InsuranceService } from "../services/InsuranceService";
|
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
|
||||||
import { PaymentService } from "../services/PaymentService";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { InsuranceService } from "@spt/services/InsuranceService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { MailSendService } from "@spt/services/MailSendService";
|
||||||
|
import { PaymentService } from "@spt/services/PaymentService";
|
||||||
|
import { RagfairPriceService } from "@spt/services/RagfairPriceService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { MathUtil } from "@spt/utils/MathUtil";
|
||||||
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
export declare class InsuranceController {
|
export declare class InsuranceController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
|
protected mathUtil: MathUtil;
|
||||||
|
protected hashUtil: HashUtil;
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected dialogueHelper: DialogueHelper;
|
protected dialogueHelper: DialogueHelper;
|
||||||
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
|
protected traderHelper: TraderHelper;
|
||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected insuranceService: InsuranceService;
|
protected insuranceService: InsuranceService;
|
||||||
|
protected mailSendService: MailSendService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
|
protected localisationService: LocalisationService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected cloner: ICloner;
|
||||||
protected insuranceConfig: IInsuranceConfig;
|
protected insuranceConfig: IInsuranceConfig;
|
||||||
constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, insuranceService: InsuranceService, configServer: ConfigServer);
|
constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner);
|
||||||
|
/**
|
||||||
|
* Process insurance items of all profiles prior to being given back to the player through the mail service.
|
||||||
|
*
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
processReturn(): void;
|
processReturn(): void;
|
||||||
|
/**
|
||||||
|
* Process insurance items of a single profile prior to being given back to the player through the mail service.
|
||||||
|
*
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
processReturnByProfile(sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Get all insured items that are ready to be processed in a specific profile.
|
||||||
|
*
|
||||||
|
* @param sessionID Session ID of the profile to check.
|
||||||
|
* @param time The time to check ready status against. Current time by default.
|
||||||
|
* @returns All insured items that are ready to be processed.
|
||||||
|
*/
|
||||||
|
protected filterInsuredItems(sessionID: string, time?: number): IInsurance[];
|
||||||
|
/**
|
||||||
|
* This method orchestrates the processing of insured items in a profile.
|
||||||
|
*
|
||||||
|
* @param insuranceDetails The insured items to process.
|
||||||
|
* @param sessionID The session ID that should receive the processed items.
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
protected processInsuredItems(insuranceDetails: IInsurance[], sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Count all items in all insurance packages.
|
||||||
|
* @param insurance
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
protected countAllInsuranceItems(insurance: IInsurance[]): number;
|
||||||
|
/**
|
||||||
|
* Remove an insurance package from a profile using the package's system data information.
|
||||||
|
*
|
||||||
|
* @param sessionID The session ID of the profile to remove the package from.
|
||||||
|
* @param index The array index of the insurance package to remove.
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
protected removeInsurancePackageFromProfile(sessionID: string, insPackage: IInsurance): void;
|
||||||
|
/**
|
||||||
|
* Finds the items that should be deleted based on the given Insurance object.
|
||||||
|
*
|
||||||
|
* @param rootItemParentID - The ID that should be assigned to all "hideout"/root items.
|
||||||
|
* @param insured - The insurance object containing the items to evaluate for deletion.
|
||||||
|
* @returns A Set containing the IDs of items that should be deleted.
|
||||||
|
*/
|
||||||
|
protected findItemsToDelete(rootItemParentID: string, insured: IInsurance): 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: IInsurance, itemsMap: Map<string, IItem>): Map<string, IItem[]>;
|
||||||
|
/**
|
||||||
|
* 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, IItem[]>, itemsMap: Map<string, IItem>): Map<string, IItem[]>;
|
||||||
|
/**
|
||||||
|
* 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: IInsurance, toDelete: Set<string>, parentAttachmentsMap: Map<string, IItem[]>): 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, IItem[]>, itemsMap: Map<string, IItem>, traderId: string, toDelete: Set<string>): void;
|
||||||
|
/**
|
||||||
|
* Takes an array of attachment items that belong to the same main-parent item, sorts them in descending order by
|
||||||
|
* their maximum price. For each attachment, a roll is made to determine if a deletion should be made. Once the
|
||||||
|
* number of deletions has been counted, the attachments are added to the toDelete Set, starting with the most
|
||||||
|
* valuable attachments first.
|
||||||
|
*
|
||||||
|
* @param attachments The array of attachment items to sort, filter, and roll.
|
||||||
|
* @param traderId The ID of the trader to that has ensured these items.
|
||||||
|
* @param toDelete The array that accumulates the IDs of the items to be deleted.
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
protected processAttachmentByParent(attachments: IItem[], traderId: string, toDelete: Set<string>): void;
|
||||||
|
protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: IItem[], attachmentPrices: Record<string, number>): void;
|
||||||
|
protected weightAttachmentsByPrice(attachments: IItem[]): Record<string, number>;
|
||||||
|
/**
|
||||||
|
* Get count of items to remove from weapon (take into account trader + price of attachment)
|
||||||
|
* @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price
|
||||||
|
* @param traderId Trader attachment insured against
|
||||||
|
* @returns Attachment count to remove
|
||||||
|
*/
|
||||||
|
protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record<string, number>, traderId: string): number;
|
||||||
|
/**
|
||||||
|
* Remove items from the insured items that should not be returned to the player.
|
||||||
|
*
|
||||||
|
* @param insured The insured items to process.
|
||||||
|
* @param toDelete The items that should be deleted.
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
protected removeItemsFromInsurance(insured: IInsurance, toDelete: Set<string>): void;
|
||||||
|
/**
|
||||||
|
* Handle sending the insurance message to the user that potentially contains the valid insurance items.
|
||||||
|
*
|
||||||
|
* @param sessionID The session ID that should receive the insurance message.
|
||||||
|
* @param insurance The context of insurance to use.
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
protected sendMail(sessionID: string, insurance: IInsurance): void;
|
||||||
|
protected IsMapLabsAndInsuranceDisabled(insurance: IInsurance, labsId?: string): boolean;
|
||||||
|
/**
|
||||||
|
* Update IInsurance object with new messageTemplateId and wipe out items array data
|
||||||
|
*/
|
||||||
|
protected handleLabsInsurance(traderDialogMessages: Record<string, string[]>, insurance: IInsurance): void;
|
||||||
|
/**
|
||||||
|
* Determines whether an insured item should be removed from the player's inventory based on a random roll and
|
||||||
|
* trader-specific return chance.
|
||||||
|
*
|
||||||
|
* @param traderId The ID of the trader who insured the item.
|
||||||
|
* @param insuredItem Optional. The item to roll for. Only used for logging.
|
||||||
|
* @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error.
|
||||||
|
*/
|
||||||
|
protected rollForDelete(traderId: string, insuredItem?: IItem): boolean | undefined;
|
||||||
|
/**
|
||||||
|
* Handle Insure event
|
||||||
|
* Add insurance to an item
|
||||||
|
*
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param body Insurance request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse object to send to client
|
||||||
|
*/
|
||||||
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Calculate insurance cost
|
* Insure softinserts of Armor that has softinsert slots
|
||||||
* @param info request object
|
* Allows armors to come back after being lost correctly
|
||||||
* @param sessionID session id
|
* @param item Armor item to be insured
|
||||||
* @returns response object to send to client
|
* @param pmcData Player profile
|
||||||
|
* @param body Insurance request data
|
||||||
*/
|
*/
|
||||||
cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData;
|
insureSoftInserts(item: IItem, pmcData: IPmcData, body: IInsureRequestData): void;
|
||||||
|
/**
|
||||||
|
* Handle client/insurance/items/list/cost
|
||||||
|
* Calculate insurance cost
|
||||||
|
*
|
||||||
|
* @param request request object
|
||||||
|
* @param sessionID session id
|
||||||
|
* @returns IGetInsuranceCostResponseData object to send to client
|
||||||
|
*/
|
||||||
|
cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData;
|
||||||
}
|
}
|
||||||
|
245
types/controllers/InventoryController.d.ts
vendored
245
types/controllers/InventoryController.d.ts
vendored
@ -1,55 +1,70 @@
|
|||||||
import { InventoryHelper } from "../helpers/InventoryHelper";
|
import { LootGenerator } from "@spt/generators/LootGenerator";
|
||||||
import { PaymentHelper } from "../helpers/PaymentHelper";
|
import { HideoutHelper } from "@spt/helpers/HideoutHelper";
|
||||||
import { PresetHelper } from "../helpers/PresetHelper";
|
import { InventoryHelper } from "@spt/helpers/InventoryHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||||
import { IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { IInventoryBindRequestData } from "../models/eft/inventory/IInventoryBindRequestData";
|
import { QuestHelper } from "@spt/helpers/QuestHelper";
|
||||||
import { IInventoryCreateMarkerRequestData } from "../models/eft/inventory/IInventoryCreateMarkerRequestData";
|
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||||
import { IInventoryDeleteMarkerRequestData } from "../models/eft/inventory/IInventoryDeleteMarkerRequestData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IInventoryEditMarkerRequestData } from "../models/eft/inventory/IInventoryEditMarkerRequestData";
|
import { IInventoryBindRequestData } from "@spt/models/eft/inventory/IInventoryBindRequestData";
|
||||||
import { IInventoryExamineRequestData } from "../models/eft/inventory/IInventoryExamineRequestData";
|
import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData";
|
||||||
import { IInventoryFoldRequestData } from "../models/eft/inventory/IInventoryFoldRequestData";
|
import { IInventoryDeleteMarkerRequestData } from "@spt/models/eft/inventory/IInventoryDeleteMarkerRequestData";
|
||||||
import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData";
|
import { IInventoryEditMarkerRequestData } from "@spt/models/eft/inventory/IInventoryEditMarkerRequestData";
|
||||||
import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData";
|
import { IInventoryExamineRequestData } from "@spt/models/eft/inventory/IInventoryExamineRequestData";
|
||||||
import { IInventoryReadEncyclopediaRequestData } from "../models/eft/inventory/IInventoryReadEncyclopediaRequestData";
|
import { IInventoryFoldRequestData } from "@spt/models/eft/inventory/IInventoryFoldRequestData";
|
||||||
import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData";
|
import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData";
|
||||||
import { IInventorySortRequestData } from "../models/eft/inventory/IInventorySortRequestData";
|
import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData";
|
||||||
import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData";
|
import { IInventoryReadEncyclopediaRequestData } from "@spt/models/eft/inventory/IInventoryReadEncyclopediaRequestData";
|
||||||
import { IInventorySwapRequestData } from "../models/eft/inventory/IInventorySwapRequestData";
|
import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData";
|
||||||
import { IInventoryTagRequestData } from "../models/eft/inventory/IInventoryTagRequestData";
|
import { IInventorySortRequestData } from "@spt/models/eft/inventory/IInventorySortRequestData";
|
||||||
import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryToggleRequestData";
|
import { IInventorySplitRequestData } from "@spt/models/eft/inventory/IInventorySplitRequestData";
|
||||||
import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData";
|
import { IInventorySwapRequestData } from "@spt/models/eft/inventory/IInventorySwapRequestData";
|
||||||
import { IOpenRandomLootContainerRequestData } from "../models/eft/inventory/IOpenRandomLootContainerRequestData";
|
import { IInventoryTagRequestData } from "@spt/models/eft/inventory/IInventoryTagRequestData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IInventoryToggleRequestData } from "@spt/models/eft/inventory/IInventoryToggleRequestData";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IInventoryTransferRequestData } from "@spt/models/eft/inventory/IInventoryTransferRequestData";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { IOpenRandomLootContainerRequestData } from "@spt/models/eft/inventory/IOpenRandomLootContainerRequestData";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IPinOrLockItemRequest } from "@spt/models/eft/inventory/IPinOrLockItemRequest";
|
||||||
import { FenceService } from "../services/FenceService";
|
import { IRedeemProfileRequestData } from "@spt/models/eft/inventory/IRedeemProfileRequestData";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { ISetFavoriteItems } from "@spt/models/eft/inventory/ISetFavoriteItems";
|
||||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { ISptProfile } from "@spt/models/eft/profile/ISptProfile";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { FenceService } from "@spt/services/FenceService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { MapMarkerService } from "@spt/services/MapMarkerService";
|
||||||
|
import { PlayerService } from "@spt/services/PlayerService";
|
||||||
|
import { RagfairOfferService } from "@spt/services/RagfairOfferService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
export declare class InventoryController {
|
export declare class InventoryController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected jsonUtil: JsonUtil;
|
protected itemHelper: ItemHelper;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected fenceService: FenceService;
|
protected fenceService: FenceService;
|
||||||
protected presetHelper: PresetHelper;
|
protected presetHelper: PresetHelper;
|
||||||
protected inventoryHelper: InventoryHelper;
|
protected inventoryHelper: InventoryHelper;
|
||||||
|
protected questHelper: QuestHelper;
|
||||||
|
protected hideoutHelper: HideoutHelper;
|
||||||
protected ragfairOfferService: RagfairOfferService;
|
protected ragfairOfferService: RagfairOfferService;
|
||||||
|
protected mapMarkerService: MapMarkerService;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected weightedRandomHelper: WeightedRandomHelper;
|
|
||||||
protected paymentHelper: PaymentHelper;
|
protected paymentHelper: PaymentHelper;
|
||||||
|
protected traderHelper: TraderHelper;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
|
protected playerService: PlayerService;
|
||||||
|
protected lootGenerator: LootGenerator;
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
protected httpResponseUtil: HttpResponseUtil;
|
protected httpResponseUtil: HttpResponseUtil;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, weightedRandomHelper: WeightedRandomHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
|
protected cloner: ICloner;
|
||||||
|
constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseService: DatabaseService, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, hideoutHelper: HideoutHelper, ragfairOfferService: RagfairOfferService, mapMarkerService: MapMarkerService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil, cloner: ICloner);
|
||||||
/**
|
/**
|
||||||
* Move Item
|
* Move Item
|
||||||
* change location of item with parentId and slotId
|
* change location of item with parentId and slotId
|
||||||
@ -58,50 +73,68 @@ export declare class InventoryController {
|
|||||||
* @param pmcData Profile
|
* @param pmcData Profile
|
||||||
* @param moveRequest Move request data
|
* @param moveRequest Move request data
|
||||||
* @param sessionID Session id
|
* @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;
|
||||||
/**
|
/**
|
||||||
* Remove Item from Profile
|
* Get a event router response with inventory trader message
|
||||||
* Deep tree item deletion, also removes items from insurance list
|
* @param output Item event router response
|
||||||
|
* @returns Item event router response
|
||||||
*/
|
*/
|
||||||
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.)
|
* Implements functionality "Discard" from Main menu (Stash etc.)
|
||||||
* Removes item from PMC Profile
|
* Removes item from PMC Profile
|
||||||
*/
|
*/
|
||||||
discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse;
|
discardItem(pmcData: IPmcData, request: IInventoryRemoveRequestData, sessionID: string, output: IItemEventRouterResponse): void;
|
||||||
/**
|
/**
|
||||||
* Split Item
|
* Split Item
|
||||||
* spliting 1 item-stack into 2 separate items ...
|
* spliting 1 stack into 2
|
||||||
|
* @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile)
|
||||||
|
* @param request Split request
|
||||||
|
* @param sessionID Session/player id
|
||||||
|
* @param output Client response
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;
|
splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Merge Item
|
* Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer')
|
||||||
* merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with`
|
* Deletes item from `body.item` and adding number of stacks into `body.with`
|
||||||
|
* @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile)
|
||||||
|
* @param body Merge request
|
||||||
|
* @param sessionID Player id
|
||||||
|
* @param output Client response
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse;
|
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Transfer item
|
* TODO: Adds no data to output to send to client, is this by design?
|
||||||
|
* 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"
|
* 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
|
* Swap Item
|
||||||
* its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment
|
* its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment
|
||||||
|
* Also used to swap items using quick selection on character screen
|
||||||
*/
|
*/
|
||||||
swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse;
|
swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
|
||||||
* Give Item
|
|
||||||
* its used for "add" item like gifts etc.
|
|
||||||
*/
|
|
||||||
addItem(pmcData: IPmcData, body: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: any, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse;
|
|
||||||
/**
|
/**
|
||||||
* Handles folding of Weapons
|
* Handles folding of Weapons
|
||||||
*/
|
*/
|
||||||
foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
|
foldItem(pmcData: IPmcData, request: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Toggles "Toggleable" items like night vision goggles and face shields.
|
* Toggles "Toggleable" items like night vision goggles and face shields.
|
||||||
|
* @param pmcData player profile
|
||||||
|
* @param body Toggle request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
|
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
@ -112,35 +145,97 @@ export declare class InventoryController {
|
|||||||
* @returns client response object
|
* @returns client response object
|
||||||
*/
|
*/
|
||||||
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
|
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
/**
|
||||||
|
* Bind an inventory item to the quick access menu at bottom of player screen
|
||||||
|
* Handle bind event
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param bindRequest Reqeust object
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
bindItem(pmcData: IPmcData, bindRequest: IInventoryBindRequestData, sessionID: string): 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
|
* Handles examining an item
|
||||||
* @param pmcData player profile
|
* @param pmcData player profile
|
||||||
* @param body request object
|
* @param body request object
|
||||||
* @param sessionID session id
|
* @param sessionID session id
|
||||||
|
* @param output Client response
|
||||||
* @returns response
|
* @returns response
|
||||||
*/
|
*/
|
||||||
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse;
|
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Flag an item as seen in profiles encyclopedia + add inspect xp to profile
|
||||||
|
* @param itemTpls Inspected item tpls
|
||||||
|
* @param fullProfile Profile to add xp to
|
||||||
|
*/
|
||||||
|
protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], fullProfile: ISptProfile): void;
|
||||||
/**
|
/**
|
||||||
* Get the tplid of an item from the examine request object
|
* Get the tplid of an item from the examine request object
|
||||||
* @param body response request
|
* @param request Response request
|
||||||
* @returns tplid
|
* @returns tplId
|
||||||
*/
|
*/
|
||||||
protected getExaminedItemTpl(body: IInventoryExamineRequestData): string;
|
protected getExaminedItemTpl(request: IInventoryExamineRequestData): string;
|
||||||
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
|
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handles sorting of Inventory.
|
* Handle ApplyInventoryChanges
|
||||||
*/
|
* Sorts supplied items.
|
||||||
sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse;
|
* @param pmcData Player profile
|
||||||
createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
* @param request sort request
|
||||||
deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
/**
|
|
||||||
* 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 sessionID Session id
|
* @param sessionID Session id
|
||||||
|
*/
|
||||||
|
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
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, 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
|
||||||
|
* @param output Client response
|
||||||
|
*/
|
||||||
|
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
|
||||||
|
* @param output Client response
|
||||||
|
*/
|
||||||
|
editMapMarker(pmcData: IPmcData, request: IInventoryEditMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): void;
|
||||||
|
/**
|
||||||
|
* 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 sessionID Session id
|
||||||
|
* @param output Client response
|
||||||
|
*/
|
||||||
|
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;
|
||||||
|
/**
|
||||||
|
* Handle /client/game/profile/items/moving - PinLock
|
||||||
|
* Requires no response to client, only server change
|
||||||
|
* @param pmcData Players profile
|
||||||
|
* @param request Pin/Lock request data
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @param output data to send back to client
|
||||||
|
*/
|
||||||
|
pinOrLock(pmcData: IPmcData, request: IPinOrLockItemRequest, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
65
types/controllers/LauncherController.d.ts
vendored
65
types/controllers/LauncherController.d.ts
vendored
@ -1,28 +1,65 @@
|
|||||||
import { HttpServerHelper } from "../helpers/HttpServerHelper";
|
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";
|
||||||
import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData";
|
import { PreSptModLoader } from "@spt/loaders/PreSptModLoader";
|
||||||
import { IRegisterData } from "../models/eft/launcher/IRegisterData";
|
import { IChangeRequestData } from "@spt/models/eft/launcher/IChangeRequestData";
|
||||||
import { Info } from "../models/eft/profile/IAkiProfile";
|
import { ILoginRequestData } from "@spt/models/eft/launcher/ILoginRequestData";
|
||||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
import { IRegisterData } from "@spt/models/eft/launcher/IRegisterData";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IConnectResponse } from "@spt/models/eft/profile/IConnectResponse";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IModDetails, Info } from "@spt/models/eft/profile/ISptProfile";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData";
|
||||||
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
export declare class LauncherController {
|
export declare class LauncherController {
|
||||||
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
|
protected timeUtil: TimeUtil;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected httpServerHelper: HttpServerHelper;
|
protected httpServerHelper: HttpServerHelper;
|
||||||
protected databaseServer: DatabaseServer;
|
protected profileHelper: ProfileHelper;
|
||||||
|
protected databaseService: DatabaseService;
|
||||||
|
protected localisationService: LocalisationService;
|
||||||
|
protected preSptModLoader: PreSptModLoader;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected coreConfig: ICoreConfig;
|
protected coreConfig: ICoreConfig;
|
||||||
constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, configServer: ConfigServer);
|
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, preSptModLoader: PreSptModLoader, configServer: ConfigServer);
|
||||||
connect(): any;
|
connect(): IConnectResponse;
|
||||||
find(sessionIdKey: string): Info;
|
/**
|
||||||
|
* 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(sessionId: string): Info;
|
||||||
login(info: ILoginRequestData): string;
|
login(info: ILoginRequestData): string;
|
||||||
register(info: IRegisterData): string;
|
register(info: IRegisterData): string;
|
||||||
protected createAccount(info: IRegisterData): string;
|
protected createAccount(info: IRegisterData): string;
|
||||||
|
protected generateProfileId(): string;
|
||||||
|
protected formatID(timeStamp: number, counter: number): string;
|
||||||
changeUsername(info: IChangeRequestData): string;
|
changeUsername(info: IChangeRequestData): string;
|
||||||
changePassword(info: IChangeRequestData): string;
|
changePassword(info: IChangeRequestData): string;
|
||||||
|
/**
|
||||||
|
* Handle launcher requesting profile be wiped
|
||||||
|
* @param info IRegisterData
|
||||||
|
* @returns Session id
|
||||||
|
*/
|
||||||
wipe(info: IRegisterData): string;
|
wipe(info: IRegisterData): string;
|
||||||
getCompatibleTarkovVersion(): string;
|
getCompatibleTarkovVersion(): string;
|
||||||
|
/**
|
||||||
|
* Get the mods the server has currently loaded
|
||||||
|
* @returns Dictionary of mod name and mod details
|
||||||
|
*/
|
||||||
|
getLoadedServerMods(): Record<string, IPackageJsonData>;
|
||||||
|
/**
|
||||||
|
* Get the mods a profile has ever loaded into game with
|
||||||
|
* @param sessionId Player id
|
||||||
|
* @returns Array of mod details
|
||||||
|
*/
|
||||||
|
getServerModsProfileUsed(sessionId: string): IModDetails[];
|
||||||
}
|
}
|
||||||
|
50
types/controllers/LocationController.d.ts
vendored
50
types/controllers/LocationController.d.ts
vendored
@ -1,35 +1,27 @@
|
|||||||
import { LocationGenerator } from "../generators/LocationGenerator";
|
import { ILocationsGenerateAllResponse } from "@spt/models/eft/common/ILocationsSourceDestinationBase";
|
||||||
import { LootGenerator } from "../generators/LootGenerator";
|
import { IGetAirdropLootRequest } from "@spt/models/eft/location/IGetAirdropLootRequest";
|
||||||
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
import { IGetAirdropLootResponse } from "@spt/models/eft/location/IGetAirdropLootResponse";
|
||||||
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig";
|
||||||
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { LootItem } from "../models/spt/services/LootItem";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { AirdropService } from "@spt/services/AirdropService";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
|
||||||
export declare class LocationController {
|
export declare class LocationController {
|
||||||
protected jsonUtil: JsonUtil;
|
|
||||||
protected hashUtil: HashUtil;
|
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected locationGenerator: LocationGenerator;
|
protected databaseService: DatabaseService;
|
||||||
protected localisationService: LocalisationService;
|
protected airdropService: AirdropService;
|
||||||
protected lootGenerator: LootGenerator;
|
|
||||||
protected databaseServer: DatabaseServer;
|
|
||||||
protected timeUtil: TimeUtil;
|
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected airdropConfig: IAirdropConfig;
|
protected cloner: ICloner;
|
||||||
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
|
protected locationConfig: ILocationConfig;
|
||||||
get(location: string): ILocationBase;
|
constructor(logger: ILogger, databaseService: DatabaseService, airdropService: AirdropService, configServer: ConfigServer, cloner: ICloner);
|
||||||
generate(name: string): ILocationBase;
|
|
||||||
generateAll(): ILocationsGenerateAllResponse;
|
|
||||||
/**
|
/**
|
||||||
* Get loot for an airdop container
|
* Handle client/locations
|
||||||
* Generates it randomly based on config/airdrop.json values
|
* Get all maps base location properties without loot data
|
||||||
* @returns Array of LootItem
|
* @param sessionId Players Id
|
||||||
|
* @returns ILocationsGenerateAllResponse
|
||||||
*/
|
*/
|
||||||
getAirdropLoot(): LootItem[];
|
generateAll(sessionId: string): ILocationsGenerateAllResponse;
|
||||||
|
/** Handle client/airdrop/loot */
|
||||||
|
getAirdropLoot(request: IGetAirdropLootRequest): IGetAirdropLootResponse;
|
||||||
}
|
}
|
||||||
|
81
types/controllers/MatchController.d.ts
vendored
81
types/controllers/MatchController.d.ts
vendored
@ -1,57 +1,52 @@
|
|||||||
import { ApplicationContext } from "../context/ApplicationContext";
|
import { ApplicationContext } from "@spt/context/ApplicationContext";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { IEndLocalRaidRequestData } from "@spt/models/eft/match/IEndLocalRaidRequestData";
|
||||||
import { TraderHelper } from "../helpers/TraderHelper";
|
import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IMatchGroupStartGameRequest } from "@spt/models/eft/match/IMatchGroupStartGameRequest";
|
||||||
import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData";
|
import { IMatchGroupStatusRequest } from "@spt/models/eft/match/IMatchGroupStatusRequest";
|
||||||
import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData";
|
import { IMatchGroupStatusResponse } from "@spt/models/eft/match/IMatchGroupStatusResponse";
|
||||||
import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData";
|
import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResponse";
|
||||||
import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData";
|
import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData";
|
||||||
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
|
import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData";
|
||||||
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
|
import { IMatchConfig } from "@spt/models/spt/config/IMatchConfig";
|
||||||
import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData";
|
import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
||||||
import { BotDifficulty } from "../models/enums/BotDifficulty";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
import { IMatchConfig } from "../models/spt/config/IMatchConfig";
|
import { LocationLifecycleService } from "@spt/services/LocationLifecycleService";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { MatchLocationService } from "@spt/services/MatchLocationService";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
|
||||||
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
|
|
||||||
import { BotLootCacheService } from "../services/BotLootCacheService";
|
|
||||||
import { CustomLocationWaveService } from "../services/CustomLocationWaveService";
|
|
||||||
import { MatchLocationService } from "../services/MatchLocationService";
|
|
||||||
import { OpenZoneService } from "../services/OpenZoneService";
|
|
||||||
import { ProfileSnapshotService } from "../services/ProfileSnapshotService";
|
|
||||||
export declare class MatchController {
|
export declare class MatchController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected profileHelper: ProfileHelper;
|
|
||||||
protected matchLocationService: MatchLocationService;
|
protected matchLocationService: MatchLocationService;
|
||||||
protected traderHelper: TraderHelper;
|
|
||||||
protected botLootCacheService: BotLootCacheService;
|
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected profileSnapshotService: ProfileSnapshotService;
|
|
||||||
protected customLocationWaveService: CustomLocationWaveService;
|
|
||||||
protected openZoneService: OpenZoneService;
|
|
||||||
protected botGenerationCacheService: BotGenerationCacheService;
|
|
||||||
protected applicationContext: ApplicationContext;
|
protected applicationContext: ApplicationContext;
|
||||||
|
protected locationLifecycleService: LocationLifecycleService;
|
||||||
|
protected cloner: ICloner;
|
||||||
protected matchConfig: IMatchConfig;
|
protected matchConfig: IMatchConfig;
|
||||||
protected inraidConfig: IInRaidConfig;
|
protected pmcConfig: IPmcConfig;
|
||||||
protected botConfig: IBotConfig;
|
constructor(logger: ILogger, saveServer: SaveServer, matchLocationService: MatchLocationService, configServer: ConfigServer, applicationContext: ApplicationContext, locationLifecycleService: LocationLifecycleService, cloner: ICloner);
|
||||||
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext);
|
|
||||||
getEnabled(): boolean;
|
getEnabled(): boolean;
|
||||||
getProfile(info: IGetProfileRequestData): IPmcData[];
|
/** Handle client/match/group/delete */
|
||||||
createGroup(sessionID: string, info: ICreateGroupRequestData): any;
|
|
||||||
deleteGroup(info: any): void;
|
deleteGroup(info: any): void;
|
||||||
joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[];
|
/** Handle match/group/start_game */
|
||||||
protected getMatch(location: string): any;
|
joinMatch(info: IMatchGroupStartGameRequest, sessionId: string): IProfileStatusResponse;
|
||||||
getGroupStatus(info: IGetGroupStatusRequestData): any;
|
/** Handle client/match/group/status */
|
||||||
startOfflineRaid(info: IStartOfflineRaidRequestData, sessionID: string): void;
|
getGroupStatus(info: IMatchGroupStatusRequest): IMatchGroupStatusResponse;
|
||||||
|
/**
|
||||||
|
* Handle /client/raid/configuration
|
||||||
|
* @param request Raid config request
|
||||||
|
* @param sessionID Session id
|
||||||
|
*/
|
||||||
|
configureOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void;
|
||||||
/**
|
/**
|
||||||
* Convert a difficulty value from pre-raid screen to a bot difficulty
|
* Convert a difficulty value from pre-raid screen to a bot difficulty
|
||||||
* @param botDifficulty dropdown difficulty
|
* @param botDifficulty dropdown difficulty value
|
||||||
* @returns bot difficulty
|
* @returns bot difficulty
|
||||||
*/
|
*/
|
||||||
protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: BotDifficulty): string;
|
protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: string): string;
|
||||||
endOfflineRaid(info: IEndOfflineRaidRequestData, sessionID: string): void;
|
/** Handle client/match/local/start */
|
||||||
|
startLocalRaid(sessionId: string, request: IStartLocalRaidRequestData): IStartLocalRaidResponseData;
|
||||||
|
/** Handle client/match/local/end */
|
||||||
|
endLocalRaid(sessionId: string, request: IEndLocalRaidRequestData): void;
|
||||||
}
|
}
|
||||||
|
8
types/controllers/NoteController.d.ts
vendored
8
types/controllers/NoteController.d.ts
vendored
@ -1,7 +1,7 @@
|
|||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { INoteActionData } from "../models/eft/notes/INoteActionData";
|
import { INoteActionData } from "@spt/models/eft/notes/INoteActionData";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
|
||||||
export declare class NoteController {
|
export declare class NoteController {
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
constructor(eventOutputHolder: EventOutputHolder);
|
constructor(eventOutputHolder: EventOutputHolder);
|
||||||
|
9
types/controllers/NotifierController.d.ts
vendored
9
types/controllers/NotifierController.d.ts
vendored
@ -1,7 +1,7 @@
|
|||||||
import { NotifierHelper } from "../helpers/NotifierHelper";
|
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";
|
||||||
import { NotificationService } from "../services/NotificationService";
|
import { NotifierHelper } from "@spt/helpers/NotifierHelper";
|
||||||
import { INotifierChannel } from "../models/eft/notifier/INotifier";
|
import { INotifierChannel } from "@spt/models/eft/notifier/INotifier";
|
||||||
import { HttpServerHelper } from "../helpers/HttpServerHelper";
|
import { NotificationService } from "@spt/services/NotificationService";
|
||||||
export declare class NotifierController {
|
export declare class NotifierController {
|
||||||
protected notifierHelper: NotifierHelper;
|
protected notifierHelper: NotifierHelper;
|
||||||
protected httpServerHelper: HttpServerHelper;
|
protected httpServerHelper: HttpServerHelper;
|
||||||
@ -18,5 +18,6 @@ export declare class NotifierController {
|
|||||||
*/
|
*/
|
||||||
notifyAsync(sessionID: string): Promise<unknown>;
|
notifyAsync(sessionID: string): Promise<unknown>;
|
||||||
getServer(sessionID: string): string;
|
getServer(sessionID: string): string;
|
||||||
|
/** Handle client/notifier/channel/create */
|
||||||
getChannel(sessionID: string): INotifierChannel;
|
getChannel(sessionID: string): INotifierChannel;
|
||||||
}
|
}
|
||||||
|
18
types/controllers/PresetBuildController.d.ts
vendored
18
types/controllers/PresetBuildController.d.ts
vendored
@ -1,18 +0,0 @@
|
|||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
|
||||||
import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData";
|
|
||||||
import { WeaponBuild } from "../models/eft/profile/IAkiProfile";
|
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
|
||||||
export declare class PresetBuildController {
|
|
||||||
protected hashUtil: HashUtil;
|
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
|
||||||
protected itemHelper: ItemHelper;
|
|
||||||
protected saveServer: SaveServer;
|
|
||||||
constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer);
|
|
||||||
getUserBuilds(sessionID: string): WeaponBuild[];
|
|
||||||
saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
}
|
|
10
types/controllers/PresetController.d.ts
vendored
10
types/controllers/PresetController.d.ts
vendored
@ -1,8 +1,10 @@
|
|||||||
import { PresetHelper } from "../helpers/PresetHelper";
|
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
export declare class PresetController {
|
export declare class PresetController {
|
||||||
|
protected logger: ILogger;
|
||||||
protected presetHelper: PresetHelper;
|
protected presetHelper: PresetHelper;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
constructor(presetHelper: PresetHelper, databaseServer: DatabaseServer);
|
constructor(logger: ILogger, presetHelper: PresetHelper, databaseService: DatabaseService);
|
||||||
initialize(): void;
|
initialize(): void;
|
||||||
}
|
}
|
||||||
|
126
types/controllers/ProfileController.d.ts
vendored
126
types/controllers/ProfileController.d.ts
vendored
@ -1,44 +1,126 @@
|
|||||||
import { PlayerScavGenerator } from "../generators/PlayerScavGenerator";
|
import { PlayerScavGenerator } from "@spt/generators/PlayerScavGenerator";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { TraderHelper } from "../helpers/TraderHelper";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { QuestHelper } from "@spt/helpers/QuestHelper";
|
||||||
import { IMiniProfile } from "../models/eft/launcher/IMiniProfile";
|
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||||
import { IProfileChangeNicknameRequestData } from "../models/eft/profile/IProfileChangeNicknameRequestData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IProfileChangeVoiceRequestData } from "../models/eft/profile/IProfileChangeVoiceRequestData";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateRequestData";
|
import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile";
|
||||||
import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData";
|
import { IGetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData";
|
||||||
import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse";
|
import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest";
|
||||||
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
|
import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData";
|
||||||
import { ProfileFixerService } from "../services/ProfileFixerService";
|
import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { ISearchFriendRequestData } from "@spt/models/eft/profile/ISearchFriendRequestData";
|
||||||
|
import { ISearchFriendResponse } from "@spt/models/eft/profile/ISearchFriendResponse";
|
||||||
|
import { ISptProfile } from "@spt/models/eft/profile/ISptProfile";
|
||||||
|
import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData";
|
||||||
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
|
||||||
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { MailSendService } from "@spt/services/MailSendService";
|
||||||
|
import { ProfileFixerService } from "@spt/services/ProfileFixerService";
|
||||||
|
import { SeasonalEventService } from "@spt/services/SeasonalEventService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
export declare class ProfileController {
|
export declare class ProfileController {
|
||||||
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
|
protected cloner: ICloner;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected profileFixerService: ProfileFixerService;
|
protected profileFixerService: ProfileFixerService;
|
||||||
|
protected localisationService: LocalisationService;
|
||||||
|
protected seasonalEventService: SeasonalEventService;
|
||||||
|
protected mailSendService: MailSendService;
|
||||||
protected playerScavGenerator: PlayerScavGenerator;
|
protected playerScavGenerator: PlayerScavGenerator;
|
||||||
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
protected traderHelper: TraderHelper;
|
protected traderHelper: TraderHelper;
|
||||||
|
protected dialogueHelper: DialogueHelper;
|
||||||
|
protected questHelper: QuestHelper;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, profileHelper: ProfileHelper);
|
constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper);
|
||||||
|
/**
|
||||||
|
* Handle /launcher/profiles
|
||||||
|
*/
|
||||||
getMiniProfiles(): IMiniProfile[];
|
getMiniProfiles(): IMiniProfile[];
|
||||||
getMiniProfile(sessionID: string): any;
|
/**
|
||||||
|
* Handle launcher/profile/info
|
||||||
|
*/
|
||||||
|
getMiniProfile(sessionID: string): IMiniProfile;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/list
|
||||||
|
*/
|
||||||
getCompleteProfile(sessionID: string): IPmcData[];
|
getCompleteProfile(sessionID: string): IPmcData[];
|
||||||
createProfile(info: IProfileCreateRequestData, sessionID: string): void;
|
/**
|
||||||
|
* Handle client/game/profile/create
|
||||||
|
* @param info Client reqeust object
|
||||||
|
* @param sessionID Player id
|
||||||
|
* @returns Profiles _id value
|
||||||
|
*/
|
||||||
|
createProfile(info: IProfileCreateRequestData, sessionID: string): string;
|
||||||
|
/**
|
||||||
|
* make profiles pmcData.Inventory.equipment unique
|
||||||
|
* @param pmcData Profile to update
|
||||||
|
*/
|
||||||
|
protected updateInventoryEquipmentId(pmcData: IPmcData): void;
|
||||||
|
/**
|
||||||
|
* Delete a profile
|
||||||
|
* @param sessionID Id of profile to delete
|
||||||
|
*/
|
||||||
|
protected deleteProfileBySessionId(sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Iterate over all quests in player profile, inspect rewards for the quests current state (accepted/completed)
|
||||||
|
* and send rewards to them in mail
|
||||||
|
* @param profileDetails Player profile
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @param response Event router response
|
||||||
|
*/
|
||||||
|
protected givePlayerStartingQuestRewards(profileDetails: ISptProfile, sessionID: string, response: IItemEventRouterResponse): void;
|
||||||
|
/**
|
||||||
|
* For each trader reset their state to what a level 1 player would see
|
||||||
|
* @param sessionId Session id of profile to reset
|
||||||
|
*/
|
||||||
|
protected resetAllTradersInProfile(sessionId: string): void;
|
||||||
/**
|
/**
|
||||||
* Generate a player scav object
|
* Generate a player scav object
|
||||||
* pmc profile MUST exist first before pscav can be generated
|
* PMC profile MUST exist first before pscav can be generated
|
||||||
* @param sessionID
|
* @param sessionID
|
||||||
* @returns IPmcData object
|
* @returns IPmcData object
|
||||||
*/
|
*/
|
||||||
generatePlayerScav(sessionID: string): IPmcData;
|
generatePlayerScav(sessionID: string): IPmcData;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/nickname/validate
|
||||||
|
*/
|
||||||
validateNickname(info: IValidateNicknameRequestData, sessionID: string): string;
|
validateNickname(info: IValidateNicknameRequestData, sessionID: string): string;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/nickname/change event
|
||||||
|
* Client allows player to adjust their profile name
|
||||||
|
*/
|
||||||
changeNickname(info: IProfileChangeNicknameRequestData, sessionID: string): string;
|
changeNickname(info: IProfileChangeNicknameRequestData, sessionID: string): string;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/voice/change event
|
||||||
|
*/
|
||||||
changeVoice(info: IProfileChangeVoiceRequestData, sessionID: string): void;
|
changeVoice(info: IProfileChangeVoiceRequestData, sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/search
|
||||||
|
*/
|
||||||
getFriends(info: ISearchFriendRequestData, sessionID: string): ISearchFriendResponse[];
|
getFriends(info: ISearchFriendRequestData, sessionID: string): ISearchFriendResponse[];
|
||||||
|
/**
|
||||||
|
* Handle client/profile/status
|
||||||
|
*/
|
||||||
|
getProfileStatus(sessionId: string): IGetProfileStatusResponseData;
|
||||||
|
getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse;
|
||||||
|
/**
|
||||||
|
* Handle client/profile/settings
|
||||||
|
*/
|
||||||
|
setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): boolean;
|
||||||
}
|
}
|
||||||
|
123
types/controllers/QuestController.d.ts
vendored
123
types/controllers/QuestController.d.ts
vendored
@ -1,43 +1,52 @@
|
|||||||
import { DialogueHelper } from "../helpers/DialogueHelper";
|
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
|
import { QuestConditionHelper } from "@spt/helpers/QuestConditionHelper";
|
||||||
import { QuestHelper } from "../helpers/QuestHelper";
|
import { QuestHelper } from "@spt/helpers/QuestHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||||
import { IQuest, Reward } from "../models/eft/common/tables/IQuest";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
|
import { IItem } from "@spt/models/eft/common/tables/IItem";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IQuest, IQuestCondition } from "@spt/models/eft/common/tables/IQuest";
|
||||||
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
|
import { IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests";
|
||||||
import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData";
|
import { IAcceptQuestRequestData } from "@spt/models/eft/quests/IAcceptQuestRequestData";
|
||||||
import { IQuestConfig } from "../models/spt/config/IQuestConfig";
|
import { ICompleteQuestRequestData } from "@spt/models/eft/quests/ICompleteQuestRequestData";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IFailQuestRequestData } from "@spt/models/eft/quests/IFailQuestRequestData";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { IHandoverQuestRequestData } from "@spt/models/eft/quests/IHandoverQuestRequestData";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { LocaleService } from "../services/LocaleService";
|
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { PlayerService } from "../services/PlayerService";
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { LocaleService } from "@spt/services/LocaleService";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { MailSendService } from "@spt/services/MailSendService";
|
||||||
|
import { PlayerService } from "@spt/services/PlayerService";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
export declare class QuestController {
|
export declare class QuestController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected httpResponseUtil: HttpResponseUtil;
|
protected httpResponseUtil: HttpResponseUtil;
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected dialogueHelper: DialogueHelper;
|
protected dialogueHelper: DialogueHelper;
|
||||||
|
protected mailSendService: MailSendService;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
|
protected traderHelper: TraderHelper;
|
||||||
protected questHelper: QuestHelper;
|
protected questHelper: QuestHelper;
|
||||||
protected questConditionHelper: QuestConditionHelper;
|
protected questConditionHelper: QuestConditionHelper;
|
||||||
protected playerService: PlayerService;
|
protected playerService: PlayerService;
|
||||||
protected localeService: LocaleService;
|
protected localeService: LocaleService;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected cloner: ICloner;
|
||||||
protected questConfig: IQuestConfig;
|
protected questConfig: IQuestConfig;
|
||||||
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer);
|
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner);
|
||||||
/**
|
/**
|
||||||
|
* Handle client/quest/list
|
||||||
* Get all quests visible to player
|
* Get all quests visible to player
|
||||||
* Exclude quests with incomplete preconditions (level/loyalty)
|
* Exclude quests with incomplete preconditions (level/loyalty)
|
||||||
* @param sessionID session id
|
* @param sessionID session id
|
||||||
@ -45,28 +54,23 @@ export declare class QuestController {
|
|||||||
*/
|
*/
|
||||||
getClientQuests(sessionID: string): IQuest[];
|
getClientQuests(sessionID: string): IQuest[];
|
||||||
/**
|
/**
|
||||||
* Is the quest for the opposite side the player is on
|
* Handle QuestAccept event
|
||||||
* @param side player side (usec/bear)
|
|
||||||
* @param questId questId to check
|
|
||||||
*/
|
|
||||||
protected questIsForOtherSide(side: string, questId: string): boolean;
|
|
||||||
/**
|
|
||||||
* Handle the client accepting a quest and starting it
|
* Handle the client accepting a quest and starting it
|
||||||
* Send starting rewards if any to player and
|
* Send starting rewards if any to player and
|
||||||
* Send start notification if any to player
|
* Send start notification if any to player
|
||||||
* @param pmcData Profile to update
|
* @param pmcData Profile to update
|
||||||
* @param acceptedQuest Quest accepted
|
* @param acceptedQuest Quest accepted
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
* @returns client response
|
* @returns Client response
|
||||||
*/
|
*/
|
||||||
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead
|
*
|
||||||
* @param startedMessageTextId startedMessageText property from IQuest
|
* @param questConditions Conditions to iterate over and possibly add to profile
|
||||||
* @param questDescriptionId description property from IQuest
|
* @param pmcData Profile to add to
|
||||||
* @returns message id
|
* @param questId Quest conditions came from
|
||||||
*/
|
*/
|
||||||
protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string;
|
protected addTaskConditionCountersToProfile(questConditions: IQuestCondition[], pmcData: IPmcData, questId: string): void;
|
||||||
/**
|
/**
|
||||||
* Handle the client accepting a repeatable quest and starting it
|
* Handle the client accepting a repeatable quest and starting it
|
||||||
* Send starting rewards if any to player and
|
* Send starting rewards if any to player and
|
||||||
@ -77,6 +81,7 @@ export declare class QuestController {
|
|||||||
* @returns IItemEventRouterResponse
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Look for an accepted quest inside player profile, return matching
|
* Look for an accepted quest inside player profile, return matching
|
||||||
* @param pmcData Profile to search through
|
* @param pmcData Profile to search through
|
||||||
@ -85,9 +90,10 @@ export declare class QuestController {
|
|||||||
*/
|
*/
|
||||||
protected getRepeatableQuestFromProfile(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData): IRepeatableQuest;
|
protected getRepeatableQuestFromProfile(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData): IRepeatableQuest;
|
||||||
/**
|
/**
|
||||||
|
* Handle QuestComplete event
|
||||||
* Update completed quest in profile
|
* Update completed quest in profile
|
||||||
* Add newly unlocked quests to profile
|
* Add newly unlocked quests to profile
|
||||||
* Also recalculate thier level due to exp rewards
|
* Also recalculate their level due to exp rewards
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param body Completed quest request
|
* @param body Completed quest request
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
@ -95,28 +101,29 @@ export declare class QuestController {
|
|||||||
*/
|
*/
|
||||||
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Send a popup to player on successful completion of a quest
|
* Handle QuestHandover event
|
||||||
* @param sessionID session id
|
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param completedQuestId Completed quest id
|
* @param handoverQuestRequest handover item request
|
||||||
* @param questRewards Rewards given to player
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Reward[]): void;
|
handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Returns a list of quests that should be failed when a quest is completed
|
* Show warning to user and write to log that repeatable quest failed a condition check
|
||||||
* @param completedQuestId quest completed id
|
* @param handoverQuestRequest Quest request
|
||||||
* @returns array of quests
|
* @param output Response to send to user
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
protected getQuestsFailedByCompletingQuest(completedQuestId: string): IQuest[];
|
protected showRepeatableQuestInvalidConditionError(handoverQuestRequest: IHandoverQuestRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Fail the quests provided
|
* Show warning to user and write to log quest item handed over did not match what is required
|
||||||
* Update quest in profile, otherwise add fresh quest object with failed status
|
* @param handoverQuestRequest Quest request
|
||||||
* @param sessionID session id
|
* @param itemHandedOver Non-matching item found
|
||||||
* @param pmcData player profile
|
* @param handoverRequirements Quest handover requirements
|
||||||
* @param questsToFail quests to fail
|
* @param output Response to send to user
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void;
|
protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: IItem, handoverRequirements: IQuestCondition, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
|
||||||
/**
|
/**
|
||||||
* Increment a backend counter stored value by an amount,
|
* Increment a backend counter stored value by an amount,
|
||||||
* Create counter if it does not exist
|
* Create counter if it does not exist
|
||||||
@ -125,5 +132,13 @@ export declare class QuestController {
|
|||||||
* @param questId quest id counter is associated with
|
* @param questId quest id counter is associated with
|
||||||
* @param counterValue value to increment the backend counter with
|
* @param counterValue value to increment the backend counter with
|
||||||
*/
|
*/
|
||||||
protected updateProfileBackendCounterValue(pmcData: IPmcData, conditionId: string, questId: string, counterValue: number): void;
|
protected updateProfileTaskConditionCounterValue(pmcData: IPmcData, conditionId: string, questId: string, counterValue: number): void;
|
||||||
|
/**
|
||||||
|
* Handle /client/game/profile/items/moving - QuestFail
|
||||||
|
* @param pmcData Pmc profile
|
||||||
|
* @param request Fail qeust request
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
failQuest(pmcData: IPmcData, request: IFailQuestRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
256
types/controllers/RagfairController.d.ts
vendored
256
types/controllers/RagfairController.d.ts
vendored
@ -1,41 +1,45 @@
|
|||||||
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
|
import { RagfairOfferGenerator } from "@spt/generators/RagfairOfferGenerator";
|
||||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
import { HandbookHelper } from "@spt/helpers/HandbookHelper";
|
||||||
import { InventoryHelper } from "../helpers/InventoryHelper";
|
import { InventoryHelper } from "@spt/helpers/InventoryHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { PaymentHelper } from "../helpers/PaymentHelper";
|
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { RagfairHelper } from "../helpers/RagfairHelper";
|
import { RagfairHelper } from "@spt/helpers/RagfairHelper";
|
||||||
import { RagfairOfferHelper } from "../helpers/RagfairOfferHelper";
|
import { RagfairOfferHelper } from "@spt/helpers/RagfairOfferHelper";
|
||||||
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
|
import { RagfairSellHelper } from "@spt/helpers/RagfairSellHelper";
|
||||||
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
|
import { RagfairSortHelper } from "@spt/helpers/RagfairSortHelper";
|
||||||
import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
|
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||||
import { TraderHelper } from "../helpers/TraderHelper";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IItem } from "@spt/models/eft/common/tables/IItem";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { ITraderAssort } from "@spt/models/eft/common/tables/ITrader";
|
||||||
import { ITraderAssort } from "../models/eft/common/tables/ITrader";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { ISptProfile } from "@spt/models/eft/profile/ISptProfile";
|
||||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
import { IAddOfferRequestData, IRequirement } from "@spt/models/eft/ragfair/IAddOfferRequestData";
|
||||||
import { IAddOfferRequestData, Requirement } from "../models/eft/ragfair/IAddOfferRequestData";
|
import { IExtendOfferRequestData } from "@spt/models/eft/ragfair/IExtendOfferRequestData";
|
||||||
import { IExtendOfferRequestData } from "../models/eft/ragfair/IExtendOfferRequestData";
|
import { IGetItemPriceResult } from "@spt/models/eft/ragfair/IGetItemPriceResult";
|
||||||
import { IGetItemPriceResult } from "../models/eft/ragfair/IGetItemPriceResult";
|
import { IGetMarketPriceRequestData } from "@spt/models/eft/ragfair/IGetMarketPriceRequestData";
|
||||||
import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPriceRequestData";
|
import { IGetOffersResult } from "@spt/models/eft/ragfair/IGetOffersResult";
|
||||||
import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
|
import { IGetRagfairOfferByIdRequest } from "@spt/models/eft/ragfair/IGetRagfairOfferByIdRequest";
|
||||||
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
|
import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer";
|
||||||
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
|
import { IRemoveOfferRequestData } from "@spt/models/eft/ragfair/IRemoveOfferRequestData";
|
||||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IProcessBuyTradeRequestData } from "@spt/models/eft/trade/IProcessBuyTradeRequestData";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { FleaOfferType } from "@spt/models/enums/FleaOfferType";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { RagfairServer } from "../servers/RagfairServer";
|
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { RagfairServer } from "@spt/servers/RagfairServer";
|
||||||
import { PaymentService } from "../services/PaymentService";
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
import { RagfairPriceService } from "../services/RagfairPriceService";
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
|
import { PaymentService } from "@spt/services/PaymentService";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { RagfairOfferService } from "@spt/services/RagfairOfferService";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { RagfairPriceService } from "@spt/services/RagfairPriceService";
|
||||||
|
import { RagfairRequiredItemsService } from "@spt/services/RagfairRequiredItemsService";
|
||||||
|
import { RagfairTaxService } from "@spt/services/RagfairTaxService";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
/**
|
/**
|
||||||
* Handle RagfairCallback events
|
* Handle RagfairCallback events
|
||||||
*/
|
*/
|
||||||
@ -46,11 +50,11 @@ export declare class RagfairController {
|
|||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
protected ragfairServer: RagfairServer;
|
protected ragfairServer: RagfairServer;
|
||||||
protected ragfairPriceService: RagfairPriceService;
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected ragfairSellHelper: RagfairSellHelper;
|
protected ragfairSellHelper: RagfairSellHelper;
|
||||||
protected ragfairTaxHelper: RagfairTaxHelper;
|
protected ragfairTaxService: RagfairTaxService;
|
||||||
protected ragfairSortHelper: RagfairSortHelper;
|
protected ragfairSortHelper: RagfairSortHelper;
|
||||||
protected ragfairOfferHelper: RagfairOfferHelper;
|
protected ragfairOfferHelper: RagfairOfferHelper;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
@ -66,12 +70,27 @@ export declare class RagfairController {
|
|||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
|
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseService: DatabaseService, 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;
|
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
|
* Get offers for the client based on type of search being performed
|
||||||
* @param searchRequest Client search request data
|
* @param searchRequest Client search request data
|
||||||
* @param itemsToAdd
|
* @param itemsToAdd Comes from ragfairHelper.filterCategories()
|
||||||
* @param traderAssorts Trader assorts
|
* @param traderAssorts Trader assorts
|
||||||
* @param pmcProfile Player profile
|
* @param pmcProfile Player profile
|
||||||
* @returns array of offers
|
* @returns array of offers
|
||||||
@ -80,18 +99,10 @@ export declare class RagfairController {
|
|||||||
/**
|
/**
|
||||||
* Get categories for the type of search being performed, linked/required/all
|
* Get categories for the type of search being performed, linked/required/all
|
||||||
* @param searchRequest Client search request data
|
* @param searchRequest Client search request data
|
||||||
* @param offers ragfair offers to get categories for
|
* @param offers Ragfair offers to get categories for
|
||||||
* @returns record with tpls + counts
|
* @returns record with templates + counts
|
||||||
*/
|
*/
|
||||||
protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
|
protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
|
||||||
/**
|
|
||||||
* Add Required offers to offers result
|
|
||||||
* @param searchRequest Client search request data
|
|
||||||
* @param assorts
|
|
||||||
* @param pmcProfile Player profile
|
|
||||||
* @param result Result object being sent back to client
|
|
||||||
*/
|
|
||||||
protected addRequiredOffersToResult(searchRequest: ISearchRequestData, assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData, result: IGetOffersResult): void;
|
|
||||||
/**
|
/**
|
||||||
* Add index to all offers passed in (0-indexed)
|
* Add index to all offers passed in (0-indexed)
|
||||||
* @param offers Offers to add index value to
|
* @param offers Offers to add index value to
|
||||||
@ -99,22 +110,143 @@ export declare class RagfairController {
|
|||||||
protected addIndexValueToOffers(offers: IRagfairOffer[]): void;
|
protected addIndexValueToOffers(offers: IRagfairOffer[]): void;
|
||||||
/**
|
/**
|
||||||
* Update a trader flea offer with buy restrictions stored in the traders assort
|
* Update a trader flea offer with buy restrictions stored in the traders assort
|
||||||
* @param offer flea offer to update
|
* @param offer Flea offer to update
|
||||||
* @param profile full profile of player
|
* @param fullProfile Players full profile
|
||||||
|
*/
|
||||||
|
protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, fullProfile: ISptProfile): void;
|
||||||
|
/**
|
||||||
|
* Adjust ragfair offer stack count to match same value as traders assort stack count
|
||||||
|
* @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 setTraderOfferPurchaseLimits(offer: IRagfairOffer, profile: IAkiProfile): void;
|
|
||||||
protected isLinkedSearch(info: ISearchRequestData): boolean;
|
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;
|
protected isRequiredSearch(info: ISearchRequestData): boolean;
|
||||||
|
/**
|
||||||
|
* Check all profiles and sell player offers / send player money for listing if it sold
|
||||||
|
*/
|
||||||
update(): void;
|
update(): void;
|
||||||
/**
|
/**
|
||||||
* Called when creating an offer on flea, fills values in top right corner
|
* Called when creating an offer on flea, fills values in top right corner
|
||||||
* @param getPriceRequest
|
* @param getPriceRequest Client request object
|
||||||
|
* @param ignoreTraderOffers Should trader offers be ignored in the calcualtion
|
||||||
* @returns min/avg/max values for an item based on flea offers available
|
* @returns min/avg/max values for an item based on flea offers available
|
||||||
*/
|
*/
|
||||||
getItemMinAvgMaxFleaPriceValues(getPriceRequest: IGetMarketPriceRequestData): IGetItemPriceResult;
|
getItemMinAvgMaxFleaPriceValues(getPriceRequest: IGetMarketPriceRequestData, ignoreTraderOffers?: boolean): IGetItemPriceResult;
|
||||||
addPlayerOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
/**
|
||||||
createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer;
|
* List item(s) on flea for sale
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param offerRequest Flea list creation offer
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
addPlayerOffer(pmcData: IPmcData, offerRequest: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Create a flea offer for a single item - uncludes an item with > 1 sized stack
|
||||||
|
* e.g. 1 ammo stack of 30 cartridges
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @param offerRequest Offer request from client
|
||||||
|
* @param fullProfile Full profile of player
|
||||||
|
* @param output Response to send to client
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
protected createSingleOffer(sessionID: string, offerRequest: IAddOfferRequestData, fullProfile: ISptProfile, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Create a flea offer for multiples of the same item, can be single items or items with multiple in the stack
|
||||||
|
* e.g. 2 ammo stacks of 30 cartridges each
|
||||||
|
* Each item can be purchsed individually
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @param offerRequest Offer request from client
|
||||||
|
* @param fullProfile Full profile of player
|
||||||
|
* @param output Response to send to client
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
protected createMultiOffer(sessionID: string, offerRequest: IAddOfferRequestData, fullProfile: ISptProfile, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Create a flea offer for multiple items, can be single items or items with multiple in the stack
|
||||||
|
* e.g. 2 ammo stacks of 30 cartridges each
|
||||||
|
* The entire package must be purchased in one go
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @param offerRequest Offer request from client
|
||||||
|
* @param fullProfile Full profile of player
|
||||||
|
* @param output Response to send to client
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
protected createPackOffer(sessionID: string, offerRequest: IAddOfferRequestData, fullProfile: ISptProfile, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Given a client request, determine what type of offer is being created
|
||||||
|
* single/multi/pack
|
||||||
|
* @param offerRequest Client request
|
||||||
|
* @returns FleaOfferType
|
||||||
|
*/
|
||||||
|
protected getOfferType(offerRequest: IAddOfferRequestData): FleaOfferType;
|
||||||
|
/**
|
||||||
|
* Charge player a listing fee for using flea, pulls charge from data previously sent by client
|
||||||
|
* @param sessionID Player id
|
||||||
|
* @param rootItem Base item being listed (used when client tax cost not found and must be done on server)
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param requirementsPriceInRub Rouble cost player chose for listing (used when client tax cost not found and must be done on server)
|
||||||
|
* @param itemStackCount How many items were listed by player (used when client tax cost not found and must be done on server)
|
||||||
|
* @param offerRequest Add offer request object from client
|
||||||
|
* @param output IItemEventRouterResponse
|
||||||
|
* @returns True if charging tax to player failed
|
||||||
|
*/
|
||||||
|
protected chargePlayerTaxFee(sessionID: string, rootItem: IItem, pmcData: IPmcData, requirementsPriceInRub: number, itemStackCount: number, offerRequest: IAddOfferRequestData, output: IItemEventRouterResponse): boolean;
|
||||||
|
/**
|
||||||
|
* Is the item to be listed on the flea valid
|
||||||
|
* @param offerRequest Client offer request
|
||||||
|
* @param errorMessage message to show to player when offer is invalid
|
||||||
|
* @returns Is offer valid
|
||||||
|
*/
|
||||||
|
protected isValidPlayerOfferRequest(offerRequest: IAddOfferRequestData, errorMessage: string): boolean;
|
||||||
|
/**
|
||||||
|
* Get the handbook price in roubles for the items being listed
|
||||||
|
* @param requirements
|
||||||
|
* @returns Rouble price
|
||||||
|
*/
|
||||||
|
protected calculateRequirementsPriceInRub(requirements: IRequirement[]): number;
|
||||||
|
/**
|
||||||
|
* Using item ids from flea offer request, find corresponding items from player inventory and return as array
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param itemIdsFromFleaOfferRequest Ids from request
|
||||||
|
* @returns Array of items from player inventory
|
||||||
|
*/
|
||||||
|
protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): {
|
||||||
|
items: IItem[][] | undefined;
|
||||||
|
errorMessage: string | undefined;
|
||||||
|
};
|
||||||
|
createPlayerOffer(sessionId: string, requirements: IRequirement[], items: IItem[], sellInOnePiece: boolean): IRagfairOffer;
|
||||||
getAllFleaPrices(): Record<string, number>;
|
getAllFleaPrices(): Record<string, number>;
|
||||||
removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse;
|
getStaticPrices(): Record<string, number>;
|
||||||
extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
/**
|
||||||
|
* User requested removal of the offer, actually reduces the time to 71 seconds,
|
||||||
|
* allowing for the possibility of extending the auction before it's end time
|
||||||
|
* @param removeRequest Remove offer request
|
||||||
|
* @param sessionId Players id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
removeOffer(removeRequest: IRemoveOfferRequestData, sessionId: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Extend a ragfair offers listing time
|
||||||
|
* @param extendRequest Extend offer request
|
||||||
|
* @param sessionId Players id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
extendOffer(extendRequest: IExtendOfferRequestData, sessionId: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Create a basic trader request object with price and currency type
|
||||||
|
* @param currency What currency: RUB, EURO, USD
|
||||||
|
* @param value Amount of currency
|
||||||
|
* @returns IProcessBuyTradeRequestData
|
||||||
|
*/
|
||||||
|
protected createBuyTradeRequestObject(currency: string, value: number): IProcessBuyTradeRequestData;
|
||||||
}
|
}
|
||||||
|
34
types/controllers/RepairController.d.ts
vendored
34
types/controllers/RepairController.d.ts
vendored
@ -1,28 +1,31 @@
|
|||||||
import { QuestHelper } from "../helpers/QuestHelper";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { RepairHelper } from "../helpers/RepairHelper";
|
import { QuestHelper } from "@spt/helpers/QuestHelper";
|
||||||
import { TraderHelper } from "../helpers/TraderHelper";
|
import { RepairHelper } from "@spt/helpers/RepairHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionDataRequest";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest";
|
import { IRepairActionDataRequest } from "@spt/models/eft/repair/IRepairActionDataRequest";
|
||||||
import { IRepairConfig } from "../models/spt/config/IRepairConfig";
|
import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRepairActionDataRequest";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
|
||||||
import { PaymentService } from "../services/PaymentService";
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
import { RepairService } from "../services/RepairService";
|
import { PaymentService } from "@spt/services/PaymentService";
|
||||||
|
import { RepairService } from "@spt/services/RepairService";
|
||||||
export declare class RepairController {
|
export declare class RepairController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected questHelper: QuestHelper;
|
protected questHelper: QuestHelper;
|
||||||
protected traderHelper: TraderHelper;
|
protected traderHelper: TraderHelper;
|
||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected repairHelper: RepairHelper;
|
protected repairHelper: RepairHelper;
|
||||||
protected repairService: RepairService;
|
protected repairService: RepairService;
|
||||||
|
protected profileHelper: ProfileHelper;
|
||||||
protected repairConfig: IRepairConfig;
|
protected repairConfig: IRepairConfig;
|
||||||
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService);
|
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper);
|
||||||
/**
|
/**
|
||||||
|
* Handle TraderRepair event
|
||||||
* Repair with trader
|
* Repair with trader
|
||||||
* @param sessionID session id
|
* @param sessionID session id
|
||||||
* @param body endpoint request data
|
* @param body endpoint request data
|
||||||
@ -31,6 +34,7 @@ export declare class RepairController {
|
|||||||
*/
|
*/
|
||||||
traderRepair(sessionID: string, body: ITraderRepairActionDataRequest, pmcData: IPmcData): IItemEventRouterResponse;
|
traderRepair(sessionID: string, body: ITraderRepairActionDataRequest, pmcData: IPmcData): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
|
* Handle Repair event
|
||||||
* Repair with repair kit
|
* Repair with repair kit
|
||||||
* @param sessionID session id
|
* @param sessionID session id
|
||||||
* @param body endpoint request data
|
* @param body endpoint request data
|
||||||
|
303
types/controllers/RepeatableQuestController.d.ts
vendored
303
types/controllers/RepeatableQuestController.d.ts
vendored
@ -1,81 +1,49 @@
|
|||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerator";
|
||||||
import { PresetHelper } from "../helpers/PresetHelper";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { QuestHelper } from "@spt/helpers/QuestHelper";
|
||||||
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
|
import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { Exit } from "../models/eft/common/ILocationBase";
|
import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { TraderInfo } from "../models/eft/common/tables/IBotBase";
|
import { ISptProfile } from "@spt/models/eft/profile/ISptProfile";
|
||||||
import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPmcDataRepeatableQuest, IRepeatableQuest, IReward, IRewards } from "../models/eft/common/tables/IRepeatableQuests";
|
import { IRepeatableQuestChangeRequest } from "@spt/models/eft/quests/IRepeatableQuestChangeRequest";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
import { ELocationName } from "@spt/models/enums/ELocationName";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig";
|
||||||
import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest";
|
import { IGetRepeatableByIdResult } from "@spt/models/spt/quests/IGetRepeatableByIdResult";
|
||||||
import { ELocationName } from "../models/enums/ELocationName";
|
import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool";
|
||||||
import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
import { ItemFilterService } from "../services/ItemFilterService";
|
import { PaymentService } from "@spt/services/PaymentService";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { ProfileFixerService } from "@spt/services/ProfileFixerService";
|
||||||
import { PaymentService } from "../services/PaymentService";
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
import { ProfileFixerService } from "../services/ProfileFixerService";
|
import { ObjectId } from "@spt/utils/ObjectId";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
import { MathUtil } from "../utils/MathUtil";
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
import { ObjectId } from "../utils/ObjectId";
|
|
||||||
import { ProbabilityObject, ProbabilityObjectArray, RandomUtil } from "../utils/RandomUtil";
|
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
|
||||||
export interface IQuestTypePool {
|
|
||||||
types: string[];
|
|
||||||
pool: IQuestPool;
|
|
||||||
}
|
|
||||||
export interface IQuestPool {
|
|
||||||
Exploration: IExplorationPool;
|
|
||||||
Elimination: IEliminationPool;
|
|
||||||
}
|
|
||||||
export interface IExplorationPool {
|
|
||||||
locations: Partial<Record<ELocationName, string[]>>;
|
|
||||||
}
|
|
||||||
export interface IEliminationPool {
|
|
||||||
targets: IEliminationTargetPool;
|
|
||||||
}
|
|
||||||
export interface IEliminationTargetPool {
|
|
||||||
Savage?: ITargetLocation;
|
|
||||||
AnyPmc?: ITargetLocation;
|
|
||||||
bossBully?: ITargetLocation;
|
|
||||||
bossGluhar?: ITargetLocation;
|
|
||||||
bossKilla?: ITargetLocation;
|
|
||||||
bossSanitar?: ITargetLocation;
|
|
||||||
bossTagilla?: ITargetLocation;
|
|
||||||
bossKojaniy?: ITargetLocation;
|
|
||||||
}
|
|
||||||
export interface ITargetLocation {
|
|
||||||
locations: string[];
|
|
||||||
}
|
|
||||||
export declare class RepeatableQuestController {
|
export declare class RepeatableQuestController {
|
||||||
protected timeUtil: TimeUtil;
|
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
|
protected databaseService: DatabaseService;
|
||||||
|
protected timeUtil: TimeUtil;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected mathUtil: MathUtil;
|
|
||||||
protected jsonUtil: JsonUtil;
|
|
||||||
protected databaseServer: DatabaseServer;
|
|
||||||
protected itemHelper: ItemHelper;
|
|
||||||
protected presetHelper: PresetHelper;
|
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected profileFixerService: ProfileFixerService;
|
protected profileFixerService: ProfileFixerService;
|
||||||
protected ragfairServerHelper: RagfairServerHelper;
|
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected objectId: ObjectId;
|
protected objectId: ObjectId;
|
||||||
protected itemFilterService: ItemFilterService;
|
protected repeatableQuestGenerator: RepeatableQuestGenerator;
|
||||||
|
protected repeatableQuestHelper: RepeatableQuestHelper;
|
||||||
|
protected questHelper: QuestHelper;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected cloner: ICloner;
|
||||||
protected questConfig: IQuestConfig;
|
protected questConfig: IQuestConfig;
|
||||||
constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer, cloner: ICloner);
|
||||||
/**
|
/**
|
||||||
* This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint
|
* Handle client/repeatalbeQuests/activityPeriods
|
||||||
* Returns an array of objects in the format of repeatable quests to the client.
|
* Returns an array of objects in the format of repeatable quests to the client.
|
||||||
* repeatableQuestObject = {
|
* repeatableQuestObject = {
|
||||||
* id: Unique Id,
|
* id: Unique Id,
|
||||||
@ -95,11 +63,44 @@ export declare class RepeatableQuestController {
|
|||||||
* (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards)
|
* (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards)
|
||||||
* The new quests generated are again persisted in profile.RepeatableQuests
|
* The new quests generated are again persisted in profile.RepeatableQuests
|
||||||
*
|
*
|
||||||
|
* @param {string} sessionID Player's session id
|
||||||
*
|
*
|
||||||
* @param {string} sessionId Player's session id
|
* @returns {array} Array of "repeatableQuestObjects" as described above
|
||||||
* @returns {array} array of "repeatableQuestObjects" as descibed above
|
|
||||||
*/
|
*/
|
||||||
getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[];
|
getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[];
|
||||||
|
/**
|
||||||
|
* Expire quests and replace expired quests with ready-to-hand-in quests inside generatedRepeatables.activeQuests
|
||||||
|
* @param generatedRepeatables Repeatables to process (daily/weekly)
|
||||||
|
* @param pmcData Player profile
|
||||||
|
*/
|
||||||
|
protected processExpiredQuests(generatedRepeatables: IPmcDataRepeatableQuest, pmcData: IPmcData): void;
|
||||||
|
/**
|
||||||
|
* Check if a repeatable quest type (daily/weekly) is active for the given profile
|
||||||
|
* @param repeatableConfig Repeatable quest config
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @returns True if profile is allowed to access dailies
|
||||||
|
*/
|
||||||
|
protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean;
|
||||||
|
/**
|
||||||
|
* Does player have daily scav quests unlocked
|
||||||
|
* @param pmcData Player profile to check
|
||||||
|
* @returns True if unlocked
|
||||||
|
*/
|
||||||
|
protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean;
|
||||||
|
/**
|
||||||
|
* Does player have daily pmc quests unlocked
|
||||||
|
* @param pmcData Player profile to check
|
||||||
|
* @param repeatableConfig Config of daily type to check
|
||||||
|
* @returns True if unlocked
|
||||||
|
*/
|
||||||
|
protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean;
|
||||||
|
/**
|
||||||
|
* Get the number of quests to generate - takes into account charisma state of player
|
||||||
|
* @param repeatableConfig Config
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @returns Quest count
|
||||||
|
*/
|
||||||
|
protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number;
|
||||||
/**
|
/**
|
||||||
* Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists
|
* Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists
|
||||||
* @param repeatableConfig daily/weekly config
|
* @param repeatableConfig daily/weekly config
|
||||||
@ -107,146 +108,60 @@ export declare class RepeatableQuestController {
|
|||||||
* @returns IPmcDataRepeatableQuest
|
* @returns IPmcDataRepeatableQuest
|
||||||
*/
|
*/
|
||||||
protected getRepeatableQuestSubTypeFromProfile(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): IPmcDataRepeatableQuest;
|
protected getRepeatableQuestSubTypeFromProfile(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): IPmcDataRepeatableQuest;
|
||||||
/**
|
|
||||||
* This method is called by GetClientRepeatableQuests and creates one element of quest type format (see assets/database/templates/repeatableQuests.json).
|
|
||||||
* It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest
|
|
||||||
*/
|
|
||||||
generateRepeatableQuest(pmcLevel: number, pmcTraderInfo: Record<string, TraderInfo>, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
|
|
||||||
/**
|
/**
|
||||||
* Just for debug reasons. Draws dailies a random assort of dailies extracted from dumps
|
* Just for debug reasons. Draws dailies a random assort of dailies extracted from dumps
|
||||||
*/
|
*/
|
||||||
generateDebugDailies(dailiesPool: any, factory: any, number: any): any;
|
generateDebugDailies(dailiesPool: any, factory: any, number: number): any;
|
||||||
/**
|
|
||||||
* Generates the base object of quest type format given as templates in assets/database/templates/repeatableQuests.json
|
|
||||||
* The templates include Elimination, Completion and Extraction quest types
|
|
||||||
*
|
|
||||||
* @param {string} type quest type: "Elimination", "Completion" or "Extraction"
|
|
||||||
* @param {string} traderId trader from which the quest will be provided
|
|
||||||
* @returns {object} a object which contains the base elements for repeatable quests of the requests type
|
|
||||||
* (needs to be filled with reward and conditions by called to make a valid quest)
|
|
||||||
*/
|
|
||||||
generateRepeatableTemplate(type: string, traderId: string): IRepeatableQuest;
|
|
||||||
/**
|
|
||||||
* Generates a valid Exploration quest
|
|
||||||
*
|
|
||||||
* @param {integer} pmcLevel player's level for reward generation
|
|
||||||
* @param {string} traderId trader from which the quest will be provided
|
|
||||||
* @param {object} questTypePool Pools for quests (used to avoid redundant quests)
|
|
||||||
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
|
|
||||||
* @returns {object} object of quest type format for "Exploration" (see assets/database/templates/repeatableQuests.json)
|
|
||||||
*/
|
|
||||||
generateExplorationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IExploration;
|
|
||||||
/**
|
|
||||||
* Generates a valid Completion quest
|
|
||||||
*
|
|
||||||
* @param {integer} pmcLevel player's level for requested items and reward generation
|
|
||||||
* @param {string} traderId trader from which the quest will be provided
|
|
||||||
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
|
|
||||||
* @returns {object} object of quest type format for "Completion" (see assets/database/templates/repeatableQuests.json)
|
|
||||||
*/
|
|
||||||
generateCompletionQuest(pmcLevel: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): ICompletion;
|
|
||||||
/**
|
|
||||||
* Generates a valid Elimination quest
|
|
||||||
*
|
|
||||||
* @param {integer} pmcLevel player's level for requested items and reward generation
|
|
||||||
* @param {string} traderId trader from which the quest will be provided
|
|
||||||
* @param {object} questTypePool Pools for quests (used to avoid redundant quests)
|
|
||||||
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
|
|
||||||
* @returns {object} object of quest type format for "Elimination" (see assets/database/templates/repeatableQuests.json)
|
|
||||||
*/
|
|
||||||
generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination;
|
|
||||||
/**
|
|
||||||
* Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567)
|
|
||||||
* @param locationKey e.g factory4_day
|
|
||||||
* @returns guid
|
|
||||||
*/
|
|
||||||
protected getQuestLocationByMapId(locationKey: string): string;
|
|
||||||
/**
|
|
||||||
* Exploration repeatable quests can specify a required extraction point.
|
|
||||||
* This method creates the according object which will be appended to the conditions array
|
|
||||||
*
|
|
||||||
* @param {string} exit The exit name to generate the condition for
|
|
||||||
* @returns {object} Exit condition
|
|
||||||
*/
|
|
||||||
generateExplorationExitCondition(exit: Exit): IExplorationCondition;
|
|
||||||
/**
|
|
||||||
* A repeatable quest, besides some more or less static components, exists of reward and condition (see assets/database/templates/repeatableQuests.json)
|
|
||||||
* This is a helper method for GenerateCompletionQuest to create a completion condition (of which a completion quest theoretically can have many)
|
|
||||||
*
|
|
||||||
* @param {string} targetItemId id of the item to request
|
|
||||||
* @param {integer} value amount of items of this specific type to request
|
|
||||||
* @returns {object} object of "Completion"-condition
|
|
||||||
*/
|
|
||||||
generateCompletionAvailableForFinish(targetItemId: string, value: number): ICompletionAvailableFor;
|
|
||||||
/**
|
|
||||||
* A repeatable quest, besides some more or less static components, exists of reward and condition (see assets/database/templates/repeatableQuests.json)
|
|
||||||
* This is a helper method for GenerateEliminationQuest to create a location condition.
|
|
||||||
*
|
|
||||||
* @param {string} location the location on which to fulfill the elimination quest
|
|
||||||
* @returns {object} object of "Elimination"-location-subcondition
|
|
||||||
*/
|
|
||||||
generateEliminationLocation(location: string[]): IEliminationCondition;
|
|
||||||
/**
|
|
||||||
* A repeatable quest, besides some more or less static components, exists of reward and condition (see assets/database/templates/repeatableQuests.json)
|
|
||||||
* This is a helper method for GenerateEliminationQuest to create a kill condition.
|
|
||||||
*
|
|
||||||
* @param {string} target array of target npcs e.g. "AnyPmc", "Savage"
|
|
||||||
* @param {array} bodyParts array of body parts with which to kill e.g. ["stomach", "thorax"]
|
|
||||||
* @param {number} distance distance from which to kill (currently only >= supported)
|
|
||||||
* @returns {object} object of "Elimination"-kill-subcondition
|
|
||||||
*/
|
|
||||||
generateEliminationCondition(target: string, bodyPart: string[], distance: number): IEliminationCondition;
|
|
||||||
/**
|
/**
|
||||||
* Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently
|
* Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently
|
||||||
* narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests
|
* narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests
|
||||||
* where you have to e.g. kill scavs in same locations.
|
* where you have to e.g. kill scavs in same locations.
|
||||||
*
|
* @param repeatableConfig main repeatable quest config
|
||||||
* @returns {object} the quest pool
|
* @param pmcLevel level of pmc generating quest pool
|
||||||
|
* @returns IQuestTypePool
|
||||||
*/
|
*/
|
||||||
generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool;
|
protected generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool;
|
||||||
|
protected createBaseQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool;
|
||||||
/**
|
/**
|
||||||
* Generate the reward for a mission. A reward can consist of
|
* Return the locations this PMC is allowed to get daily quests for based on their level
|
||||||
* - Experience
|
* @param locations The original list of locations
|
||||||
* - Money
|
* @param pmcLevel The players level
|
||||||
* - Items
|
* @returns A filtered list of locations that allow the player PMC level to access it
|
||||||
* - Trader Reputation
|
|
||||||
*
|
|
||||||
* The reward is dependent on the player level as given by the wiki. The exact mapping of pmcLevel to
|
|
||||||
* experience / money / items / trader reputation can be defined in QuestConfig.js
|
|
||||||
*
|
|
||||||
* There's also a random variation of the reward the spread of which can be also defined in the config.
|
|
||||||
*
|
|
||||||
* Additonaly, a scaling factor w.r.t. quest difficulty going from 0.2...1 can be used
|
|
||||||
*
|
|
||||||
* @param {integer} pmcLevel player's level
|
|
||||||
* @param {number} difficulty a reward scaling factor goint from 0.2 to 1
|
|
||||||
* @param {string} traderId the trader for reputation gain (and possible in the future filtering of reward item type based on trader)
|
|
||||||
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
|
|
||||||
* @returns {object} object of "Reward"-type that can be given for a repeatable mission
|
|
||||||
*/
|
*/
|
||||||
generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards;
|
protected getAllowedLocationsForPmcLevel(locations: Record<ELocationName, string[]>, pmcLevel: number): Partial<Record<ELocationName, string[]>>;
|
||||||
/**
|
/**
|
||||||
* Helper to create a reward item structured as required by the client
|
* Return true if the given pmcLevel is allowed on the given location
|
||||||
*
|
* @param location The location name to check
|
||||||
* @param {string} tpl itemId of the rewarded item
|
* @param pmcLevel The level of the pmc
|
||||||
* @param {integer} value amount of items to give
|
* @returns True if the given pmc level is allowed to access the given location
|
||||||
* @param {integer} index all rewards will be appended to a list, for unkown reasons the client wants the index
|
|
||||||
* @returns {object} object of "Reward"-item-type
|
|
||||||
*/
|
*/
|
||||||
generateRewardItem(tpl: string, value: number, index: number, preset?: any): IReward;
|
protected isPmcLevelAllowedOnLocation(location: string, pmcLevel: number): boolean;
|
||||||
debugLogRepeatableQuestIds(pmcData: IPmcData): void;
|
debugLogRepeatableQuestIds(pmcData: IPmcData): void;
|
||||||
probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>;
|
|
||||||
changeRepeatableQuest(pmcDataIn: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
|
|
||||||
/**
|
/**
|
||||||
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
|
* Handle RepeatableQuestChange event
|
||||||
* @returns a list of rewardable items [[_tpl, itemTemplate],...]
|
*
|
||||||
|
* Replace a players repeatable quest
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param changeRequest Request object
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns IItemEventRouterResponse
|
||||||
*/
|
*/
|
||||||
protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [string, ITemplateItem][];
|
changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Checks if an id is a valid item. Valid meaning that it's an item that may be a reward
|
* Find a repeatable (daily/weekly/scav) from a players profile by its id
|
||||||
* or content of bot loot. Items that are tested as valid may be in a player backpack or stash.
|
* @param questId Id of quest to find
|
||||||
* @param {*} tpl template id of item to check
|
* @param pmcData Profile that contains quests to look through
|
||||||
* @returns boolean: true if item is valid reward
|
* @returns IGetRepeatableByIdResult
|
||||||
*/
|
*/
|
||||||
isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean;
|
protected getRepeatableById(questId: string, pmcData: IPmcData): IGetRepeatableByIdResult;
|
||||||
|
protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
|
||||||
|
/**
|
||||||
|
* Some accounts have access to free repeatable quest refreshes
|
||||||
|
* Track the usage of them inside players profile
|
||||||
|
* @param fullProfile Player profile
|
||||||
|
* @param repeatableSubType Can be daily / weekly / scav repeatable
|
||||||
|
* @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav
|
||||||
|
* @returns Is the repeatable being replaced for free
|
||||||
|
*/
|
||||||
|
protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean;
|
||||||
}
|
}
|
||||||
|
114
types/controllers/TradeController.d.ts
vendored
114
types/controllers/TradeController.d.ts
vendored
@ -1,23 +1,105 @@
|
|||||||
import { RagfairServer } from "../servers/RagfairServer";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { TradeHelper } from "../helpers/TradeHelper";
|
import { RagfairOfferHelper } from "@spt/helpers/RagfairOfferHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { TradeHelper } from "@spt/helpers/TradeHelper";
|
||||||
import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
|
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { Upd } from "../models/eft/common/tables/IItem";
|
import { IItem } from "@spt/models/eft/common/tables/IItem";
|
||||||
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
|
import { ITraderBase } from "@spt/models/eft/common/tables/ITrader";
|
||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { IProcessBaseTradeRequestData } from "@spt/models/eft/trade/IProcessBaseTradeRequestData";
|
||||||
declare class TradeController {
|
import { IOfferRequest, IProcessRagfairTradeRequestData } from "@spt/models/eft/trade/IProcessRagfairTradeRequestData";
|
||||||
|
import { ISellScavItemsToFenceRequestData } from "@spt/models/eft/trade/ISellScavItemsToFenceRequestData";
|
||||||
|
import { Traders } from "@spt/models/enums/Traders";
|
||||||
|
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||||
|
import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig";
|
||||||
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { RagfairServer } from "@spt/servers/RagfairServer";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { MailSendService } from "@spt/services/MailSendService";
|
||||||
|
import { RagfairPriceService } from "@spt/services/RagfairPriceService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||||
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
|
export declare class TradeController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
|
protected databaseService: DatabaseService;
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
protected tradeHelper: TradeHelper;
|
protected tradeHelper: TradeHelper;
|
||||||
|
protected timeUtil: TimeUtil;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
|
protected hashUtil: HashUtil;
|
||||||
|
protected itemHelper: ItemHelper;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
|
protected ragfairOfferHelper: RagfairOfferHelper;
|
||||||
|
protected traderHelper: TraderHelper;
|
||||||
protected ragfairServer: RagfairServer;
|
protected ragfairServer: RagfairServer;
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil);
|
protected localisationService: LocalisationService;
|
||||||
confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse;
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
protected mailSendService: MailSendService;
|
||||||
|
protected configServer: ConfigServer;
|
||||||
|
protected ragfairConfig: IRagfairConfig;
|
||||||
|
protected traderConfig: ITraderConfig;
|
||||||
|
constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairOfferHelper: RagfairOfferHelper, traderHelper: TraderHelper, 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, request: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Buy an item off the flea sold by a trader
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param fleaOffer Offer being purchased
|
||||||
|
* @param requestOffer request data from client
|
||||||
|
* @param output Output to send back to client
|
||||||
|
*/
|
||||||
|
protected buyTraderItemFromRagfair(sessionId: string, pmcData: IPmcData, fleaOffer: IRagfairOffer, requestOffer: IOfferRequest, output: IItemEventRouterResponse): void;
|
||||||
|
/**
|
||||||
|
* Buy an item off the flea sold by a PMC
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @param fleaOffer Offer being purchased
|
||||||
|
* @param requestOffer Request data from client
|
||||||
|
* @param output Output to send back to client
|
||||||
|
*/
|
||||||
|
protected buyPmcItemFromRagfair(sessionId: string, pmcData: IPmcData, fleaOffer: IRagfairOffer, requestOffer: IOfferRequest, output: IItemEventRouterResponse): void;
|
||||||
|
/**
|
||||||
|
* Is the provided offerid and ownerid from a player made offer
|
||||||
|
* @param offerId Id of the offer
|
||||||
|
* @param offerOwnerId Owner id
|
||||||
|
* @returns true if offer was made by a player
|
||||||
|
*/
|
||||||
|
protected isPlayerOffer(offerId: string, offerOwnerId: string): boolean;
|
||||||
|
/**
|
||||||
|
* Does Player have necessary trader loyalty to purchase flea offer
|
||||||
|
* @param sellerIsTrader is seller trader
|
||||||
|
* @param fleaOffer Flea offer being bought
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @returns True if player can buy offer
|
||||||
|
*/
|
||||||
|
protected playerLacksTraderLoyaltyLevelToBuyOffer(fleaOffer: IRagfairOffer, pmcData: IPmcData): boolean;
|
||||||
|
/** Handle SellAllFromSavage event */
|
||||||
|
sellScavItemsToFence(pmcData: IPmcData, request: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Send the specified rouble total to player as mail
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param trader Trader to sell items to
|
||||||
|
* @param output IItemEventRouterResponse
|
||||||
|
*/
|
||||||
|
protected mailMoneyToPlayer(sessionId: string, roublesToSend: number, trader: Traders): void;
|
||||||
|
/**
|
||||||
|
* Looks up an items children and gets total handbook price for them
|
||||||
|
* @param parentItemId parent item that has children we want to sum price of
|
||||||
|
* @param items All items (parent + children)
|
||||||
|
* @param handbookPrices Prices of items from handbook
|
||||||
|
* @param traderDetails Trader being sold to to perform buy category check against
|
||||||
|
* @returns Rouble price
|
||||||
|
*/
|
||||||
|
protected getPriceOfItemAndChildren(parentItemId: string, items: IItem[], handbookPrices: Record<string, number>, traderDetails: ITraderBase): number;
|
||||||
}
|
}
|
||||||
export { TradeController };
|
|
||||||
|
54
types/controllers/TraderController.d.ts
vendored
54
types/controllers/TraderController.d.ts
vendored
@ -1,31 +1,38 @@
|
|||||||
import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator";
|
import { FenceBaseAssortGenerator } from "@spt/generators/FenceBaseAssortGenerator";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { TraderAssortHelper } from "../helpers/TraderAssortHelper";
|
import { TraderAssortHelper } from "@spt/helpers/TraderAssortHelper";
|
||||||
import { TraderHelper } from "../helpers/TraderHelper";
|
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||||
import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
|
import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrader";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IGetItemPricesResponse } from "@spt/models/eft/game/IGetItemPricesResponse";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig";
|
||||||
import { FenceService } from "../services/FenceService";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { TraderAssortService } from "../services/TraderAssortService";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService";
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { FenceService } from "@spt/services/FenceService";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { RagfairPriceService } from "@spt/services/RagfairPriceService";
|
||||||
|
import { TraderAssortService } from "@spt/services/TraderAssortService";
|
||||||
|
import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService";
|
||||||
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
export declare class TraderController {
|
export declare class TraderController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected databaseServer: DatabaseServer;
|
protected timeUtil: TimeUtil;
|
||||||
|
protected databaseService: DatabaseService;
|
||||||
protected traderAssortHelper: TraderAssortHelper;
|
protected traderAssortHelper: TraderAssortHelper;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected traderHelper: TraderHelper;
|
protected traderHelper: TraderHelper;
|
||||||
protected timeUtil: TimeUtil;
|
|
||||||
protected traderAssortService: TraderAssortService;
|
protected traderAssortService: TraderAssortService;
|
||||||
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected traderPurchasePersisterService: TraderPurchasePersisterService;
|
protected traderPurchasePersisterService: TraderPurchasePersisterService;
|
||||||
protected fenceService: FenceService;
|
protected fenceService: FenceService;
|
||||||
protected fenceBaseAssortGenerator: FenceBaseAssortGenerator;
|
protected fenceBaseAssortGenerator: FenceBaseAssortGenerator;
|
||||||
protected jsonUtil: JsonUtil;
|
protected configServer: ConfigServer;
|
||||||
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil);
|
protected cloner: ICloner;
|
||||||
|
protected traderConfig: ITraderConfig;
|
||||||
|
constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, ragfairPriceService: RagfairPriceService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner);
|
||||||
/**
|
/**
|
||||||
* Runs when onLoad event is fired
|
* Runs when onLoad event is fired
|
||||||
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
|
* Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService
|
||||||
* Store timestamp of next assort refresh in nextResupply property of traders .base object
|
* Store timestamp of next assort refresh in nextResupply property of traders .base object
|
||||||
*/
|
*/
|
||||||
load(): void;
|
load(): void;
|
||||||
@ -37,12 +44,23 @@ export declare class TraderController {
|
|||||||
*/
|
*/
|
||||||
update(): boolean;
|
update(): boolean;
|
||||||
/**
|
/**
|
||||||
|
* Handle client/trading/api/traderSettings
|
||||||
* Return an array of all traders
|
* Return an array of all traders
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
* @returns array if ITraderBase objects
|
* @returns array if ITraderBase objects
|
||||||
*/
|
*/
|
||||||
getAllTraders(sessionID: string): ITraderBase[];
|
getAllTraders(sessionID: string): ITraderBase[];
|
||||||
|
/**
|
||||||
|
* Order traders by their traderId (Ttid)
|
||||||
|
* @param traderA First trader to compare
|
||||||
|
* @param traderB Second trader to compare
|
||||||
|
* @returns 1,-1 or 0
|
||||||
|
*/
|
||||||
|
protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number;
|
||||||
|
/** Handle client/trading/api/getTrader */
|
||||||
getTrader(sessionID: string, traderID: string): ITraderBase;
|
getTrader(sessionID: string, traderID: string): ITraderBase;
|
||||||
|
/** Handle client/trading/api/getTraderAssort */
|
||||||
getAssort(sessionId: string, traderId: string): ITraderAssort;
|
getAssort(sessionId: string, traderId: string): ITraderAssort;
|
||||||
getPurchasesData(sessionID: string, traderID: string): Record<string, IBarterScheme[][]>;
|
/** Handle client/items/prices/TRADERID */
|
||||||
|
getItemPrices(sessionId: string, traderId: string): IGetItemPricesResponse;
|
||||||
}
|
}
|
||||||
|
22
types/controllers/WeatherController.d.ts
vendored
22
types/controllers/WeatherController.d.ts
vendored
@ -1,18 +1,28 @@
|
|||||||
import { WeatherGenerator } from "../generators/WeatherGenerator";
|
import { WeatherGenerator } from "@spt/generators/WeatherGenerator";
|
||||||
import { IWeatherData } from "../models/eft/weather/IWeatherData";
|
import { WeatherHelper } from "@spt/helpers/WeatherHelper";
|
||||||
import { IWeatherConfig } from "../models/spt/config/IWeatherConfig";
|
import { IWeatherData } from "@spt/models/eft/weather/IWeatherData";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { IGetLocalWeatherResponseData } from "@spt/models/spt/weather/IGetLocalWeatherResponseData";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { RaidWeatherService } from "@spt/services/RaidWeatherService";
|
||||||
|
import { SeasonalEventService } from "@spt/services/SeasonalEventService";
|
||||||
export declare class WeatherController {
|
export declare class WeatherController {
|
||||||
protected weatherGenerator: WeatherGenerator;
|
protected weatherGenerator: WeatherGenerator;
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected seasonalEventService: SeasonalEventService;
|
||||||
|
protected raidWeatherService: RaidWeatherService;
|
||||||
|
protected weatherHelper: WeatherHelper;
|
||||||
protected weatherConfig: IWeatherConfig;
|
protected weatherConfig: IWeatherConfig;
|
||||||
constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer);
|
constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer, seasonalEventService: SeasonalEventService, raidWeatherService: RaidWeatherService, weatherHelper: WeatherHelper);
|
||||||
|
/** Handle client/weather */
|
||||||
generate(): IWeatherData;
|
generate(): IWeatherData;
|
||||||
/**
|
/**
|
||||||
* Get the current in-raid time (MUST HAVE PLAYER LOGGED INTO CLIENT TO WORK)
|
* Get the current in-raid time (MUST HAVE PLAYER LOGGED INTO CLIENT TO WORK)
|
||||||
* @returns Date object
|
* @returns Date object
|
||||||
*/
|
*/
|
||||||
getCurrentInRaidTime(): Date;
|
getCurrentInRaidTime(): Date;
|
||||||
|
/** Handle client/localGame/weather */
|
||||||
|
generateLocal(sesssionId: string): IGetLocalWeatherResponseData;
|
||||||
}
|
}
|
||||||
|
18
types/controllers/WishlistController.d.ts
vendored
18
types/controllers/WishlistController.d.ts
vendored
@ -1,10 +1,16 @@
|
|||||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData";
|
import { IAddToWishlistRequest } from "@spt/models/eft/wishlist/IAddToWishlistRequest";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IChangeWishlistItemCategoryRequest } from "@spt/models/eft/wishlist/IChangeWishlistItemCategoryRequest";
|
||||||
|
import { IRemoveFromWishlistRequest } from "@spt/models/eft/wishlist/IRemoveFromWishlistRequest";
|
||||||
|
import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
|
||||||
export declare class WishlistController {
|
export declare class WishlistController {
|
||||||
protected eventOutputHolder: EventOutputHolder;
|
protected eventOutputHolder: EventOutputHolder;
|
||||||
constructor(eventOutputHolder: EventOutputHolder);
|
constructor(eventOutputHolder: EventOutputHolder);
|
||||||
addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
/** Handle AddToWishList */
|
||||||
removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
addToWishList(pmcData: IPmcData, request: IAddToWishlistRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle RemoveFromWishList event */
|
||||||
|
removeFromWishList(pmcData: IPmcData, request: IRemoveFromWishlistRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/** Handle changeWishlistItemCategory event */
|
||||||
|
changeWishlistItemCategory(pmcData: IPmcData, request: IChangeWishlistItemCategoryRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
}
|
}
|
||||||
|
1
types/di/Container.d.ts
vendored
1
types/di/Container.d.ts
vendored
@ -5,6 +5,7 @@ import { DependencyContainer } from "tsyringe";
|
|||||||
export declare class Container {
|
export declare class Container {
|
||||||
static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void;
|
static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void;
|
||||||
static registerTypes(depContainer: DependencyContainer): void;
|
static registerTypes(depContainer: DependencyContainer): void;
|
||||||
|
static registerPrimaryDependencies(depContainer: DependencyContainer): void;
|
||||||
static registerListTypes(depContainer: DependencyContainer): void;
|
static registerListTypes(depContainer: DependencyContainer): void;
|
||||||
private static registerUtils;
|
private static registerUtils;
|
||||||
private static registerRouters;
|
private static registerRouters;
|
||||||
|
2
types/di/OnLoad.d.ts
vendored
2
types/di/OnLoad.d.ts
vendored
@ -1,4 +1,4 @@
|
|||||||
export declare class OnLoad {
|
export interface OnLoad {
|
||||||
onLoad(): Promise<void>;
|
onLoad(): Promise<void>;
|
||||||
getRoute(): string;
|
getRoute(): string;
|
||||||
}
|
}
|
||||||
|
7
types/di/OnLoadOnUpdate.d.ts
vendored
7
types/di/OnLoadOnUpdate.d.ts
vendored
@ -1,7 +0,0 @@
|
|||||||
import { OnLoad } from "./OnLoad";
|
|
||||||
import { OnUpdate } from "./OnUpdate";
|
|
||||||
export declare class OnLoadOnUpdate implements OnLoad, OnUpdate {
|
|
||||||
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
|
||||||
onLoad(): Promise<void>;
|
|
||||||
getRoute(): string;
|
|
||||||
}
|
|
2
types/di/OnUpdate.d.ts
vendored
2
types/di/OnUpdate.d.ts
vendored
@ -1,4 +1,4 @@
|
|||||||
export declare class OnUpdate {
|
export interface OnUpdate {
|
||||||
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
||||||
getRoute(): string;
|
getRoute(): string;
|
||||||
}
|
}
|
||||||
|
24
types/di/Router.d.ts
vendored
24
types/di/Router.d.ts
vendored
@ -1,32 +1,30 @@
|
|||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
import { ISptProfile } from "@spt/models/eft/profile/ISptProfile";
|
||||||
export declare class Router {
|
export declare class Router {
|
||||||
private handledRoutes;
|
protected handledRoutes: HandledRoute[];
|
||||||
getTopLevelRoute(): string;
|
getTopLevelRoute(): string;
|
||||||
protected getHandledRoutes(): HandledRoute[];
|
protected getHandledRoutes(): HandledRoute[];
|
||||||
private getInternalHandledRoutes;
|
protected getInternalHandledRoutes(): HandledRoute[];
|
||||||
canHandle(url: string, partialMatch?: boolean): boolean;
|
canHandle(url: string, partialMatch?: boolean): boolean;
|
||||||
}
|
}
|
||||||
export declare class StaticRouter extends Router {
|
export declare class StaticRouter extends Router {
|
||||||
private routes;
|
private routes;
|
||||||
constructor(routes: RouteAction[]);
|
constructor(routes: RouteAction[]);
|
||||||
handleStatic(url: string, info: any, sessionID: string, output: string): any;
|
handleStatic(url: string, info: any, sessionID: string, output: string): Promise<any>;
|
||||||
getHandledRoutes(): HandledRoute[];
|
getHandledRoutes(): HandledRoute[];
|
||||||
}
|
}
|
||||||
export declare class DynamicRouter extends Router {
|
export declare class DynamicRouter extends Router {
|
||||||
private routes;
|
private routes;
|
||||||
constructor(routes: RouteAction[]);
|
constructor(routes: RouteAction[]);
|
||||||
handleDynamic(url: string, info: any, sessionID: string, output: string): any;
|
handleDynamic(url: string, info: any, sessionID: string, output: string): Promise<any>;
|
||||||
getHandledRoutes(): HandledRoute[];
|
getHandledRoutes(): HandledRoute[];
|
||||||
}
|
}
|
||||||
export declare class ItemEventRouterDefinition extends Router {
|
export declare class ItemEventRouterDefinition extends Router {
|
||||||
constructor();
|
handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string, output: IItemEventRouterResponse): Promise<any>;
|
||||||
handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse;
|
|
||||||
}
|
}
|
||||||
export declare class SaveLoadRouter extends Router {
|
export declare class SaveLoadRouter extends Router {
|
||||||
constructor();
|
handleLoad(profile: ISptProfile): ISptProfile;
|
||||||
handleLoad(profile: IAkiProfile): IAkiProfile;
|
|
||||||
}
|
}
|
||||||
export declare class HandledRoute {
|
export declare class HandledRoute {
|
||||||
route: string;
|
route: string;
|
||||||
@ -35,6 +33,6 @@ export declare class HandledRoute {
|
|||||||
}
|
}
|
||||||
export declare class RouteAction {
|
export declare class RouteAction {
|
||||||
url: string;
|
url: string;
|
||||||
action: (url: string, info: any, sessionID: string, output: string) => any;
|
action: (url: string, info: any, sessionID: string, output: string) => Promise<any>;
|
||||||
constructor(url: string, action: (url: string, info: any, sessionID: string, output: string) => any);
|
constructor(url: string, action: (url: string, info: any, sessionID: string, output: string) => Promise<any>);
|
||||||
}
|
}
|
||||||
|
5
types/di/Serializer.d.ts
vendored
5
types/di/Serializer.d.ts
vendored
@ -1,6 +1,5 @@
|
|||||||
/// <reference types="node" />
|
import { IncomingMessage, ServerResponse } from "node:http";
|
||||||
import { IncomingMessage, ServerResponse } from "http";
|
|
||||||
export declare class Serializer {
|
export declare class Serializer {
|
||||||
serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void;
|
serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): Promise<void>;
|
||||||
canHandle(something: string): boolean;
|
canHandle(something: string): boolean;
|
||||||
}
|
}
|
||||||
|
284
types/generators/BotEquipmentModGenerator.d.ts
vendored
284
types/generators/BotEquipmentModGenerator.d.ts
vendored
@ -1,31 +1,40 @@
|
|||||||
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper";
|
||||||
import { BotHelper } from "../helpers/BotHelper";
|
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||||
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
|
import { BotWeaponGeneratorHelper } from "@spt/helpers/BotWeaponGeneratorHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { ProbabilityHelper } from "../helpers/ProbabilityHelper";
|
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { ProbabilityHelper } from "@spt/helpers/ProbabilityHelper";
|
||||||
import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper";
|
||||||
import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem";
|
import { IPreset } from "@spt/models/eft/common/IGlobals";
|
||||||
import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig";
|
import { IMods, IModsChances } from "@spt/models/eft/common/tables/IBotType";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IItem } from "@spt/models/eft/common/tables/IItem";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ISlot, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ModSpawn } from "@spt/models/enums/ModSpawn";
|
||||||
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
|
import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult";
|
||||||
import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
|
import { IFilterPlateModsForSlotByLevelResult } from "@spt/models/spt/bots/IFilterPlateModsForSlotByLevelResult";
|
||||||
import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
|
import { IGenerateEquipmentProperties } from "@spt/models/spt/bots/IGenerateEquipmentProperties";
|
||||||
import { ItemFilterService } from "../services/ItemFilterService";
|
import { IGenerateWeaponRequest } from "@spt/models/spt/bots/IGenerateWeaponRequest";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { EquipmentFilters, IBotConfig, IEquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { ExhaustableArray } from "@spt/models/spt/server/ExhaustableArray";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
|
||||||
|
import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService";
|
||||||
|
import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { ItemFilterService } from "@spt/services/ItemFilterService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
export declare class BotEquipmentModGenerator {
|
export declare class BotEquipmentModGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected jsonUtil: JsonUtil;
|
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected probabilityHelper: ProbabilityHelper;
|
protected probabilityHelper: ProbabilityHelper;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected botEquipmentFilterService: BotEquipmentFilterService;
|
protected botEquipmentFilterService: BotEquipmentFilterService;
|
||||||
protected itemFilterService: ItemFilterService;
|
protected itemFilterService: ItemFilterService;
|
||||||
@ -34,45 +43,55 @@ export declare class BotEquipmentModGenerator {
|
|||||||
protected botHelper: BotHelper;
|
protected botHelper: BotHelper;
|
||||||
protected botGeneratorHelper: BotGeneratorHelper;
|
protected botGeneratorHelper: BotGeneratorHelper;
|
||||||
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
||||||
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
|
protected presetHelper: PresetHelper;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected botEquipmentModPoolService: BotEquipmentModPoolService;
|
protected botEquipmentModPoolService: BotEquipmentModPoolService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected cloner: ICloner;
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer);
|
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseService: DatabaseService, 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, cloner: ICloner);
|
||||||
/**
|
/**
|
||||||
* Check mods are compatible and add to array
|
* Check mods are compatible and add to array
|
||||||
* @param equipment Equipment item to add mods to
|
* @param equipment Equipment item to add mods to
|
||||||
* @param modPool Mod list to choose frm
|
* @param modPool Mod list to choose frm
|
||||||
* @param parentId parentid of item to add mod to
|
* @param parentId parentid of item to add mod to
|
||||||
* @param parentTemplate template objet of item to add mods to
|
* @param parentTemplate Template object of item to add mods to
|
||||||
* @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type
|
* @param specificBlacklist The relevant blacklist from bot.json equipment dictionary
|
||||||
* @param botRole the bot role being generated for
|
|
||||||
* @param forceSpawn should this mod be forced to spawn
|
* @param forceSpawn should this mod be forced to spawn
|
||||||
* @returns Item + compatible mods as an array
|
* @returns Item + compatible mods as an array
|
||||||
*/
|
*/
|
||||||
generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, botRole: string, forceSpawn?: boolean): Item[];
|
generateModsForEquipment(equipment: IItem[], parentId: string, parentTemplate: ITemplateItem, settings: IGenerateEquipmentProperties, specificBlacklist: IEquipmentFilterDetails, shouldForceSpawn?: boolean): IItem[];
|
||||||
|
/**
|
||||||
|
* 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 The armor items db template
|
||||||
|
* @returns Array of plate tpls to choose from
|
||||||
|
*/
|
||||||
|
protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult;
|
||||||
/**
|
/**
|
||||||
* Add mods to a weapon using the provided mod pool
|
* Add mods to a weapon using the provided mod pool
|
||||||
* @param sessionId session id
|
* @param sessionId Session id
|
||||||
* @param weapon Weapon to add mods to
|
* @param request Data used to generate the weapon
|
||||||
* @param modPool Pool of compatible mods to attach to weapon
|
|
||||||
* @param weaponParentId parentId of weapon
|
|
||||||
* @param parentTemplate Weapon which mods will be generated on
|
|
||||||
* @param modSpawnChances Mod spawn chances
|
|
||||||
* @param ammoTpl Ammo tpl to use when generating magazines/cartridges
|
|
||||||
* @param botRole Role of bot weapon is generated for
|
|
||||||
* @param botLevel lvel of the bot weapon is being generated for
|
|
||||||
* @param modLimits limits placed on certian mod types per gun
|
|
||||||
* @param botEquipmentRole role of bot when accessing bot.json equipment config settings
|
|
||||||
* @returns Weapon + mods array
|
* @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, request: IGenerateWeaponRequest): IItem[];
|
||||||
|
/**
|
||||||
|
* Should the provided bot have its stock chance values altered to 100%
|
||||||
|
* @param modSlot Slot to check
|
||||||
|
* @param botEquipConfig Bots equipment config/chance values
|
||||||
|
* @param modToAddTemplate Mod being added to bots weapon
|
||||||
|
* @returns True if it should
|
||||||
|
*/
|
||||||
|
protected shouldForceSubStockSlots(modSlot: string, botEquipConfig: EquipmentFilters, modToAddTemplate: ITemplateItem): boolean;
|
||||||
/**
|
/**
|
||||||
* Is this modslot a front or rear sight
|
* Is this modslot a front or rear sight
|
||||||
* @param modSlot Slot to check
|
* @param modSlot Slot to check
|
||||||
* @returns true if it's a front/rear sight
|
* @returns true if it's a front/rear sight
|
||||||
*/
|
*/
|
||||||
protected modIsFrontOrRearSight(modSlot: string): boolean;
|
protected modIsFrontOrRearSight(modSlot: string, tpl: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Does the provided mod details show the mod can hold a scope
|
* Does the provided mod details show the mod can hold a scope
|
||||||
* @param modSlot e.g. mod_scope, mod_mount
|
* @param modSlot e.g. mod_scope, mod_mount
|
||||||
@ -81,50 +100,117 @@ export declare class BotEquipmentModGenerator {
|
|||||||
*/
|
*/
|
||||||
protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean;
|
protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Set all scope mod chances to 100%
|
* Set mod spawn chances to defined amount
|
||||||
* @param modSpawnChances Chances objet to update
|
* @param modSpawnChances Chance dictionary to update
|
||||||
*/
|
*/
|
||||||
protected setScopeSpawnChancesToFull(modSpawnChances: ModsChances): void;
|
protected adjustSlotSpawnChances(modSpawnChances: IModsChances, modSlotsToAdjust: string[], newChancePercent: number): void;
|
||||||
protected sortModKeys(unsortedKeys: string[]): string[];
|
/**
|
||||||
|
* Does the provided modSlot allow muzzle-related items
|
||||||
|
* @param modSlot Slot id to check
|
||||||
|
* @param modsParentId OPTIONAL: parent id of modslot being checked
|
||||||
|
* @returns True if modSlot can have muzzle-related items
|
||||||
|
*/
|
||||||
|
protected modSlotCanHoldMuzzleDevices(modSlot: string, modsParentId?: string): boolean;
|
||||||
|
/**
|
||||||
|
* Sort mod slots into an ordering that maximises chance of a successful weapon generation
|
||||||
|
* @param unsortedSlotKeys Array of mod slot strings to sort
|
||||||
|
* @returns Sorted array
|
||||||
|
*/
|
||||||
|
protected sortModKeys(unsortedSlotKeys: string[]): string[];
|
||||||
/**
|
/**
|
||||||
* Get a Slot property for an item (chamber/cartridge/slot)
|
* Get a Slot property for an item (chamber/cartridge/slot)
|
||||||
* @param modSlot e.g patron_in_weapon
|
* @param modSlot e.g patron_in_weapon
|
||||||
* @param parentTemplate item template
|
* @param parentTemplate item template
|
||||||
* @returns Slot item
|
* @returns Slot item
|
||||||
*/
|
*/
|
||||||
protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot;
|
protected getModItemSlotFromDb(modSlot: string, parentTemplate: ITemplateItem): ISlot;
|
||||||
/**
|
/**
|
||||||
* randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
|
* Randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
|
||||||
* never return true for an item that has 0% spawn chance
|
* @param itemSlot slot the item sits in from db
|
||||||
* @param itemSlot slot the item sits in
|
* @param modSlotName Name of slot the mod sits in
|
||||||
* @param modSlot slot the mod sits in
|
|
||||||
* @param modSpawnChances Chances for various mod spawns
|
* @param modSpawnChances Chances for various mod spawns
|
||||||
* @returns boolean true if it should spawn
|
* @param botEquipConfig Various config settings for generating this type of bot
|
||||||
|
* @returns ModSpawn.SPAWN when mod should be spawned, ModSpawn.DEFAULT_MOD when default mod should spawn, ModSpawn.SKIP when mod is skipped
|
||||||
*/
|
*/
|
||||||
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean;
|
protected shouldModBeSpawned(itemSlot: ISlot, modSlotName: string, modSpawnChances: IModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
|
||||||
|
/**
|
||||||
|
* Choose a mod to fit into the desired slot
|
||||||
|
* @param request Data used to choose an appropriate mod with
|
||||||
|
* @returns itemHelper.getItem() result
|
||||||
|
*/
|
||||||
|
protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined;
|
||||||
|
/**
|
||||||
|
* Given the passed in array of magaizne tpls, look up the min size set in config and return only those that have that size or larger
|
||||||
|
* @param modSpawnRequest Request data
|
||||||
|
* @param modPool Pool of magazine tpls to filter
|
||||||
|
* @returns Filtered pool of magazine tpls
|
||||||
|
*/
|
||||||
|
protected getFilterdMagazinePoolByCapacity(modSpawnRequest: IModToSpawnRequest, modPool: string[]): string[];
|
||||||
|
/**
|
||||||
|
* Choose a weapon mod tpl for a given slot from a pool of choices
|
||||||
|
* Checks chosen tpl is compatible with all existing weapon items
|
||||||
|
* @param modPool Pool of mods that can be picked from
|
||||||
|
* @param parentSlot Slot the picked mod will have as a parent
|
||||||
|
* @param choiceTypeEnum How should chosen tpl be treated: DEFAULT_MOD/SPAWN/SKIP
|
||||||
|
* @param weapon Array of weapon items chosen item will be added to
|
||||||
|
* @param modSlotName Name of slot picked mod will be placed into
|
||||||
|
* @returns Chosen weapon details
|
||||||
|
*/
|
||||||
|
protected getCompatibleWeaponModTplForSlotFromPool(request: IModToSpawnRequest, modPool: string[], parentSlot: ISlot, choiceTypeEnum: ModSpawn, weapon: IItem[], modSlotName: string): IChooseRandomCompatibleModResult;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param modSlot Slot mod will fit into
|
* @param modPool Pool of item Tpls to choose from
|
||||||
* @param isRandomisableSlot Will generate a randomised mod pool if true
|
* @param modSpawnType How should the slot choice be handled - forced/normal etc
|
||||||
* @param modsParent Parent slot the item will be a part of
|
* @param weapon Weapon mods at current time
|
||||||
* @param botEquipBlacklist Blacklist to prevent mods from being picked
|
* @param modSlotName Name of mod slot being filled
|
||||||
* @param itemModPool Pool of items to pick from
|
* @returns IChooseRandomCompatibleModResult
|
||||||
* @param weapon array with only weapon tpl in it, ready for mods to be added
|
|
||||||
* @param ammoTpl ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine)
|
|
||||||
* @param parentTemplate Parent item the mod will go into
|
|
||||||
* @returns ITemplateItem
|
|
||||||
*/
|
*/
|
||||||
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record<string, string[]>, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem];
|
protected getCompatibleModFromPool(modPool: string[], modSpawnType: ModSpawn, weapon: IItem[]): IChooseRandomCompatibleModResult;
|
||||||
|
protected createExhaustableArray<T>(itemsToAddToArray: T[]): ExhaustableArray<T>;
|
||||||
/**
|
/**
|
||||||
* Create a mod item with parameters as properties
|
* Get a list of mod tpls that are compatible with the current weapon
|
||||||
|
* @param modPool
|
||||||
|
* @param tplBlacklist Tpls that are incompatible and should not be used
|
||||||
|
* @returns string array of compatible mod tpls with weapon
|
||||||
|
*/
|
||||||
|
protected getFilteredModPool(modPool: string[], tplBlacklist: Set<string>): string[];
|
||||||
|
/**
|
||||||
|
* Filter mod pool down based on various criteria:
|
||||||
|
* Is slot flagged as randomisable
|
||||||
|
* Is slot required
|
||||||
|
* Is slot flagged as default mod only
|
||||||
|
* @param request
|
||||||
|
* @param weaponTemplate Mods root parent (weapon/equipment)
|
||||||
|
* @returns Array of mod tpls
|
||||||
|
*/
|
||||||
|
protected getModPoolForSlot(request: IModToSpawnRequest, weaponTemplate: ITemplateItem): string[];
|
||||||
|
protected getModPoolForDefaultSlot(request: IModToSpawnRequest, weaponTemplate: ITemplateItem): string[];
|
||||||
|
protected getMatchingModFromPreset(request: IModToSpawnRequest, weaponTemplate: ITemplateItem): IItem;
|
||||||
|
/**
|
||||||
|
* Get default preset for weapon OR get specific weapon presets for edge cases (mp5/silenced dvl)
|
||||||
|
* @param weaponTemplate Weapons db template
|
||||||
|
* @param parentItemTpl Tpl of the parent item
|
||||||
|
* @returns Default preset found
|
||||||
|
*/
|
||||||
|
protected getMatchingPreset(weaponTemplate: ITemplateItem, parentItemTpl: string): IPreset | undefined;
|
||||||
|
/**
|
||||||
|
* Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible
|
||||||
|
* @param weapon Array of items that make up a weapon
|
||||||
|
* @param modTpl Mod to check compatibility with weapon
|
||||||
|
* @returns True if incompatible
|
||||||
|
*/
|
||||||
|
protected weaponModComboIsIncompatible(weapon: IItem[], modTpl: string): boolean;
|
||||||
|
/**
|
||||||
|
* Create a mod item with provided parameters as properties + add upd property
|
||||||
* @param modId _id
|
* @param modId _id
|
||||||
* @param modTpl _tpl
|
* @param modTpl _tpl
|
||||||
* @param parentId parentId
|
* @param parentId parentId
|
||||||
* @param modSlot slotId
|
* @param modSlot slotId
|
||||||
* @param modTemplate Used to add additional properites in the upd object
|
* @param modTemplate Used to add additional properties in the upd object
|
||||||
|
* @param botRole The bots role mod is being created for
|
||||||
* @returns Item object
|
* @returns Item object
|
||||||
*/
|
*/
|
||||||
protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item;
|
protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): IItem;
|
||||||
/**
|
/**
|
||||||
* Get a list of containers that hold ammo
|
* Get a list of containers that hold ammo
|
||||||
* e.g. mod_magazine / patron_in_weapon_000
|
* e.g. mod_magazine / patron_in_weapon_000
|
||||||
@ -133,68 +219,72 @@ export declare class BotEquipmentModGenerator {
|
|||||||
protected getAmmoContainers(): string[];
|
protected getAmmoContainers(): string[];
|
||||||
/**
|
/**
|
||||||
* Get a random mod from an items compatible mods Filter array
|
* Get a random mod from an items compatible mods Filter array
|
||||||
* @param modTpl ???? default value to return if nothing found
|
* @param fallbackModTpl Default value to return if parentSlot Filter is empty
|
||||||
* @param parentSlot item mod will go into, used to get combatible items
|
* @param parentSlot Item mod will go into, used to get compatible items
|
||||||
* @param modSlot Slot to get mod to fill
|
* @param modSlot Slot to get mod to fill
|
||||||
* @param items items to ensure picked mod is compatible with
|
* @param items Items to ensure picked mod is compatible with
|
||||||
* @returns item tpl
|
* @returns Item tpl
|
||||||
*/
|
*/
|
||||||
protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
|
protected getRandomModTplFromItemDb(fallbackModTpl: string, parentSlot: ISlot, modSlot: string, items: IItem[]): string | undefined;
|
||||||
/**
|
/**
|
||||||
* Log errors if mod is not compatible with slot
|
* Check if mod exists in db + is for a required slot
|
||||||
* @param modToAdd template of mod to check
|
* @param modToAdd Db template of mod to check
|
||||||
* @param itemSlot slot the item will be placed in
|
* @param slotAddedToTemplate Slot object the item will be placed as child into
|
||||||
* @param modSlot slot the mod will fill
|
* @param modSlot Slot the mod will fill
|
||||||
* @param parentTemplate tempalte of the mods parent item
|
* @param parentTemplate Db template of the mods being added
|
||||||
* @returns true if valid
|
* @param botRole Bots wildspawntype (assault/pmcBot/exUsec etc)
|
||||||
|
* @returns True if valid for slot
|
||||||
*/
|
*/
|
||||||
protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean;
|
protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: ISlot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Find mod tpls of a provided type and add to modPool
|
* Find mod tpls of a provided type and add to modPool
|
||||||
* @param desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope)
|
* @param desiredSlotName Slot to look up and add we are adding tpls for (e.g mod_scope)
|
||||||
* @param modTemplate db object for modItem we get compatible mods from
|
* @param modTemplate db object for modItem we get compatible mods from
|
||||||
* @param modPool Pool of mods we are adding to
|
* @param modPool Pool of mods we are adding to
|
||||||
|
* @param botEquipBlacklist A blacklist of items that cannot be picked
|
||||||
*/
|
*/
|
||||||
protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void;
|
protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: IMods, botEquipBlacklist: IEquipmentFilterDetails): void;
|
||||||
/**
|
/**
|
||||||
* Get the possible items that fit a slot
|
* Get the possible items that fit a slot
|
||||||
* @param parentItemId item tpl to get compatible items for
|
* @param parentItemId item tpl to get compatible items for
|
||||||
* @param modSlot Slot item should fit in
|
* @param modSlot Slot item should fit in
|
||||||
* @param botEquipBlacklist equipment that should not be picked
|
* @param botEquipBlacklist Equipment that should not be picked
|
||||||
* @returns array of compatible items for that slot
|
* @returns Array of compatible items for that slot
|
||||||
*/
|
*/
|
||||||
protected getDynamicModPool(parentItemId: string, modSlot: string, botEquipBlacklist: EquipmentFilterDetails): string[];
|
protected getDynamicModPool(parentItemId: string, modSlot: string, botEquipBlacklist: IEquipmentFilterDetails): string[];
|
||||||
/**
|
/**
|
||||||
* Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist
|
* Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist
|
||||||
* @param allowedMods base mods to filter
|
* @param allowedMods Base mods to filter
|
||||||
* @param botEquipBlacklist equipment blacklist
|
* @param botEquipBlacklist Equipment blacklist
|
||||||
* @param modSlot slot mods belong to
|
* @param modSlot Slot mods belong to
|
||||||
* @returns Filtered array of mod tpls
|
* @returns Filtered array of mod tpls
|
||||||
*/
|
*/
|
||||||
protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[];
|
protected filterModsByBlacklist(allowedMods: string[], botEquipBlacklist: IEquipmentFilterDetails, modSlot: string): string[];
|
||||||
/**
|
/**
|
||||||
* With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines.
|
* With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines.
|
||||||
* Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0.
|
* Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0.
|
||||||
* Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
|
* Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
|
||||||
* This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
|
* This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
|
||||||
* @param items The items where the CylinderMagazine's camora are appended to
|
* @param items The items where the CylinderMagazine's camora are appended to
|
||||||
* @param modPool modPool which should include available cartrigdes
|
* @param modPool ModPool which should include available cartridges
|
||||||
* @param parentId The CylinderMagazine's UID
|
* @param cylinderMagParentId The CylinderMagazine's UID
|
||||||
* @param parentTemplate The CylinderMagazine's template
|
* @param cylinderMagTemplate The CylinderMagazine's template
|
||||||
*/
|
*/
|
||||||
protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
|
protected fillCamora(items: IItem[], modPool: IMods, cylinderMagParentId: string, cylinderMagTemplate: ITemplateItem): void;
|
||||||
/**
|
/**
|
||||||
* Take a record of camoras and merge the compatable shells into one array
|
* Take a record of camoras and merge the compatible shells into one array
|
||||||
* @param camorasWithShells camoras we want to merge into one array
|
* @param camorasWithShells Dictionary of camoras we want to merge into one array
|
||||||
* @returns string array of shells fro luitple camora sources
|
* @returns String array of shells for multiple camora sources
|
||||||
*/
|
*/
|
||||||
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
|
protected mergeCamoraPools(camorasWithShells: Record<string, string[]>): string[];
|
||||||
/**
|
/**
|
||||||
* Filter out non-whitelisted weapon scopes
|
* Filter out non-whitelisted weapon scopes
|
||||||
|
* Controlled by bot.json weaponSightWhitelist
|
||||||
|
* e.g. filter out rifle scopes from SMGs
|
||||||
* @param weapon Weapon scopes will be added to
|
* @param weapon Weapon scopes will be added to
|
||||||
* @param scopes Full scope pool
|
* @param scopes Full scope pool
|
||||||
* @param botWeaponSightWhitelist whitelist of scope types by weapon base type
|
* @param botWeaponSightWhitelist Whitelist of scope types by weapon base type
|
||||||
* @returns array of scope tpls that have been filtered
|
* @returns Array of scope tpls that have been filtered to just ones allowed for that weapon type
|
||||||
*/
|
*/
|
||||||
protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record<string, string[]>): string[];
|
protected filterSightsByWeaponType(weapon: IItem, scopes: string[], botWeaponSightWhitelist: Record<string, string[]>): string[];
|
||||||
}
|
}
|
||||||
|
173
types/generators/BotGenerator.d.ts
vendored
173
types/generators/BotGenerator.d.ts
vendored
@ -1,38 +1,47 @@
|
|||||||
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
|
import { BotInventoryGenerator } from "@spt/generators/BotInventoryGenerator";
|
||||||
import { BotHelper } from "../helpers/BotHelper";
|
import { BotLevelGenerator } from "@spt/generators/BotLevelGenerator";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper";
|
||||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||||
import { Health as PmcHealth, IBotBase, Skills } from "../models/eft/common/tables/IBotBase";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { Health, IBotType } from "../models/eft/common/tables/IBotType";
|
import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper";
|
||||||
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
|
import { MinMax } from "@spt/models/common/MinMax";
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { IBaseJsonSkills, IBaseSkill, IBotBase, IInfo, IHealth as PmcHealth, ISkills as botSkills } from "@spt/models/eft/common/tables/IBotBase";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IAppearance, IBodyPart, IBotType, IHealth, IInventory } from "@spt/models/eft/common/tables/IBotType";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
|
||||||
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
|
import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
||||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { BotNameService } from "@spt/services/BotNameService";
|
||||||
import { BotInventoryGenerator } from "./BotInventoryGenerator";
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
import { BotLevelGenerator } from "./BotLevelGenerator";
|
import { ItemFilterService } from "@spt/services/ItemFilterService";
|
||||||
|
import { SeasonalEventService } from "@spt/services/SeasonalEventService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
export declare class BotGenerator {
|
export declare class BotGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected jsonUtil: JsonUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected botInventoryGenerator: BotInventoryGenerator;
|
protected botInventoryGenerator: BotInventoryGenerator;
|
||||||
protected botLevelGenerator: BotLevelGenerator;
|
protected botLevelGenerator: BotLevelGenerator;
|
||||||
protected botEquipmentFilterService: BotEquipmentFilterService;
|
protected botEquipmentFilterService: BotEquipmentFilterService;
|
||||||
protected weightedRandomHelper: WeightedRandomHelper;
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
protected botHelper: BotHelper;
|
protected botHelper: BotHelper;
|
||||||
protected botDifficultyHelper: BotDifficultyHelper;
|
protected botGeneratorHelper: BotGeneratorHelper;
|
||||||
protected seasonalEventService: SeasonalEventService;
|
protected seasonalEventService: SeasonalEventService;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
|
protected botNameService: BotNameService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected cloner: ICloner;
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
|
protected pmcConfig: IPmcConfig;
|
||||||
|
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, botNameService: BotNameService, configServer: ConfigServer, cloner: ICloner);
|
||||||
/**
|
/**
|
||||||
* Generate a player scav bot object
|
* Generate a player scav bot object
|
||||||
* @param role e.g. assault / pmcbot
|
* @param role e.g. assault / pmcbot
|
||||||
@ -42,12 +51,20 @@ export declare class BotGenerator {
|
|||||||
*/
|
*/
|
||||||
generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase;
|
generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase;
|
||||||
/**
|
/**
|
||||||
* Create x number of bots of the type/side/difficulty defined in botGenerationDetails
|
* Create 1 bot of the type/side/difficulty defined in botGenerationDetails
|
||||||
* @param sessionId Session id
|
* @param sessionId Session id
|
||||||
* @param botGenerationDetails details on how to generate bots
|
* @param botGenerationDetails details on how to generate bots
|
||||||
* @returns array of bots
|
* @returns constructed bot
|
||||||
*/
|
*/
|
||||||
prepareAndGenerateBots(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[];
|
prepareAndGenerateBot(sessionId: string, botGenerationDetails: IBotGenerationDetails): IBotBase;
|
||||||
|
/**
|
||||||
|
* Get a clone of the default bot base object and adjust its role/side/difficulty values
|
||||||
|
* @param botRole Role bot should have
|
||||||
|
* @param botSide Side bot should have
|
||||||
|
* @param difficulty Difficult bot should have
|
||||||
|
* @returns Cloned bot base
|
||||||
|
*/
|
||||||
|
protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase;
|
||||||
/**
|
/**
|
||||||
* Get a clone of the database\bots\base.json file
|
* Get a clone of the database\bots\base.json file
|
||||||
* @returns IBotBase object
|
* @returns IBotBase object
|
||||||
@ -56,20 +73,55 @@ export declare class BotGenerator {
|
|||||||
/**
|
/**
|
||||||
* Create a IBotBase object with equipment/loot/exp etc
|
* Create a IBotBase object with equipment/loot/exp etc
|
||||||
* @param sessionId Session id
|
* @param sessionId Session id
|
||||||
* @param bot bots base file
|
* @param bot Bots base file
|
||||||
* @param botJsonTemplate Bot template from db/bots/x.json
|
* @param botJsonTemplate Bot template from db/bots/x.json
|
||||||
* @param botGenerationDetails details on how to generate the bot
|
* @param botGenerationDetails details on how to generate the bot
|
||||||
* @returns IBotBase object
|
* @returns IBotBase object
|
||||||
*/
|
*/
|
||||||
protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase;
|
protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: IBotGenerationDetails): IBotBase;
|
||||||
/**
|
/**
|
||||||
* Create a bot nickname
|
* Get exp for kill by bot difficulty
|
||||||
* @param botJsonTemplate x.json from database
|
* @param experience Dict of difficulties and experience
|
||||||
* @param isPlayerScav Will bot be player scav
|
* @param botDifficulty the killed bots difficulty
|
||||||
* @param botRole role of bot e.g. assault
|
* @param role Role of bot (optional, used for error logging)
|
||||||
* @returns Nickname for bot
|
* @returns Experience for kill
|
||||||
*/
|
*/
|
||||||
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string;
|
protected getExperienceRewardForKillByDifficulty(experience: Record<string, MinMax>, botDifficulty: string, role: string): number;
|
||||||
|
/**
|
||||||
|
* Get the standing value change when player kills a bot
|
||||||
|
* @param standingForKill Dictionary of standing values keyed by bot difficulty
|
||||||
|
* @param botDifficulty Difficulty of bot to look up
|
||||||
|
* @param role Role of bot (optional, used for error logging)
|
||||||
|
* @returns Standing change value
|
||||||
|
*/
|
||||||
|
protected getStandingChangeForKillByDifficulty(standingForKill: Record<string, number>, botDifficulty: string, role: string): number;
|
||||||
|
/**
|
||||||
|
* Get the agressor bonus value when player kills a bot
|
||||||
|
* @param standingForKill Dictionary of standing values keyed by bot difficulty
|
||||||
|
* @param botDifficulty Difficulty of bot to look up
|
||||||
|
* @param role Role of bot (optional, used for error logging)
|
||||||
|
* @returns Standing change value
|
||||||
|
*/
|
||||||
|
protected getAgressorBonusByDifficulty(aggressorBonus: Record<string, number>, botDifficulty: string, role: string): number;
|
||||||
|
/**
|
||||||
|
* Set weighting of flagged equipment to 0
|
||||||
|
* @param botJsonTemplate Bot data to adjust
|
||||||
|
* @param botGenerationDetails Generation details of bot
|
||||||
|
*/
|
||||||
|
protected filterBlacklistedGear(botJsonTemplate: IBotType, botGenerationDetails: IBotGenerationDetails): void;
|
||||||
|
protected addAdditionalPocketLootWeightsForUnheardBot(botJsonTemplate: IBotType): void;
|
||||||
|
/**
|
||||||
|
* Remove items from item.json/lootableItemBlacklist from bots inventory
|
||||||
|
* @param botInventory Bot to filter
|
||||||
|
*/
|
||||||
|
protected removeBlacklistedLootFromBotTemplate(botInventory: IInventory): void;
|
||||||
|
/**
|
||||||
|
* Choose various appearance settings for a bot using weights: head/body/feet/hands
|
||||||
|
* @param bot Bot to adjust
|
||||||
|
* @param appearance Appearance settings to choose from
|
||||||
|
* @param botGenerationDetails Generation details
|
||||||
|
*/
|
||||||
|
protected setBotAppearance(bot: IBotBase, appearance: IAppearance, botGenerationDetails: IBotGenerationDetails): void;
|
||||||
/**
|
/**
|
||||||
* Log the number of PMCs generated to the debug console
|
* Log the number of PMCs generated to the debug console
|
||||||
* @param output Generated bot array, ready to send to client
|
* @param output Generated bot array, ready to send to client
|
||||||
@ -81,19 +133,62 @@ export declare class BotGenerator {
|
|||||||
* @param playerScav Is a pscav bot being generated
|
* @param playerScav Is a pscav bot being generated
|
||||||
* @returns PmcHealth object
|
* @returns PmcHealth object
|
||||||
*/
|
*/
|
||||||
protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth;
|
protected generateHealth(healthObj: IHealth, playerScav?: boolean): PmcHealth;
|
||||||
protected generateSkills(skillsObj: Skills): Skills;
|
|
||||||
/**
|
/**
|
||||||
* Generate a random Id for a bot and apply to bots _id and aid value
|
* Sum up body parts max hp values, return the bodypart collection with lowest value
|
||||||
|
* @param bodies Body parts to sum up
|
||||||
|
* @returns Lowest hp collection
|
||||||
|
*/
|
||||||
|
protected getLowestHpBody(bodies: IBodyPart[]): IBodyPart | undefined;
|
||||||
|
/**
|
||||||
|
* Get a bots skills with randomsied progress value between the min and max values
|
||||||
|
* @param botSkills Skills that should have their progress value randomised
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
protected generateSkills(botSkills: IBaseJsonSkills): botSkills;
|
||||||
|
/**
|
||||||
|
* Randomise the progress value of passed in skills based on the min/max value
|
||||||
|
* @param skills Skills to randomise
|
||||||
|
* @param isCommonSkills Are the skills 'common' skills
|
||||||
|
* @returns Skills with randomised progress values as an array
|
||||||
|
*/
|
||||||
|
protected getSkillsWithRandomisedProgressValue(skills: Record<string, IBaseSkill>, isCommonSkills: boolean): IBaseSkill[];
|
||||||
|
/**
|
||||||
|
* Generate an id+aid for a bot and apply
|
||||||
* @param bot bot to update
|
* @param bot bot to update
|
||||||
* @returns updated IBotBase object
|
* @returns updated IBotBase object
|
||||||
*/
|
*/
|
||||||
protected generateId(bot: IBotBase): IBotBase;
|
protected addIdsToBot(bot: IBotBase): void;
|
||||||
protected generateInventoryID(profile: IBotBase): IBotBase;
|
/**
|
||||||
|
* Update a profiles profile.Inventory.equipment value with a freshly generated one
|
||||||
|
* Update all inventory items that make use of this value too
|
||||||
|
* @param profile Profile to update
|
||||||
|
*/
|
||||||
|
protected generateInventoryId(profile: IBotBase): void;
|
||||||
|
/**
|
||||||
|
* Randomise a bots game version and account category
|
||||||
|
* Chooses from all the game versions (standard, eod etc)
|
||||||
|
* Chooses account type (default, Sherpa, etc)
|
||||||
|
* @param botInfo bot info object to update
|
||||||
|
* @returns Chosen game version
|
||||||
|
*/
|
||||||
|
protected setRandomisedGameVersionAndCategory(botInfo: IInfo): string;
|
||||||
/**
|
/**
|
||||||
* Add a side-specific (usec/bear) dogtag item to a bots inventory
|
* Add a side-specific (usec/bear) dogtag item to a bots inventory
|
||||||
* @param bot bot to add dogtag to
|
* @param bot bot to add dogtag to
|
||||||
* @returns Bot with dogtag added
|
* @returns Bot with dogtag added
|
||||||
*/
|
*/
|
||||||
protected generateDogtag(bot: IBotBase): IBotBase;
|
protected addDogtagToBot(bot: IBotBase): void;
|
||||||
|
/**
|
||||||
|
* Get a dogtag tpl that matches the bots game version and side
|
||||||
|
* @param side Usec/Bear
|
||||||
|
* @param gameVersion edge_of_darkness / standard
|
||||||
|
* @returns item tpl
|
||||||
|
*/
|
||||||
|
protected getDogtagTplByGameVersionAndSide(side: string, gameVersion: string): string;
|
||||||
|
/**
|
||||||
|
* Adjust a PMCs pocket tpl to UHD if necessary, otherwise do nothing
|
||||||
|
* @param bot Pmc object to adjust
|
||||||
|
*/
|
||||||
|
protected setPmcPocketsByGameVersion(bot: IBotBase): void;
|
||||||
}
|
}
|
||||||
|
102
types/generators/BotInventoryGenerator.d.ts
vendored
102
types/generators/BotInventoryGenerator.d.ts
vendored
@ -1,46 +1,59 @@
|
|||||||
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
import { ApplicationContext } from "@spt/context/ApplicationContext";
|
||||||
import { BotHelper } from "../helpers/BotHelper";
|
import { BotEquipmentModGenerator } from "@spt/generators/BotEquipmentModGenerator";
|
||||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
import { BotLootGenerator } from "@spt/generators/BotLootGenerator";
|
||||||
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
|
import { BotWeaponGenerator } from "@spt/generators/BotWeaponGenerator";
|
||||||
import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType";
|
import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper";
|
||||||
import { EquipmentSlots } from "../models/enums/EquipmentSlots";
|
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||||
import { EquipmentFilterDetails, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { WeatherHelper } from "@spt/helpers/WeatherHelper";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper";
|
||||||
import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
|
import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { IBotType, IChances, IEquipment, IGeneration, IInventory } from "@spt/models/eft/common/tables/IBotType";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots";
|
||||||
import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
|
import { IGenerateEquipmentProperties } from "@spt/models/spt/bots/IGenerateEquipmentProperties";
|
||||||
import { BotLootGenerator } from "./BotLootGenerator";
|
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
|
||||||
import { BotWeaponGenerator } from "./BotWeaponGenerator";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
|
||||||
|
import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
export declare class BotInventoryGenerator {
|
export declare class BotInventoryGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
|
protected applicationContext: ApplicationContext;
|
||||||
protected botWeaponGenerator: BotWeaponGenerator;
|
protected botWeaponGenerator: BotWeaponGenerator;
|
||||||
protected botLootGenerator: BotLootGenerator;
|
protected botLootGenerator: BotLootGenerator;
|
||||||
protected botGeneratorHelper: BotGeneratorHelper;
|
protected botGeneratorHelper: BotGeneratorHelper;
|
||||||
|
protected profileHelper: ProfileHelper;
|
||||||
protected botHelper: BotHelper;
|
protected botHelper: BotHelper;
|
||||||
protected weightedRandomHelper: WeightedRandomHelper;
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
|
protected itemHelper: ItemHelper;
|
||||||
|
protected weatherHelper: WeatherHelper;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
|
protected botEquipmentFilterService: BotEquipmentFilterService;
|
||||||
protected botEquipmentModPoolService: BotEquipmentModPoolService;
|
protected botEquipmentModPoolService: BotEquipmentModPoolService;
|
||||||
protected botEquipmentModGenerator: BotEquipmentModGenerator;
|
protected botEquipmentModGenerator: BotEquipmentModGenerator;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer);
|
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, applicationContext: ApplicationContext, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, profileHelper: ProfileHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, weatherHelper: WeatherHelper, localisationService: LocalisationService, botEquipmentFilterService: BotEquipmentFilterService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Add equipment/weapons/loot to bot
|
* Add equipment/weapons/loot to bot
|
||||||
* @param sessionId Session id
|
* @param sessionId Session id
|
||||||
* @param botJsonTemplate bot/x.json data from db
|
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||||
* @param botRole Role bot has (assault/pmcBot)
|
* @param botRole Role bot has (assault/pmcBot)
|
||||||
* @param isPmc Is bot being converted into a pmc
|
* @param isPmc Is bot being converted into a pmc
|
||||||
* @param botLevel Level of bot being generated
|
* @param botLevel Level of bot being generated
|
||||||
|
* @param chosenGameVersion Game version for bot, only really applies for PMCs
|
||||||
* @returns PmcInventory object with equipment/weapons/loot
|
* @returns PmcInventory object with equipment/weapons/loot
|
||||||
*/
|
*/
|
||||||
generateInventory(sessionId: string, botJsonTemplate: IBotType, botRole: string, isPmc: boolean, botLevel: number): PmcInventory;
|
generateInventory(sessionId: string, botJsonTemplate: IBotType, botRole: string, isPmc: boolean, botLevel: number, chosenGameVersion: string): PmcInventory;
|
||||||
/**
|
/**
|
||||||
* Create a pmcInventory object with all the base/generic items needed
|
* Create a pmcInventory object with all the base/generic items needed
|
||||||
* @returns PmcInventory object
|
* @returns PmcInventory object
|
||||||
@ -48,31 +61,42 @@ export declare class BotInventoryGenerator {
|
|||||||
protected generateInventoryBase(): PmcInventory;
|
protected generateInventoryBase(): PmcInventory;
|
||||||
/**
|
/**
|
||||||
* Add equipment to a bot
|
* Add equipment to a bot
|
||||||
|
* @param sessionId Session id
|
||||||
* @param templateInventory bot/x.json data from db
|
* @param templateInventory bot/x.json data from db
|
||||||
* @param equipmentChances Chances items will be added to bot
|
* @param wornItemChances Chances items will be added to bot
|
||||||
* @param botRole Role bot has (assault/pmcBot)
|
* @param botRole Role bot has (assault/pmcBot)
|
||||||
* @param botInventory Inventory to add equipment to
|
* @param botInventory Inventory to add equipment to
|
||||||
* @param botLevel Level of bot
|
* @param botLevel Level of bot
|
||||||
|
* @param chosenGameVersion Game version for bot, only really applies for PMCs
|
||||||
*/
|
*/
|
||||||
protected generateAndAddEquipmentToBot(templateInventory: Inventory, equipmentChances: Chances, botRole: string, botInventory: PmcInventory, botLevel: number): void;
|
protected generateAndAddEquipmentToBot(sessionId: string, templateInventory: IInventory, wornItemChances: IChances, botRole: string, botInventory: PmcInventory, botLevel: number, chosenGameVersion: string, raidConfig: IGetRaidConfigurationRequestData): void;
|
||||||
|
/**
|
||||||
|
* Remove non-armored rigs from parameter data
|
||||||
|
* @param templateEquipment Equpiment to filter TacticalVest of
|
||||||
|
* @param botRole Role of bot vests are being filtered for
|
||||||
|
*/
|
||||||
|
protected filterRigsToThoseWithProtection(templateEquipment: IEquipment, botRole: string): void;
|
||||||
|
/**
|
||||||
|
* Remove armored rigs from parameter data
|
||||||
|
* @param templateEquipment Equpiment to filter TacticalVest of
|
||||||
|
* @param botRole Role of bot vests are being filtered for
|
||||||
|
* @param allowEmptyResult Should the function return all rigs when 0 unarmored are found
|
||||||
|
*/
|
||||||
|
protected filterRigsToThoseWithoutProtection(templateEquipment: IEquipment, botRole: string, allowEmptyResult?: boolean): void;
|
||||||
/**
|
/**
|
||||||
* Add a piece of equipment with mods to inventory from the provided pools
|
* Add a piece of equipment with mods to inventory from the provided pools
|
||||||
* @param equipmentSlot Slot to select an item for
|
* @param sessionId Session id
|
||||||
* @param equipmentPool Possible items to choose from
|
* @param settings Values to adjust how item is chosen and added to bot
|
||||||
* @param modPool Possible mods to apply to item chosen
|
* @returns true when item added
|
||||||
* @param spawnChances Chances items will be chosen to be added
|
|
||||||
* @param botRole Role of bot e.g. assault
|
|
||||||
* @param inventory Inventory to add item into
|
|
||||||
* @param randomisationDetails settings from bot.json to adjust how item is generated
|
|
||||||
*/
|
*/
|
||||||
protected generateEquipment(equipmentSlot: string, equipmentPool: Record<string, number>, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory, randomisationDetails: RandomisationDetails): void;
|
protected generateEquipment(settings: IGenerateEquipmentProperties): boolean;
|
||||||
/**
|
/**
|
||||||
* Get all possible mods for item and filter down based on equipment blacklist from bot.json config
|
* Get all possible mods for item and filter down based on equipment blacklist from bot.json config
|
||||||
* @param itemTpl Item mod pool is being retreived and filtered
|
* @param itemTpl Item mod pool is being retrieved and filtered
|
||||||
* @param equipmentBlacklist blacklist to filter mod pool with
|
* @param equipmentBlacklist Blacklist to filter mod pool with
|
||||||
* @returns Filtered pool of mods
|
* @returns Filtered pool of mods
|
||||||
*/
|
*/
|
||||||
protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: EquipmentFilterDetails[]): Record<string, string[]>;
|
protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: Record<string, string[]>): Record<string, string[]>;
|
||||||
/**
|
/**
|
||||||
* Work out what weapons bot should have equipped and add them to bot inventory
|
* Work out what weapons bot should have equipped and add them to bot inventory
|
||||||
* @param templateInventory bot/x.json data from db
|
* @param templateInventory bot/x.json data from db
|
||||||
@ -81,16 +105,16 @@ export declare class BotInventoryGenerator {
|
|||||||
* @param botInventory Inventory to add weapons to
|
* @param botInventory Inventory to add weapons to
|
||||||
* @param botRole assault/pmcBot/bossTagilla etc
|
* @param botRole assault/pmcBot/bossTagilla etc
|
||||||
* @param isPmc Is the bot being generated as a pmc
|
* @param isPmc Is the bot being generated as a pmc
|
||||||
* @param botLevel level of bot having weapon generated
|
|
||||||
* @param itemGenerationLimitsMinMax Limits for items the bot can have
|
* @param itemGenerationLimitsMinMax Limits for items the bot can have
|
||||||
|
* @param botLevel level of bot having weapon generated
|
||||||
*/
|
*/
|
||||||
protected generateAndAddWeaponsToBot(templateInventory: Inventory, equipmentChances: Chances, sessionId: string, botInventory: PmcInventory, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void;
|
protected generateAndAddWeaponsToBot(templateInventory: IInventory, equipmentChances: IChances, sessionId: string, botInventory: PmcInventory, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: IGeneration, botLevel: number): void;
|
||||||
/**
|
/**
|
||||||
* Calculate if the bot should have weapons in Primary/Secondary/Holster slots
|
* Calculate if the bot should have weapons in Primary/Secondary/Holster slots
|
||||||
* @param equipmentChances Chances bot has certain equipment
|
* @param equipmentChances Chances bot has certain equipment
|
||||||
* @returns What slots bot should have weapons generated for
|
* @returns What slots bot should have weapons generated for
|
||||||
*/
|
*/
|
||||||
protected getDesiredWeaponsForBot(equipmentChances: Chances): {
|
protected getDesiredWeaponsForBot(equipmentChances: IChances): {
|
||||||
slot: EquipmentSlots;
|
slot: EquipmentSlots;
|
||||||
shouldSpawn: boolean;
|
shouldSpawn: boolean;
|
||||||
}[];
|
}[];
|
||||||
@ -103,10 +127,10 @@ export declare class BotInventoryGenerator {
|
|||||||
* @param equipmentChances Chances bot can have equipment equipped
|
* @param equipmentChances Chances bot can have equipment equipped
|
||||||
* @param botRole assault/pmcBot/bossTagilla etc
|
* @param botRole assault/pmcBot/bossTagilla etc
|
||||||
* @param isPmc Is the bot being generated as a pmc
|
* @param isPmc Is the bot being generated as a pmc
|
||||||
* @param itemGenerationLimitsMinMax
|
* @param itemGenerationWeights
|
||||||
*/
|
*/
|
||||||
protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: {
|
protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: {
|
||||||
slot: EquipmentSlots;
|
slot: EquipmentSlots;
|
||||||
shouldSpawn: boolean;
|
shouldSpawn: boolean;
|
||||||
}, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void;
|
}, templateInventory: IInventory, botInventory: PmcInventory, equipmentChances: IChances, botRole: string, isPmc: boolean, itemGenerationWeights: IGeneration, botLevel: number): void;
|
||||||
}
|
}
|
||||||
|
41
types/generators/BotLevelGenerator.d.ts
vendored
41
types/generators/BotLevelGenerator.d.ts
vendored
@ -1,29 +1,32 @@
|
|||||||
import { MinMax } from "../models/common/MinMax";
|
import { MinMax } from "@spt/models/common/MinMax";
|
||||||
import { IRandomisedBotLevelResult } from "../models/eft/bot/IRandomisedBotLevelResult";
|
import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLevelResult";
|
||||||
import { ExpTable } from "../models/eft/common/IGlobals";
|
import { IBotBase } from "@spt/models/eft/common/tables/IBotBase";
|
||||||
import { IBotBase } from "../models/eft/common/tables/IBotBase";
|
import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails";
|
||||||
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { MathUtil } from "@spt/utils/MathUtil";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
export declare class BotLevelGenerator {
|
export declare class BotLevelGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer);
|
protected mathUtil: MathUtil;
|
||||||
|
constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, mathUtil: MathUtil);
|
||||||
/**
|
/**
|
||||||
* Return a randomised bot level and exp value
|
* Return a randomised bot level and exp value
|
||||||
* @param levelDetails min and max of level for bot
|
* @param levelDetails Min and max of level for bot
|
||||||
* @param botGenerationDetails Deatils to help generate a bot
|
* @param botGenerationDetails Details to help generate a bot
|
||||||
* @param bot being level is being generated for
|
* @param bot Bot the level is being generated for
|
||||||
* @returns IRandomisedBotLevelResult object
|
* @returns IRandomisedBotLevelResult object
|
||||||
*/
|
*/
|
||||||
generateBotLevel(levelDetails: MinMax, botGenerationDetails: BotGenerationDetails, bot: IBotBase): IRandomisedBotLevelResult;
|
generateBotLevel(levelDetails: MinMax, botGenerationDetails: IBotGenerationDetails, bot: IBotBase): IRandomisedBotLevelResult;
|
||||||
|
protected chooseBotLevel(min: number, max: number, shift: number, number: number): number;
|
||||||
/**
|
/**
|
||||||
* Get the highest level a bot can be relative to the players level, but no futher than the max size from globals.exp_table
|
* Return the min and max bot level based on a relative delta from the PMC level
|
||||||
* @param playerLevel Players current level
|
* @param botGenerationDetails Details to help generate a bot
|
||||||
* @param relativeDeltaMax max delta above player level to go
|
* @param levelDetails
|
||||||
* @returns highest level possible for bot
|
* @param maxlevel Max level allowed
|
||||||
|
* @returns A MinMax of the lowest and highest level to generate the bots
|
||||||
*/
|
*/
|
||||||
protected getHighestRelativeBotLevel(playerLevel: number, relativeDeltaMax: number, levelDetails: MinMax, expTable: ExpTable[]): number;
|
protected getRelativeBotLevelRange(botGenerationDetails: IBotGenerationDetails, levelDetails: MinMax, maxAvailableLevel: number): MinMax;
|
||||||
}
|
}
|
||||||
|
169
types/generators/BotLootGenerator.d.ts
vendored
169
types/generators/BotLootGenerator.d.ts
vendored
@ -1,134 +1,143 @@
|
|||||||
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
import { BotWeaponGenerator } from "@spt/generators/BotWeaponGenerator";
|
||||||
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
|
import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper";
|
||||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||||
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
|
import { HandbookHelper } from "@spt/helpers/HandbookHelper";
|
||||||
import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType";
|
import { InventoryHelper } from "@spt/helpers/InventoryHelper";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { ITemplateItem, Props } from "../models/eft/common/tables/ITemplateItem";
|
import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper";
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IBotType, IInventory, IModsChances } from "@spt/models/eft/common/tables/IBotType";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IItem } from "@spt/models/eft/common/tables/IItem";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||||
import { BotLootCacheService } from "../services/BotLootCacheService";
|
import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { IItemSpawnLimitSettings } from "@spt/models/spt/bots/IItemSpawnLimitSettings";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
||||||
import { BotWeaponGenerator } from "./BotWeaponGenerator";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { BotLootCacheService } from "@spt/services/BotLootCacheService";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
export declare class BotLootGenerator {
|
export declare class BotLootGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected itemHelper: ItemHelper;
|
||||||
|
protected inventoryHelper: InventoryHelper;
|
||||||
|
protected databaseService: DatabaseService;
|
||||||
protected handbookHelper: HandbookHelper;
|
protected handbookHelper: HandbookHelper;
|
||||||
protected botGeneratorHelper: BotGeneratorHelper;
|
protected botGeneratorHelper: BotGeneratorHelper;
|
||||||
protected botWeaponGenerator: BotWeaponGenerator;
|
protected botWeaponGenerator: BotWeaponGenerator;
|
||||||
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
|
protected botHelper: BotHelper;
|
||||||
protected botLootCacheService: BotLootCacheService;
|
protected botLootCacheService: BotLootCacheService;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected cloner: ICloner;
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer);
|
protected pmcConfig: IPmcConfig;
|
||||||
|
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, databaseService: DatabaseService, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner);
|
||||||
|
protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings;
|
||||||
/**
|
/**
|
||||||
* Add loot to bots containers
|
* Add loot to bots containers
|
||||||
* @param sessionId Session id
|
* @param sessionId Session id
|
||||||
* @param templateInventory x.json from database/bots
|
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||||
* @param itemCounts Liits on item types to be added as loot
|
|
||||||
* @param isPmc Will bot be a pmc
|
* @param isPmc Will bot be a pmc
|
||||||
* @param botRole Role of bot, e.g. asssult
|
* @param botRole Role of bot, e.g. asssult
|
||||||
* @param botInventory Inventory to add loot to
|
* @param botInventory Inventory to add loot to
|
||||||
* @param equipmentChances
|
|
||||||
* @param botLevel Level of bot
|
* @param botLevel Level of bot
|
||||||
*/
|
*/
|
||||||
generateLoot(sessionId: string, templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances, botLevel: number): void;
|
generateLoot(sessionId: string, botJsonTemplate: IBotType, isPmc: boolean, botRole: string, botInventory: PmcInventory, botLevel: number): void;
|
||||||
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
|
* Gets the rouble cost total for loot in a bots backpack by the bots levl
|
||||||
* @param pool pool of items to pick from
|
* Will return 0 for non PMCs
|
||||||
* @param equipmentSlots What equality slot will the loot items be added to
|
* @param botLevel Bots level
|
||||||
* @param totalItemCount Max count of items to add
|
* @param isPmc Is the bot a PMC
|
||||||
* @param inventoryToAddItemsTo bot inventory loot will be added to
|
* @returns number
|
||||||
* @param botRole role of the bot loot is being generated for (assault/pmcbot)
|
|
||||||
* @param useLimits should item limit counts be used as defined in config/bot.json
|
|
||||||
* @param totalValueLimitRub total value of loot allowed in roubles
|
|
||||||
* @param isPmc is the bot being generated for a pmc
|
|
||||||
*/
|
*/
|
||||||
protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void;
|
protected getBackpackRoubleTotalByLevel(botLevel: number, isPmc: boolean): number;
|
||||||
|
/**
|
||||||
|
* Get an array of the containers a bot has on them (pockets/backpack/vest)
|
||||||
|
* @param botInventory Bot to check
|
||||||
|
* @returns Array of available slots
|
||||||
|
*/
|
||||||
|
protected getAvailableContainersBotCanStoreItemsIn(botInventory: PmcInventory): EquipmentSlots[];
|
||||||
|
/**
|
||||||
|
* Force healing items onto bot to ensure they can heal in-raid
|
||||||
|
* @param botInventory Inventory to add items to
|
||||||
|
* @param botRole Role of bot (pmcBEAR/pmcUSEC)
|
||||||
|
*/
|
||||||
|
protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void;
|
||||||
|
/**
|
||||||
|
* 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 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: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean, containersIdFull?: Set<string>): void;
|
||||||
|
protected createWalletLoot(walletId: string): IItem[][];
|
||||||
|
/**
|
||||||
|
* 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: IItem[], isPmc: boolean, botRole: string): void;
|
||||||
/**
|
/**
|
||||||
* Add generated weapons to inventory as loot
|
* Add generated weapons to inventory as loot
|
||||||
* @param botInventory inventory to add preset to
|
* @param botInventory inventory to add preset to
|
||||||
* @param equipmentSlot slot to place the preset in (backpack)
|
* @param equipmentSlot slot to place the preset in (backpack)
|
||||||
* @param templateInventory bots template, assault.json
|
* @param templateInventory bots template, assault.json
|
||||||
* @param modChances chances for mods to spawn on weapon
|
* @param modChances chances for mods to spawn on weapon
|
||||||
* @param botRole bots role, .e.g. pmcBot
|
* @param botRole bots role .e.g. pmcBot
|
||||||
* @param isPmc are we generating for a pmc
|
* @param isPmc are we generating for a pmc
|
||||||
*/
|
*/
|
||||||
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void;
|
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: IInventory, modChances: IModsChances, botRole: string, isPmc: boolean, botLevel: number, containersIdFull?: Set<string>): void;
|
||||||
/**
|
/**
|
||||||
* Get a random item from the pool parameter using the biasedRandomNumber system
|
* Hydrate item limit array to contain items that have a limit for a specific bot type
|
||||||
* @param pool pool of items to pick an item from
|
|
||||||
* @param isPmc is the bot being created a pmc
|
|
||||||
* @returns ITemplateItem object
|
|
||||||
*/
|
|
||||||
protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem;
|
|
||||||
/**
|
|
||||||
* Get the loot nvalue from botconfig
|
|
||||||
* @param isPmc if true the pmc nvalue is returned
|
|
||||||
* @returns nvalue as number
|
|
||||||
*/
|
|
||||||
protected getBotLootNValue(isPmc: boolean): number;
|
|
||||||
/**
|
|
||||||
* Update item limit array to contain items that have a limit
|
|
||||||
* All values are set to 0
|
* All values are set to 0
|
||||||
* @param isPmc is the bot a pmc
|
* @param botRole Role the bot has
|
||||||
* @param botRole role the bot has
|
|
||||||
* @param limitCount
|
* @param limitCount
|
||||||
*/
|
*/
|
||||||
protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record<string, number>): void;
|
protected initItemLimitArray(botRole: string, limitCount: Record<string, number>): void;
|
||||||
/**
|
/**
|
||||||
* Check if an item has reached its bot-specific spawn limit
|
* Check if an item has reached its bot-specific spawn limit
|
||||||
* @param itemTemplate Item we check to see if its reached spawn limit
|
* @param itemTemplate Item we check to see if its reached spawn limit
|
||||||
* @param botRole Bot type
|
* @param botRole Bot type
|
||||||
* @param isPmc Is bot we're working with a pmc
|
* @param itemSpawnLimits
|
||||||
* @param limitCount spawn limits for items on bot
|
|
||||||
* @param itemSpawnLimits the limits this bot is allowed to have
|
|
||||||
* @returns true if item has reached spawn limit
|
* @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;
|
||||||
/**
|
|
||||||
* Is the item an ammo box
|
|
||||||
* @param props props of the item to check
|
|
||||||
* @returns true if item is an ammo box
|
|
||||||
*/
|
|
||||||
protected isAmmoBox(props: Props): boolean;
|
|
||||||
/**
|
|
||||||
* Create an object that contains the ammo stack for an ammo box
|
|
||||||
* @param parentId ammo box id
|
|
||||||
* @param props ammo box props
|
|
||||||
* @returns Item object
|
|
||||||
*/
|
|
||||||
protected createAmmoForAmmoBox(parentId: string, props: Props): Item;
|
|
||||||
/**
|
/**
|
||||||
* Randomise the stack size of a money object, uses different values for pmc or scavs
|
* Randomise the stack size of a money object, uses different values for pmc or scavs
|
||||||
* @param isPmc is this a PMC
|
* @param botRole Role bot has that has money stack
|
||||||
* @param itemTemplate item details
|
* @param itemTemplate item details from db
|
||||||
* @param moneyItem Money stack to randomise
|
* @param moneyItem Money item to randomise
|
||||||
*/
|
*/
|
||||||
protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void;
|
protected randomiseMoneyStackSize(botRole: string, itemTemplate: ITemplateItem, moneyItem: IItem): void;
|
||||||
/**
|
/**
|
||||||
* Randomise the size of an ammo stack
|
* Randomise the size of an ammo stack
|
||||||
* @param isPmc is this a PMC
|
* @param isPmc Is ammo on a PMC bot
|
||||||
* @param itemTemplate item details
|
* @param itemTemplate item details from db
|
||||||
* @param ammoItem Ammo stack to randomise
|
* @param ammoItem Ammo item to randomise
|
||||||
*/
|
*/
|
||||||
protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void;
|
protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: IItem): void;
|
||||||
/**
|
/**
|
||||||
* Get spawn limits for a specific bot type from bot.json config
|
* 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
|
* 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
|
* @param botRole what role does the bot have
|
||||||
* @returns Dictionary of tplIds and limit
|
* @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
|
* Get the parentId or tplId of item inside spawnLimits object if it exists
|
||||||
* @param itemTemplate item we want to look for in spawn limits
|
* @param itemTemplate item we want to look for in spawn limits
|
||||||
|
131
types/generators/BotWeaponGenerator.d.ts
vendored
131
types/generators/BotWeaponGenerator.d.ts
vendored
@ -1,29 +1,30 @@
|
|||||||
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
import { BotEquipmentModGenerator } from "@spt/generators/BotEquipmentModGenerator";
|
||||||
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
|
import { IInventoryMagGen } from "@spt/generators/weapongen/IInventoryMagGen";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper";
|
||||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
import { BotWeaponGeneratorHelper } from "@spt/helpers/BotWeaponGeneratorHelper";
|
||||||
import { MinMax } from "../models/common/MinMax";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
|
import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper";
|
||||||
import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType";
|
import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { IGenerationData, IInventory, IModsChances } from "@spt/models/eft/common/tables/IBotType";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
import { IItem } from "@spt/models/eft/common/tables/IItem";
|
||||||
import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult";
|
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { IGenerateWeaponResult } from "@spt/models/spt/bots/IGenerateWeaponResult";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig";
|
||||||
import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
|
import { RepairService } from "@spt/services/RepairService";
|
||||||
import { IInventoryMagGen } from "./weapongen/IInventoryMagGen";
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
export declare class BotWeaponGenerator {
|
export declare class BotWeaponGenerator {
|
||||||
protected jsonUtil: JsonUtil;
|
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected weightedRandomHelper: WeightedRandomHelper;
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
protected botGeneratorHelper: BotGeneratorHelper;
|
protected botGeneratorHelper: BotGeneratorHelper;
|
||||||
@ -33,10 +34,14 @@ export declare class BotWeaponGenerator {
|
|||||||
protected botWeaponModLimitService: BotWeaponModLimitService;
|
protected botWeaponModLimitService: BotWeaponModLimitService;
|
||||||
protected botEquipmentModGenerator: BotEquipmentModGenerator;
|
protected botEquipmentModGenerator: BotEquipmentModGenerator;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
|
protected repairService: RepairService;
|
||||||
protected inventoryMagGenComponents: IInventoryMagGen[];
|
protected inventoryMagGenComponents: IInventoryMagGen[];
|
||||||
|
protected cloner: ICloner;
|
||||||
protected readonly modMagazineSlotId = "mod_magazine";
|
protected readonly modMagazineSlotId = "mod_magazine";
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]);
|
protected pmcConfig: IPmcConfig;
|
||||||
|
protected repairConfig: IRepairConfig;
|
||||||
|
constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[], cloner: ICloner);
|
||||||
/**
|
/**
|
||||||
* Pick a random weapon based on weightings and generate a functional weapon
|
* Pick a random weapon based on weightings and generate a functional weapon
|
||||||
* @param equipmentSlot Primary/secondary/holster
|
* @param equipmentSlot Primary/secondary/holster
|
||||||
@ -47,26 +52,34 @@ export declare class BotWeaponGenerator {
|
|||||||
* @param isPmc Is weapon generated for a pmc
|
* @param isPmc Is weapon generated for a pmc
|
||||||
* @returns GenerateWeaponResult object
|
* @returns GenerateWeaponResult object
|
||||||
*/
|
*/
|
||||||
generateRandomWeapon(sessionId: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult;
|
generateRandomWeapon(sessionId: string, equipmentSlot: string, botTemplateInventory: IInventory, weaponParentId: string, modChances: IModsChances, botRole: string, isPmc: boolean, botLevel: number): IGenerateWeaponResult;
|
||||||
/**
|
/**
|
||||||
* Get a random weighted weapon from a bots pool of weapons
|
* Get a random weighted weapon from a bots pool of weapons
|
||||||
* @param equipmentSlot Primary/secondary/holster
|
* @param equipmentSlot Primary/secondary/holster
|
||||||
* @param botTemplateInventory e.g. assault.json
|
* @param botTemplateInventory e.g. assault.json
|
||||||
* @returns weapon tpl
|
* @returns weapon tpl
|
||||||
*/
|
*/
|
||||||
pickWeightedWeaponTplFromPool(equipmentSlot: string, botTemplateInventory: Inventory): string;
|
pickWeightedWeaponTplFromPool(equipmentSlot: string, botTemplateInventory: IInventory): string;
|
||||||
/**
|
/**
|
||||||
* Generated a weapon based on the supplied weapon tpl
|
* Generated a weapon based on the supplied weapon tpl
|
||||||
* @param weaponTpl weapon tpl to generate (use pickWeightedWeaponTplFromPool())
|
* @param weaponTpl Weapon tpl to generate (use pickWeightedWeaponTplFromPool())
|
||||||
* @param equipmentSlot slot to fit into, primary/secondary/holster
|
* @param slotName Slot to fit into, primary/secondary/holster
|
||||||
* @param botTemplateInventory e.g. assault.json
|
* @param botTemplateInventory e.g. assault.json
|
||||||
* @param weaponParentId ParentId of the weapon being generated
|
* @param weaponParentId ParentId of the weapon being generated
|
||||||
* @param modChances Dictionary of item types and % chance weapon will have that mod
|
* @param modChances Dictionary of item types and % chance weapon will have that mod
|
||||||
* @param botRole e.g. assault/exusec
|
* @param botRole e.g. assault/exusec
|
||||||
* @param isPmc
|
* @param isPmc Is weapon being generated for a pmc
|
||||||
* @returns GenerateWeaponResult object
|
* @returns GenerateWeaponResult object
|
||||||
*/
|
*/
|
||||||
generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult;
|
generateWeaponByTpl(sessionId: string, weaponTpl: string, slotName: string, botTemplateInventory: IInventory, weaponParentId: string, modChances: IModsChances, botRole: string, isPmc: boolean, botLevel: number): IGenerateWeaponResult;
|
||||||
|
/**
|
||||||
|
* Insert a cartridge(s) into a weapon
|
||||||
|
* Handles all chambers - patron_in_weapon, patron_in_weapon_000 etc
|
||||||
|
* @param weaponWithModsArray Weapon and mods
|
||||||
|
* @param ammoTpl Cartridge to add to weapon
|
||||||
|
* @param chamberSlotIds name of slots to create or add ammo to
|
||||||
|
*/
|
||||||
|
protected addCartridgeToChamber(weaponWithModsArray: IItem[], ammoTpl: string, chamberSlotIds: string[]): void;
|
||||||
/**
|
/**
|
||||||
* Create array with weapon base as only element and
|
* Create array with weapon base as only element and
|
||||||
* add additional properties based on weapon type
|
* add additional properties based on weapon type
|
||||||
@ -77,7 +90,7 @@ export declare class BotWeaponGenerator {
|
|||||||
* @param botRole for durability values
|
* @param botRole for durability values
|
||||||
* @returns Base weapon item in array
|
* @returns Base weapon item in array
|
||||||
*/
|
*/
|
||||||
protected constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): Item[];
|
protected constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): IItem[];
|
||||||
/**
|
/**
|
||||||
* Get the mods necessary to kit out a weapon to its preset level
|
* Get the mods necessary to kit out a weapon to its preset level
|
||||||
* @param weaponTpl weapon to find preset for
|
* @param weaponTpl weapon to find preset for
|
||||||
@ -85,22 +98,30 @@ export declare class BotWeaponGenerator {
|
|||||||
* @param weaponParentId Value used for the parentid
|
* @param weaponParentId Value used for the parentid
|
||||||
* @returns array of weapon mods
|
* @returns array of weapon mods
|
||||||
*/
|
*/
|
||||||
protected getPresetWeaponMods(weaponTpl: string, equipmentSlot: string, weaponParentId: string, itemTemplate: ITemplateItem, botRole: string): Item[];
|
protected getPresetWeaponMods(weaponTpl: string, equipmentSlot: string, weaponParentId: string, itemTemplate: ITemplateItem, botRole: string): IItem[];
|
||||||
/**
|
/**
|
||||||
* Checks if all required slots are occupied on a weapon and all it's mods
|
* Checks if all required slots are occupied on a weapon and all it's mods
|
||||||
* @param weaponItemArray Weapon + mods
|
* @param weaponItemArray Weapon + mods
|
||||||
|
* @param botRole role of bot weapon is for
|
||||||
* @returns true if valid
|
* @returns true if valid
|
||||||
*/
|
*/
|
||||||
protected isWeaponValid(weaponItemArray: Item[]): boolean;
|
protected isWeaponValid(weaponItemArray: IItem[], botRole: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets.
|
* Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets.
|
||||||
* Additionally, adds extra bullets to SecuredContainer
|
* Additionally, adds extra bullets to SecuredContainer
|
||||||
* @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl)
|
* @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl)
|
||||||
* @param magCounts Magazine count to add to inventory
|
* @param magWeights Magazine weights for count to add to inventory
|
||||||
* @param inventory Inventory to add magazines to
|
* @param inventory Inventory to add magazines to
|
||||||
* @param botRole The bot type we're getting generating extra mags for
|
* @param botRole The bot type we're getting generating extra mags for
|
||||||
*/
|
*/
|
||||||
addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void;
|
addExtraMagazinesToInventory(generatedWeaponResult: IGenerateWeaponResult, magWeights: IGenerationData, inventory: PmcInventory, botRole: string): void;
|
||||||
|
/**
|
||||||
|
* Add Grendaes for UBGL to bots vest and secure container
|
||||||
|
* @param weaponMods Weapon array with mods
|
||||||
|
* @param generatedWeaponResult result of weapon generation
|
||||||
|
* @param inventory bot inventory to add grenades to
|
||||||
|
*/
|
||||||
|
protected addUbglGrenadesToBotInventory(weaponMods: IItem[], generatedWeaponResult: IGenerateWeaponResult, inventory: PmcInventory): void;
|
||||||
/**
|
/**
|
||||||
* Add ammo to the secure container
|
* Add ammo to the secure container
|
||||||
* @param stackCount How many stacks of ammo to add
|
* @param stackCount How many stacks of ammo to add
|
||||||
@ -116,14 +137,20 @@ export declare class BotWeaponGenerator {
|
|||||||
* @param botRole the bot type we are getting the magazine for
|
* @param botRole the bot type we are getting the magazine for
|
||||||
* @returns magazine tpl string
|
* @returns magazine tpl string
|
||||||
*/
|
*/
|
||||||
protected getMagazineTplFromWeaponTemplate(weaponMods: Item[], weaponTemplate: ITemplateItem, botRole: string): string;
|
protected getMagazineTplFromWeaponTemplate(weaponMods: IItem[], weaponTemplate: ITemplateItem, botRole: string): string;
|
||||||
/**
|
/**
|
||||||
* Finds and return a compatible ammo tpl based on the bots ammo weightings (x.json/inventory/equipment/ammo)
|
* Finds and return a compatible ammo tpl based on the bots ammo weightings (x.json/inventory/equipment/ammo)
|
||||||
* @param ammo a list of ammo tpls the weapon can use
|
* @param cartridgePool Dict of all cartridges keyed by type e.g. Caliber556x45NATO
|
||||||
* @param weaponTemplate the weapon we want to pick ammo for
|
* @param weaponTemplate Weapon details from db we want to pick ammo for
|
||||||
* @returns an ammo tpl that works with the desired gun
|
* @returns Ammo tpl that works with the desired gun
|
||||||
*/
|
*/
|
||||||
protected getWeightedCompatibleAmmo(ammo: Record<string, Record<string, number>>, weaponTemplate: ITemplateItem): string;
|
protected getWeightedCompatibleAmmo(cartridgePool: Record<string, Record<string, number>>, weaponTemplate: ITemplateItem): string;
|
||||||
|
/**
|
||||||
|
* Get the cartridge ids from a weapon template that work with the weapon
|
||||||
|
* @param weaponTemplate Weapon db template to get cartridges for
|
||||||
|
* @returns Array of cartridge tpls
|
||||||
|
*/
|
||||||
|
protected getCompatibleCartridgesFromWeaponTemplate(weaponTemplate: ITemplateItem): string[];
|
||||||
/**
|
/**
|
||||||
* Get a weapons compatible cartridge caliber
|
* Get a weapons compatible cartridge caliber
|
||||||
* @param weaponTemplate Weapon to look up caliber of
|
* @param weaponTemplate Weapon to look up caliber of
|
||||||
@ -132,24 +159,32 @@ export declare class BotWeaponGenerator {
|
|||||||
protected getWeaponCaliber(weaponTemplate: ITemplateItem): string;
|
protected getWeaponCaliber(weaponTemplate: ITemplateItem): string;
|
||||||
/**
|
/**
|
||||||
* Fill existing magazines to full, while replacing their contents with specified ammo
|
* Fill existing magazines to full, while replacing their contents with specified ammo
|
||||||
* @param weaponMods
|
* @param weaponMods Weapon with children
|
||||||
* @param magazine
|
* @param magazine Magazine item
|
||||||
* @param ammoTpl
|
* @param cartridgeTpl Cartridge to insert into magazine
|
||||||
*/
|
*/
|
||||||
protected fillExistingMagazines(weaponMods: Item[], magazine: Item, ammoTpl: string): void;
|
protected fillExistingMagazines(weaponMods: IItem[], magazine: IItem, cartridgeTpl: string): void;
|
||||||
|
/**
|
||||||
|
* Add desired ammo tpl as item to weaponmods array, placed as child to UBGL
|
||||||
|
* @param weaponMods Weapon with children
|
||||||
|
* @param ubglMod UBGL item
|
||||||
|
* @param ubglAmmoTpl Grenade ammo tpl
|
||||||
|
*/
|
||||||
|
protected fillUbgl(weaponMods: IItem[], ubglMod: IItem, ubglAmmoTpl: string): void;
|
||||||
/**
|
/**
|
||||||
* Add cartridge item to weapon Item array, if it already exists, update
|
* Add cartridge item to weapon Item array, if it already exists, update
|
||||||
* @param weaponMods Weapon items array to amend
|
* @param weaponWithMods Weapon items array to amend
|
||||||
* @param magazine magazine item details we're adding cartridges to
|
* @param magazine magazine item details we're adding cartridges to
|
||||||
* @param chosenAmmo cartridge to put into the magazine
|
* @param chosenAmmoTpl cartridge to put into the magazine
|
||||||
* @param newStackSize how many cartridges should go into the magazine
|
* @param newStackSize how many cartridges should go into the magazine
|
||||||
|
* @param magazineTemplate magazines db template
|
||||||
*/
|
*/
|
||||||
protected addOrUpdateMagazinesChildWithAmmo(weaponMods: Item[], magazine: Item, chosenAmmo: string, newStackSize: number): void;
|
protected addOrUpdateMagazinesChildWithAmmo(weaponWithMods: IItem[], magazine: IItem, chosenAmmoTpl: string, magazineTemplate: ITemplateItem): void;
|
||||||
/**
|
/**
|
||||||
* Fill each Camora with a bullet
|
* Fill each Camora with a bullet
|
||||||
* @param weaponMods Weapon mods to find and update camora mod(s) from
|
* @param weaponMods Weapon mods to find and update camora mod(s) from
|
||||||
* @param magazineId magazine id to find and add to
|
* @param magazineId magazine id to find and add to
|
||||||
* @param ammoTpl ammo template id to hydate with
|
* @param ammoTpl ammo template id to hydate with
|
||||||
*/
|
*/
|
||||||
protected fillCamorasWithAmmo(weaponMods: Item[], magazineId: string, ammoTpl: string): void;
|
protected fillCamorasWithAmmo(weaponMods: IItem[], magazineId: string, ammoTpl: string): void;
|
||||||
}
|
}
|
||||||
|
51
types/generators/FenceBaseAssortGenerator.d.ts
vendored
51
types/generators/FenceBaseAssortGenerator.d.ts
vendored
@ -1,24 +1,53 @@
|
|||||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
import { HandbookHelper } from "@spt/helpers/HandbookHelper";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
import { IItem } from "@spt/models/eft/common/tables/IItem";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { ItemFilterService } from "../services/ItemFilterService";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { FenceService } from "@spt/services/FenceService";
|
||||||
|
import { ItemFilterService } from "@spt/services/ItemFilterService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { SeasonalEventService } from "@spt/services/SeasonalEventService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
export declare class FenceBaseAssortGenerator {
|
export declare class FenceBaseAssortGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected databaseServer: DatabaseServer;
|
protected hashUtil: HashUtil;
|
||||||
|
protected databaseService: DatabaseService;
|
||||||
protected handbookHelper: HandbookHelper;
|
protected handbookHelper: HandbookHelper;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
|
protected presetHelper: PresetHelper;
|
||||||
protected itemFilterService: ItemFilterService;
|
protected itemFilterService: ItemFilterService;
|
||||||
|
protected seasonalEventService: SeasonalEventService;
|
||||||
|
protected localisationService: LocalisationService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected fenceService: FenceService;
|
||||||
protected traderConfig: ITraderConfig;
|
protected traderConfig: ITraderConfig;
|
||||||
constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, fenceService: FenceService);
|
||||||
/**
|
/**
|
||||||
* Create base fence assorts dynamically and store in db
|
* Create base fence assorts dynamically and store in memory
|
||||||
*/
|
*/
|
||||||
generateFenceBaseAssorts(): void;
|
generateFenceBaseAssorts(): void;
|
||||||
|
/**
|
||||||
|
* Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit
|
||||||
|
* @param rootItemDb Ammo box or ammo item from items.db
|
||||||
|
* @returns True if penetration value is above limit set in config
|
||||||
|
*/
|
||||||
|
protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean;
|
||||||
|
/**
|
||||||
|
* Get the penetration power value of an ammo, works with ammo boxes and raw ammos
|
||||||
|
* @param rootItemDb Ammo box or ammo item from items.db
|
||||||
|
* @returns Penetration power of passed in item, undefined if it doesnt have a power
|
||||||
|
*/
|
||||||
|
protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number | undefined;
|
||||||
|
/**
|
||||||
|
* 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: IItem[], itemDbDetails: ITemplateItem): void;
|
||||||
/**
|
/**
|
||||||
* Check if item is valid for being added to fence assorts
|
* Check if item is valid for being added to fence assorts
|
||||||
* @param item Item to check
|
* @param item Item to check
|
||||||
|
55
types/generators/LocationGenerator.d.ts
vendored
55
types/generators/LocationGenerator.d.ts
vendored
@ -1,55 +0,0 @@
|
|||||||
import { ContainerHelper } from "../helpers/ContainerHelper";
|
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
|
||||||
import { PresetHelper } from "../helpers/PresetHelper";
|
|
||||||
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
|
|
||||||
import { ILooseLoot, SpawnpointsForced, SpawnpointTemplate } from "../models/eft/common/ILooseLoot";
|
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
|
||||||
import { IStaticAmmoDetails, IStaticContainerProps, 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 { LocalisationService } from "../services/LocalisationService";
|
|
||||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
|
||||||
import { MathUtil } from "../utils/MathUtil";
|
|
||||||
import { ObjectId } from "../utils/ObjectId";
|
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
|
||||||
export interface IContainerItem {
|
|
||||||
items: Item[];
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
}
|
|
||||||
export declare class LocationGenerator {
|
|
||||||
protected logger: ILogger;
|
|
||||||
protected jsonUtil: JsonUtil;
|
|
||||||
protected objectId: ObjectId;
|
|
||||||
protected randomUtil: RandomUtil;
|
|
||||||
protected ragfairServerHelper: RagfairServerHelper;
|
|
||||||
protected itemHelper: ItemHelper;
|
|
||||||
protected mathUtil: MathUtil;
|
|
||||||
protected seasonalEventService: SeasonalEventService;
|
|
||||||
protected containerHelper: ContainerHelper;
|
|
||||||
protected presetHelper: PresetHelper;
|
|
||||||
protected localisationService: LocalisationService;
|
|
||||||
protected configServer: ConfigServer;
|
|
||||||
protected locationConfig: ILocationConfig;
|
|
||||||
constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
|
|
||||||
generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerProps;
|
|
||||||
protected getLooseLootMultiplerForLocation(location: string): number;
|
|
||||||
protected getStaticLootMultiplerForLocation(location: string): number;
|
|
||||||
/**
|
|
||||||
* Create array of loose + forced loot using probability system
|
|
||||||
* @param dynamicLootDist
|
|
||||||
* @param staticAmmoDist
|
|
||||||
* @param locationName Location to generate loot for
|
|
||||||
* @returns Array of spawn points with loot in them
|
|
||||||
*/
|
|
||||||
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
|
|
||||||
*/
|
|
||||||
protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[]): void;
|
|
||||||
protected createItem(tpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
|
|
||||||
}
|
|
144
types/generators/LocationLootGenerator.d.ts
vendored
Normal file
144
types/generators/LocationLootGenerator.d.ts
vendored
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
import { ContainerHelper } from "@spt/helpers/ContainerHelper";
|
||||||
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
|
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||||
|
import { IContainerMinMax, IStaticAmmoDetails, IStaticContainer, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "@spt/models/eft/common/ILocation";
|
||||||
|
import { ILocationBase } from "@spt/models/eft/common/ILocationBase";
|
||||||
|
import { ILooseLoot, ISpawnpointTemplate, ISpawnpointsForced } from "@spt/models/eft/common/ILooseLoot";
|
||||||
|
import { IItem } from "@spt/models/eft/common/tables/IItem";
|
||||||
|
import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig";
|
||||||
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { ItemFilterService } from "@spt/services/ItemFilterService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { SeasonalEventService } from "@spt/services/SeasonalEventService";
|
||||||
|
import { MathUtil } from "@spt/utils/MathUtil";
|
||||||
|
import { ObjectId } from "@spt/utils/ObjectId";
|
||||||
|
import { ProbabilityObjectArray, RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
|
export interface IContainerItem {
|
||||||
|
items: IItem[];
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
}
|
||||||
|
export interface IContainerGroupCount {
|
||||||
|
/** Containers this group has + probabilty to spawn */
|
||||||
|
containerIdsWithProbability: Record<string, number>;
|
||||||
|
/** How many containers the map should spawn with this group id */
|
||||||
|
chosenCount: number;
|
||||||
|
}
|
||||||
|
export declare class LocationLootGenerator {
|
||||||
|
protected logger: ILogger;
|
||||||
|
protected databaseService: DatabaseService;
|
||||||
|
protected objectId: ObjectId;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
|
protected itemHelper: ItemHelper;
|
||||||
|
protected mathUtil: MathUtil;
|
||||||
|
protected seasonalEventService: SeasonalEventService;
|
||||||
|
protected containerHelper: ContainerHelper;
|
||||||
|
protected presetHelper: PresetHelper;
|
||||||
|
protected localisationService: LocalisationService;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
|
protected configServer: ConfigServer;
|
||||||
|
protected cloner: ICloner;
|
||||||
|
protected locationConfig: ILocationConfig;
|
||||||
|
constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner);
|
||||||
|
/**
|
||||||
|
* Create an array of container objects with randomised loot
|
||||||
|
* @param locationBase Map base to generate containers for
|
||||||
|
* @param staticAmmoDist Static ammo distribution
|
||||||
|
* @returns Array of container objects
|
||||||
|
*/
|
||||||
|
generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): ISpawnpointTemplate[];
|
||||||
|
/**
|
||||||
|
* Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist
|
||||||
|
* @param staticContainers
|
||||||
|
* @returns IStaticContainerData array
|
||||||
|
*/
|
||||||
|
protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[];
|
||||||
|
/**
|
||||||
|
* Get containers with 100% spawn rate or have a type on the randomistion ignore list
|
||||||
|
* @param staticContainersOnMap
|
||||||
|
* @returns IStaticContainerData array
|
||||||
|
*/
|
||||||
|
protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[];
|
||||||
|
/**
|
||||||
|
* Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount
|
||||||
|
* @param groupId Name of the group the containers are being collected for
|
||||||
|
* @param containerData Containers and probability values for a groupId
|
||||||
|
* @returns List of chosen container Ids
|
||||||
|
*/
|
||||||
|
protected getContainersByProbabilty(groupId: string, containerData: IContainerGroupCount): string[];
|
||||||
|
/**
|
||||||
|
* Get a mapping of each groupid and the containers in that group + count of containers to spawn on map
|
||||||
|
* @param containersGroups Container group values
|
||||||
|
* @returns dictionary keyed by groupId
|
||||||
|
*/
|
||||||
|
protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record<string, IContainerMinMax>, staticContainersOnMap: IStaticContainerData[]): Record<string, IContainerGroupCount>;
|
||||||
|
/**
|
||||||
|
* Choose loot to put into a static container based on weighting
|
||||||
|
* Handle forced items + seasonal item removal when not in season
|
||||||
|
* @param staticContainer The container itself we will add loot to
|
||||||
|
* @param staticForced Loot we need to force into the container
|
||||||
|
* @param staticLootDist staticLoot.json
|
||||||
|
* @param staticAmmoDist staticAmmo.json
|
||||||
|
* @param locationName Name of the map to generate static loot for
|
||||||
|
* @returns IStaticContainerProps
|
||||||
|
*/
|
||||||
|
protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerData;
|
||||||
|
/**
|
||||||
|
* Get a 2d grid of a containers item slots
|
||||||
|
* @param containerTpl Tpl id of the container
|
||||||
|
* @returns number[][]
|
||||||
|
*/
|
||||||
|
protected getContainerMapping(containerTpl: string): number[][];
|
||||||
|
/**
|
||||||
|
* Look up a containers itemcountDistribution data and choose an item count based on the found weights
|
||||||
|
* @param containerTypeId Container to get item count for
|
||||||
|
* @param staticLootDist staticLoot.json
|
||||||
|
* @param locationName Map name (to get per-map multiplier for from config)
|
||||||
|
* @returns item count
|
||||||
|
*/
|
||||||
|
protected getWeightedCountOfContainerItems(containerTypeId: string, staticLootDist: Record<string, IStaticLootDetails>, locationName: string): number;
|
||||||
|
/**
|
||||||
|
* Get all possible loot items that can be placed into a container
|
||||||
|
* Do not add seasonal items if found + current date is inside seasonal event
|
||||||
|
* @param containerTypeId Contianer to get possible loot for
|
||||||
|
* @param staticLootDist staticLoot.json
|
||||||
|
* @returns ProbabilityObjectArray of item tpls + probabilty
|
||||||
|
*/
|
||||||
|
protected getPossibleLootItemsForContainer(containerTypeId: string, staticLootDist: Record<string, IStaticLootDetails>): ProbabilityObjectArray<string, number>;
|
||||||
|
protected getLooseLootMultiplerForLocation(location: string): number;
|
||||||
|
protected getStaticLootMultiplerForLocation(location: string): number;
|
||||||
|
/**
|
||||||
|
* Create array of loose + forced loot using probability system
|
||||||
|
* @param dynamicLootDist
|
||||||
|
* @param staticAmmoDist
|
||||||
|
* @param locationName Location to generate loot for
|
||||||
|
* @returns Array of spawn points with loot in them
|
||||||
|
*/
|
||||||
|
generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): ISpawnpointTemplate[];
|
||||||
|
/**
|
||||||
|
* Add forced spawn point loot into loot parameter array
|
||||||
|
* @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(lootLocationTemplates: ISpawnpointTemplate[], forcedSpawnPoints: ISpawnpointsForced[], locationName: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): void;
|
||||||
|
/**
|
||||||
|
* Create array of item (with child items) and return
|
||||||
|
* @param chosenComposedKey Key we want to look up items for
|
||||||
|
* @param spawnPoint Dynamic spawn point item we want will be placed in
|
||||||
|
* @param staticAmmoDist ammo distributions
|
||||||
|
* @returns IContainerItem
|
||||||
|
*/
|
||||||
|
protected createDynamicLootItem(chosenComposedKey: string, items: IItem[], staticAmmoDist: Record<string, IStaticAmmoDetails[]>): IContainerItem;
|
||||||
|
/**
|
||||||
|
* Find an item in array by its _tpl, handle differently if chosenTpl is a weapon
|
||||||
|
* @param items Items array to search
|
||||||
|
* @param chosenTpl Tpl we want to get item with
|
||||||
|
* @returns Item object
|
||||||
|
*/
|
||||||
|
protected getItemInArray(items: IItem[], chosenTpl: string): IItem | undefined;
|
||||||
|
protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
|
||||||
|
}
|
125
types/generators/LootGenerator.d.ts
vendored
125
types/generators/LootGenerator.d.ts
vendored
@ -1,38 +1,75 @@
|
|||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { InventoryHelper } from "@spt/helpers/InventoryHelper";
|
||||||
import { Preset } from "../models/eft/common/IGlobals";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||||
import { LootItem } from "../models/spt/services/LootItem";
|
import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper";
|
||||||
import { LootRequest } from "../models/spt/services/LootRequest";
|
import { MinMax } from "@spt/models/common/MinMax";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IPreset } from "@spt/models/eft/common/IGlobals";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IItem } from "@spt/models/eft/common/tables/IItem";
|
||||||
import { ItemFilterService } from "../services/ItemFilterService";
|
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { IRewardDetails, ISealedAirdropContainerSettings } from "@spt/models/spt/config/IInventoryConfig";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { ILootRequest } from "@spt/models/spt/services/ILootRequest";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { ItemFilterService } from "@spt/services/ItemFilterService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { RagfairLinkedItemService } from "@spt/services/RagfairLinkedItemService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
type ItemLimit = {
|
||||||
|
current: number;
|
||||||
|
max: number;
|
||||||
|
};
|
||||||
export declare class LootGenerator {
|
export declare class LootGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
|
protected presetHelper: PresetHelper;
|
||||||
|
protected inventoryHelper: InventoryHelper;
|
||||||
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
|
protected ragfairLinkedItemService: RagfairLinkedItemService;
|
||||||
protected itemFilterService: ItemFilterService;
|
protected itemFilterService: ItemFilterService;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService);
|
constructor(logger: ILogger, hashUtil: HashUtil, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService);
|
||||||
/**
|
/**
|
||||||
* Generate a list of items based on configuration options parameter
|
* Generate a list of items based on configuration options parameter
|
||||||
* @param options parameters to adjust how loot is generated
|
* @param options parameters to adjust how loot is generated
|
||||||
* @returns An array of loot items
|
* @returns An array of loot items
|
||||||
*/
|
*/
|
||||||
createRandomloot(options: LootRequest): LootItem[];
|
createRandomLoot(options: ILootRequest): IItem[];
|
||||||
/**
|
/**
|
||||||
* Construct item limit record to hold max and current item count
|
* Generate An array of items
|
||||||
|
* TODO - handle weapon presets/ammo packs
|
||||||
|
* @param forcedLootDict Dictionary of item tpls with minmax values
|
||||||
|
* @returns Array of IItem
|
||||||
|
*/
|
||||||
|
createForcedLoot(forcedLootDict: Record<string, MinMax>): IItem[];
|
||||||
|
/**
|
||||||
|
* Get pool of items from item db that fit passed in param criteria
|
||||||
|
* @param itemTplBlacklist Prevent these items
|
||||||
|
* @param itemTypeWhitelist Only allow these items
|
||||||
|
* @param useRewardItemBlacklist Should item.json reward item config be used
|
||||||
|
* @param allowBossItems Should boss items be allowed in result
|
||||||
|
* @returns results of filtering + blacklist used
|
||||||
|
*/
|
||||||
|
protected getItemRewardPool(itemTplBlacklist: string[], itemTypeWhitelist: string[], useRewardItemBlacklist: boolean, allowBossItems: boolean): {
|
||||||
|
itemPool: [string, ITemplateItem][];
|
||||||
|
blacklist: Set<string>;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Filter armor items by their front plates protection level - top if its a helmet
|
||||||
|
* @param armor Armor preset to check
|
||||||
|
* @param options Loot request options - armor level etc
|
||||||
|
* @returns True if item has desired armor level
|
||||||
|
*/
|
||||||
|
protected isArmorOfDesiredProtectionLevel(armor: IPreset, options: ILootRequest): boolean;
|
||||||
|
/**
|
||||||
|
* Construct item limit record to hold max and current item count for each item type
|
||||||
* @param limits limits as defined in config
|
* @param limits limits as defined in config
|
||||||
* @returns record, key: item tplId, value: current/max item count allowed
|
* @returns record, key: item tplId, value: current/max item count allowed
|
||||||
*/
|
*/
|
||||||
protected initItemLimitCounter(limits: Record<string, number>): Record<string, {
|
protected initItemLimitCounter(limits: Record<string, number>): Record<string, ItemLimit>;
|
||||||
current: number;
|
|
||||||
max: number;
|
|
||||||
}>;
|
|
||||||
/**
|
/**
|
||||||
* Find a random item in items.json and add to result array
|
* Find a random item in items.json and add to result array
|
||||||
* @param items items to choose from
|
* @param items items to choose from
|
||||||
@ -44,24 +81,58 @@ export declare class LootGenerator {
|
|||||||
protected findAndAddRandomItemToLoot(items: [string, ITemplateItem][], itemTypeCounts: Record<string, {
|
protected findAndAddRandomItemToLoot(items: [string, ITemplateItem][], itemTypeCounts: Record<string, {
|
||||||
current: number;
|
current: number;
|
||||||
max: number;
|
max: number;
|
||||||
}>, options: LootRequest, result: LootItem[]): boolean;
|
}>, options: ILootRequest, result: IItem[]): boolean;
|
||||||
/**
|
/**
|
||||||
* Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values
|
* Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values
|
||||||
* @param item item to get stack count of
|
* @param item item to get stack count of
|
||||||
* @param options loot options
|
* @param options loot options
|
||||||
* @returns stack count
|
* @returns stack count
|
||||||
*/
|
*/
|
||||||
protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number;
|
protected getRandomisedStackCount(item: ITemplateItem, options: ILootRequest): number;
|
||||||
/**
|
/**
|
||||||
* Find a random item in items.json and add to result array
|
* Find a random item in items.json and add to result array
|
||||||
* @param globalDefaultPresets presets to choose from
|
* @param presetPool Presets to choose from
|
||||||
* @param itemTypeCounts item limit counts
|
* @param itemTypeCounts Item limit counts
|
||||||
* @param itemBlacklist items to skip
|
* @param itemBlacklist Items to skip
|
||||||
* @param result array to add found preset to
|
* @param result Array to add chosen preset to
|
||||||
* @returns true if preset was valid and added to pool
|
* @returns true if preset was valid and added to pool
|
||||||
*/
|
*/
|
||||||
protected findAndAddRandomPresetToLoot(globalDefaultPresets: [string, Preset][], itemTypeCounts: Record<string, {
|
protected findAndAddRandomPresetToLoot(presetPool: IPreset[], itemTypeCounts: Record<string, {
|
||||||
current: number;
|
current: number;
|
||||||
max: number;
|
max: number;
|
||||||
}>, itemBlacklist: string[], result: LootItem[]): boolean;
|
}>, itemBlacklist: string[], result: IItem[]): boolean;
|
||||||
|
/**
|
||||||
|
* Sealed weapon containers have a weapon + associated mods inside them + assortment of other things (food/meds)
|
||||||
|
* @param containerSettings sealed weapon container settings
|
||||||
|
* @returns Array of item with children arrays
|
||||||
|
*/
|
||||||
|
getSealedWeaponCaseLoot(containerSettings: ISealedAirdropContainerSettings): IItem[][];
|
||||||
|
/**
|
||||||
|
* Get non-weapon mod rewards for a sealed container
|
||||||
|
* @param containerSettings Sealed weapon container settings
|
||||||
|
* @param weaponDetailsDb Details for the weapon to reward player
|
||||||
|
* @returns Array of item with children arrays
|
||||||
|
*/
|
||||||
|
protected getSealedContainerNonWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, weaponDetailsDb: ITemplateItem): IItem[][];
|
||||||
|
/**
|
||||||
|
* Iterate over the container weaponModRewardLimits settings and create an array of weapon mods to reward player
|
||||||
|
* @param containerSettings Sealed weapon container settings
|
||||||
|
* @param linkedItemsToWeapon All items that can be attached/inserted into weapon
|
||||||
|
* @param chosenWeaponPreset The weapon preset given to player as reward
|
||||||
|
* @returns Array of item with children arrays
|
||||||
|
*/
|
||||||
|
protected getSealedContainerWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, linkedItemsToWeapon: ITemplateItem[], chosenWeaponPreset: IPreset): IItem[][];
|
||||||
|
/**
|
||||||
|
* Handle event-related loot containers - currently just the halloween jack-o-lanterns that give food rewards
|
||||||
|
* @param rewardContainerDetails
|
||||||
|
* @returns Array of item with children arrays
|
||||||
|
*/
|
||||||
|
getRandomLootContainerLoot(rewardContainerDetails: IRewardDetails): IItem[][];
|
||||||
|
/**
|
||||||
|
* Pick a reward item based on the reward details data
|
||||||
|
* @param rewardContainerDetails
|
||||||
|
* @returns Single tpl
|
||||||
|
*/
|
||||||
|
protected pickRewardItem(rewardContainerDetails: IRewardDetails): string;
|
||||||
}
|
}
|
||||||
|
export {};
|
||||||
|
59
types/generators/PMCLootGenerator.d.ts
vendored
59
types/generators/PMCLootGenerator.d.ts
vendored
@ -1,21 +1,56 @@
|
|||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
||||||
import { ItemFilterService } from "../services/ItemFilterService";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { ItemFilterService } from "@spt/services/ItemFilterService";
|
||||||
|
import { RagfairPriceService } from "@spt/services/RagfairPriceService";
|
||||||
|
import { SeasonalEventService } from "@spt/services/SeasonalEventService";
|
||||||
/**
|
/**
|
||||||
* Handle the generation of dynamic PMC loot in pockets and backpacks
|
* Handle the generation of dynamic PMC loot in pockets and backpacks
|
||||||
* and the removal of blacklisted items
|
* and the removal of blacklisted items
|
||||||
*/
|
*/
|
||||||
export declare class PMCLootGenerator {
|
export declare class PMCLootGenerator {
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected itemFilterService: ItemFilterService;
|
protected itemFilterService: ItemFilterService;
|
||||||
protected pocketLootPool: string[];
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected backpackLootPool: string[];
|
protected seasonalEventService: SeasonalEventService;
|
||||||
protected botConfig: IBotConfig;
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService);
|
protected pocketLootPool: Record<string, number>;
|
||||||
generatePMCPocketLootPool(): string[];
|
protected vestLootPool: Record<string, number>;
|
||||||
generatePMCBackpackLootPool(): string[];
|
protected backpackLootPool: Record<string, number>;
|
||||||
|
protected pmcConfig: IPmcConfig;
|
||||||
|
constructor(itemHelper: ItemHelper, databaseService: DatabaseService, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper);
|
||||||
|
/**
|
||||||
|
* Create an array of loot items a PMC can have in their pockets
|
||||||
|
* @returns string array of tpls
|
||||||
|
*/
|
||||||
|
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(botRole: string): Record<string, number>;
|
||||||
|
/**
|
||||||
|
* Check if item has a width/height that lets it fit into a 2x2 slot
|
||||||
|
* 1x1 / 1x2 / 2x1 / 2x2
|
||||||
|
* @param item Item to check size of
|
||||||
|
* @returns true if it fits
|
||||||
|
*/
|
||||||
|
protected itemFitsInto2By2Slot(item: ITemplateItem): boolean;
|
||||||
|
/**
|
||||||
|
* Check if item has a width/height that lets it fit into a 1x2 slot
|
||||||
|
* 1x1 / 1x2 / 2x1
|
||||||
|
* @param item Item to check size of
|
||||||
|
* @returns true if it fits
|
||||||
|
*/
|
||||||
|
protected itemFitsInto1By2Slot(item: ITemplateItem): boolean;
|
||||||
|
/**
|
||||||
|
* Create an array of loot items a PMC can have in their backpack
|
||||||
|
* @returns string array of tpls
|
||||||
|
*/
|
||||||
|
generatePMCBackpackLootPool(botRole: string): Record<string, number>;
|
||||||
}
|
}
|
||||||
|
59
types/generators/PlayerScavGenerator.d.ts
vendored
59
types/generators/PlayerScavGenerator.d.ts
vendored
@ -1,38 +1,53 @@
|
|||||||
import { BotHelper } from "../helpers/BotHelper";
|
import { BotGenerator } from "@spt/generators/BotGenerator";
|
||||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||||
import { Skills, Stats } from "../models/eft/common/tables/IBotBase";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { IBotType } from "../models/eft/common/tables/IBotType";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { IPlayerScavConfig, KarmaLevel } from "../models/spt/config/IPlayerScavConfig";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IBotBase, ISkills, IStats } from "@spt/models/eft/common/tables/IBotBase";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IBotType } from "@spt/models/eft/common/tables/IBotType";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IKarmaLevel, IPlayerScavConfig } from "@spt/models/spt/config/IPlayerScavConfig";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { BotLootCacheService } from "../services/BotLootCacheService";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { FenceService } from "../services/FenceService";
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { BotLootCacheService } from "@spt/services/BotLootCacheService";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
import { BotGenerator } from "./BotGenerator";
|
import { FenceService } from "@spt/services/FenceService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
export declare class PlayerScavGenerator {
|
export declare class PlayerScavGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected databaseServer: DatabaseServer;
|
protected randomUtil: RandomUtil;
|
||||||
|
protected databaseService: DatabaseService;
|
||||||
|
protected hashUtil: HashUtil;
|
||||||
|
protected itemHelper: ItemHelper;
|
||||||
|
protected botGeneratorHelper: BotGeneratorHelper;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected profileHelper: ProfileHelper;
|
protected profileHelper: ProfileHelper;
|
||||||
protected botHelper: BotHelper;
|
protected botHelper: BotHelper;
|
||||||
protected jsonUtil: JsonUtil;
|
|
||||||
protected fenceService: FenceService;
|
protected fenceService: FenceService;
|
||||||
protected botLootCacheService: BotLootCacheService;
|
protected botLootCacheService: BotLootCacheService;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected botGenerator: BotGenerator;
|
protected botGenerator: BotGenerator;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected cloner: ICloner;
|
||||||
protected playerScavConfig: IPlayerScavConfig;
|
protected playerScavConfig: IPlayerScavConfig;
|
||||||
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer);
|
constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer, cloner: ICloner);
|
||||||
/**
|
/**
|
||||||
* Update a player profile to include a new player scav profile
|
* Update a player profile to include a new player scav profile
|
||||||
* @param sessionID session id to specify what profile is updated
|
* @param sessionID session id to specify what profile is updated
|
||||||
* @returns profile object
|
* @returns profile object
|
||||||
*/
|
*/
|
||||||
generate(sessionID: string): IPmcData;
|
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
|
* Get the scav karama level for a profile
|
||||||
* Is also the fence trader rep level
|
* Is also the fence trader rep level
|
||||||
@ -52,10 +67,10 @@ export declare class PlayerScavGenerator {
|
|||||||
* @param karmaSettings Values to modify the bot template with
|
* @param karmaSettings Values to modify the bot template with
|
||||||
* @param baseBotNode bot template to modify according to karama level settings
|
* @param baseBotNode bot template to modify according to karama level settings
|
||||||
*/
|
*/
|
||||||
protected adjustBotTemplateWithKarmaSpecificSettings(karmaSettings: KarmaLevel, baseBotNode: IBotType): void;
|
protected adjustBotTemplateWithKarmaSpecificSettings(karmaSettings: IKarmaLevel, baseBotNode: IBotType): void;
|
||||||
protected getScavSkills(scavProfile: IPmcData): Skills;
|
protected getScavSkills(scavProfile: IPmcData): ISkills;
|
||||||
protected getDefaultScavSkills(): Skills;
|
protected getDefaultScavSkills(): ISkills;
|
||||||
protected getScavStats(scavProfile: IPmcData): Stats;
|
protected getScavStats(scavProfile: IPmcData): IStats;
|
||||||
protected getScavLevel(scavProfile: IPmcData): number;
|
protected getScavLevel(scavProfile: IPmcData): number;
|
||||||
protected getScavExperience(scavProfile: IPmcData): number;
|
protected getScavExperience(scavProfile: IPmcData): number;
|
||||||
/**
|
/**
|
||||||
|
54
types/generators/RagfairAssortGenerator.d.ts
vendored
54
types/generators/RagfairAssortGenerator.d.ts
vendored
@ -1,50 +1,50 @@
|
|||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { Preset } from "../models/eft/common/IGlobals";
|
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { IPreset } from "@spt/models/eft/common/IGlobals";
|
||||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
import { IItem } from "@spt/models/eft/common/tables/IItem";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { SeasonalEventService } from "@spt/services/SeasonalEventService";
|
||||||
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
export declare class RagfairAssortGenerator {
|
export declare class RagfairAssortGenerator {
|
||||||
protected jsonUtil: JsonUtil;
|
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
|
protected presetHelper: PresetHelper;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
|
protected seasonalEventService: SeasonalEventService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected generatedAssortItems: Item[];
|
protected generatedAssortItems: IItem[][];
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer);
|
protected ragfairItemInvalidBaseTypes: string[];
|
||||||
|
constructor(hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Get an array of unique items that can be sold on the flea
|
* Get an array of arrays that can be sold on the flea
|
||||||
* @returns array of unique items
|
* Each sub array contains item + children (if any)
|
||||||
|
* @returns array of arrays
|
||||||
*/
|
*/
|
||||||
getAssortItems(): Item[];
|
getAssortItems(): IItem[][];
|
||||||
/**
|
/**
|
||||||
* Check internal generatedAssortItems array has objects
|
* Check internal generatedAssortItems array has objects
|
||||||
* @returns true if array has objects
|
* @returns true if array has objects
|
||||||
*/
|
*/
|
||||||
protected assortsAreGenerated(): boolean;
|
protected assortsAreGenerated(): boolean;
|
||||||
/**
|
/**
|
||||||
* Generate an array of items the flea can sell
|
* Generate an array of arrays (item + children) the flea can sell
|
||||||
* @returns array of unique items
|
* @returns array of arrays (item + children)
|
||||||
*/
|
*/
|
||||||
protected generateRagfairAssortItems(): Item[];
|
protected generateRagfairAssortItems(): IItem[][];
|
||||||
/**
|
/**
|
||||||
* Get presets from globals.json
|
* Get presets from globals to add to flea
|
||||||
* @returns Preset object array
|
* ragfairConfig.dynamic.showDefaultPresetsOnly decides if its all presets or just defaults
|
||||||
|
* @returns IPreset array
|
||||||
*/
|
*/
|
||||||
protected getPresets(): Preset[];
|
protected getPresetsToAdd(): IPreset[];
|
||||||
/**
|
|
||||||
* Get default presets from globals.json
|
|
||||||
* @returns Preset object array
|
|
||||||
*/
|
|
||||||
protected getDefaultPresets(): Preset[];
|
|
||||||
/**
|
/**
|
||||||
* Create a base assort item and return it with populated values + 999999 stack count + unlimited count = true
|
* Create a base assort item and return it with populated values + 999999 stack count + unlimited count = true
|
||||||
* @param tplId tplid to add to item
|
* @param tplId tplid to add to item
|
||||||
* @param id id to add to item
|
* @param id id to add to item
|
||||||
* @returns hydrated Item object
|
* @returns Hydrated Item object
|
||||||
*/
|
*/
|
||||||
protected createRagfairAssortItem(tplId: string, id?: string): Item;
|
protected createRagfairAssortRootItem(tplId: string, id?: string): IItem;
|
||||||
}
|
}
|
||||||
|
202
types/generators/RagfairOfferGenerator.d.ts
vendored
202
types/generators/RagfairOfferGenerator.d.ts
vendored
@ -1,36 +1,40 @@
|
|||||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
|
||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||||
import { PaymentHelper } from "../helpers/PaymentHelper";
|
import { HandbookHelper } from "@spt/helpers/HandbookHelper";
|
||||||
import { PresetHelper } from "../helpers/PresetHelper";
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
|
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { IBarterScheme } from "../models/eft/common/tables/ITrader";
|
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
|
||||||
import { IRagfairOffer, OfferRequirement } from "../models/eft/ragfair/IRagfairOffer";
|
import { IItem } from "@spt/models/eft/common/tables/IItem";
|
||||||
import { Dynamic, IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { IOfferRequirement, IRagfairOffer, IRagfairOfferUser } from "@spt/models/eft/ragfair/IRagfairOffer";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { IArmorPlateBlacklistSettings, IBarterDetails, IDynamic, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||||
import { FenceService } from "../services/FenceService";
|
import { ITplWithFleaPrice } from "@spt/models/spt/ragfair/ITplWithFleaPrice";
|
||||||
import { LocalisationService } from "../services/LocalisationService";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
import { RagfairCategoriesService } from "../services/RagfairCategoriesService";
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
import { RagfairPriceService } from "../services/RagfairPriceService";
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { FenceService } from "@spt/services/FenceService";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { RagfairOfferService } from "@spt/services/RagfairOfferService";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { RagfairPriceService } from "@spt/services/RagfairPriceService";
|
||||||
import { RagfairAssortGenerator } from "./RagfairAssortGenerator";
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
export declare class RagfairOfferGenerator {
|
export declare class RagfairOfferGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected jsonUtil: JsonUtil;
|
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseService: DatabaseService;
|
||||||
protected ragfairServerHelper: RagfairServerHelper;
|
protected ragfairServerHelper: RagfairServerHelper;
|
||||||
|
protected profileHelper: ProfileHelper;
|
||||||
protected handbookHelper: HandbookHelper;
|
protected handbookHelper: HandbookHelper;
|
||||||
|
protected botHelper: BotHelper;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected presetHelper: PresetHelper;
|
protected presetHelper: PresetHelper;
|
||||||
protected ragfairAssortGenerator: RagfairAssortGenerator;
|
protected ragfairAssortGenerator: RagfairAssortGenerator;
|
||||||
@ -38,23 +42,54 @@ export declare class RagfairOfferGenerator {
|
|||||||
protected ragfairPriceService: RagfairPriceService;
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
protected localisationService: LocalisationService;
|
protected localisationService: LocalisationService;
|
||||||
protected paymentHelper: PaymentHelper;
|
protected paymentHelper: PaymentHelper;
|
||||||
protected ragfairCategoriesService: RagfairCategoriesService;
|
|
||||||
protected fenceService: FenceService;
|
protected fenceService: FenceService;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected cloner: ICloner;
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
|
protected botConfig: IBotConfig;
|
||||||
protected allowedFleaPriceItemsForBarter: {
|
protected allowedFleaPriceItemsForBarter: {
|
||||||
tpl: string;
|
tpl: string;
|
||||||
price: number;
|
price: number;
|
||||||
}[];
|
}[];
|
||||||
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer);
|
/** Internal counter to ensure each offer created has a unique value for its intId property */
|
||||||
createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
|
protected offerCounter: number;
|
||||||
|
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseService: DatabaseService, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner);
|
||||||
|
/**
|
||||||
|
* Create a flea offer and store it in the Ragfair server offers array
|
||||||
|
* @param userID Owner of the offer
|
||||||
|
* @param time Time offer is listed at
|
||||||
|
* @param items Items in the offer
|
||||||
|
* @param barterScheme Cost of item (currency or barter)
|
||||||
|
* @param loyalLevel Loyalty level needed to buy item
|
||||||
|
* @param sellInOnePiece Flags sellInOnePiece to be true
|
||||||
|
* @returns Created flea offer
|
||||||
|
*/
|
||||||
|
createAndAddFleaOffer(userID: string, time: number, items: IItem[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
|
||||||
|
/**
|
||||||
|
* Create an offer object ready to send to ragfairOfferService.addOffer()
|
||||||
|
* @param userID Owner of the offer
|
||||||
|
* @param time Time offer is listed at
|
||||||
|
* @param items Items in the offer
|
||||||
|
* @param barterScheme Cost of item (currency or barter)
|
||||||
|
* @param loyalLevel Loyalty level needed to buy item
|
||||||
|
* @param isPackOffer Is offer being created flaged as a pack
|
||||||
|
* @returns IRagfairOffer
|
||||||
|
*/
|
||||||
|
protected createOffer(userID: string, time: number, items: IItem[], barterScheme: IBarterScheme[], loyalLevel: number, isPackOffer?: boolean): IRagfairOffer;
|
||||||
|
/**
|
||||||
|
* Create the user object stored inside each flea offer object
|
||||||
|
* @param userID user creating the offer
|
||||||
|
* @param isTrader Is the user creating the offer a trader
|
||||||
|
* @returns IRagfairOfferUser
|
||||||
|
*/
|
||||||
|
createUserDataForFleaOffer(userID: string, isTrader: boolean): IRagfairOfferUser;
|
||||||
/**
|
/**
|
||||||
* Calculate the offer price that's listed on the flea listing
|
* Calculate the offer price that's listed on the flea listing
|
||||||
* @param offerRequirements barter requirements for offer
|
* @param offerRequirements barter requirements for offer
|
||||||
* @returns rouble cost of offer
|
* @returns rouble cost of offer
|
||||||
*/
|
*/
|
||||||
protected calculateOfferListingPrice(offerRequirements: OfferRequirement[]): number;
|
protected convertOfferRequirementsIntoRoubles(offerRequirements: IOfferRequirement[]): number;
|
||||||
/**
|
/**
|
||||||
* Get avatar url from trader table in db
|
* Get avatar url from trader table in db
|
||||||
* @param isTrader Is user we're getting avatar for a trader
|
* @param isTrader Is user we're getting avatar for a trader
|
||||||
@ -69,8 +104,18 @@ export declare class RagfairOfferGenerator {
|
|||||||
* @returns count of roubles
|
* @returns count of roubles
|
||||||
*/
|
*/
|
||||||
protected calculateRoublePrice(currencyCount: number, currencyType: string): number;
|
protected calculateRoublePrice(currencyCount: number, currencyType: string): number;
|
||||||
protected getTraderId(userID: string): string;
|
/**
|
||||||
protected getRating(userID: string): number;
|
* Check userId, if its a player, return their pmc _id, otherwise return userId parameter
|
||||||
|
* @param userId Users Id to check
|
||||||
|
* @returns Users Id
|
||||||
|
*/
|
||||||
|
protected getTraderId(userId: string): string;
|
||||||
|
/**
|
||||||
|
* Get a flea trading rating for the passed in user
|
||||||
|
* @param userId User to get flea rating of
|
||||||
|
* @returns Flea rating value
|
||||||
|
*/
|
||||||
|
protected getRating(userId: string): number;
|
||||||
/**
|
/**
|
||||||
* Is the offers user rating growing
|
* Is the offers user rating growing
|
||||||
* @param userID user to check rating of
|
* @param userID user to check rating of
|
||||||
@ -88,60 +133,95 @@ export declare class RagfairOfferGenerator {
|
|||||||
* Create multiple offers for items by using a unique list of items we've generated previously
|
* Create multiple offers for items by using a unique list of items we've generated previously
|
||||||
* @param expiredOffers optional, expired offers to regenerate
|
* @param expiredOffers optional, expired offers to regenerate
|
||||||
*/
|
*/
|
||||||
generateDynamicOffers(expiredOffers?: Item[]): Promise<void>;
|
generateDynamicOffers(expiredOffers?: IItem[][]): Promise<void>;
|
||||||
protected createOffersForItems(assortItemIndex: string, assortItemsToProcess: Item[], expiredOffers: Item[], config: Dynamic): Promise<void>;
|
/**
|
||||||
|
* @param assortItemWithChildren Item with its children to process into offers
|
||||||
|
* @param isExpiredOffer is an expired offer
|
||||||
|
* @param config Ragfair dynamic config
|
||||||
|
*/
|
||||||
|
protected createOffersFromAssort(assortItemWithChildren: IItem[], isExpiredOffer: boolean, config: IDynamic): 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: IItem[], plateSettings: IArmorPlateBlacklistSettings): boolean;
|
||||||
/**
|
/**
|
||||||
* Create one flea offer for a specific item
|
* Create one flea offer for a specific item
|
||||||
* @param items Item to create offer for
|
* @param sellerId Id of seller
|
||||||
|
* @param itemWithChildren Item to create offer for
|
||||||
* @param isPreset Is item a weapon preset
|
* @param isPreset Is item a weapon preset
|
||||||
* @param itemDetails raw db item details
|
* @param itemToSellDetails Raw db item details
|
||||||
* @returns
|
* @returns Item array
|
||||||
*/
|
*/
|
||||||
protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise<Item[]>;
|
protected createSingleOfferForItem(sellerId: string, itemWithChildren: IItem[], isPreset: boolean, itemToSellDetails: ITemplateItem): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Generate trader offers on flea using the traders assort data
|
* Generate trader offers on flea using the traders assort data
|
||||||
* @param traderID Trader to generate offers for
|
* @param traderID Trader to generate offers for
|
||||||
*/
|
*/
|
||||||
generateFleaOffersForTrader(traderID: string): void;
|
generateFleaOffersForTrader(traderID: string): void;
|
||||||
protected getItemCondition(userID: string, items: Item[], itemDetails: ITemplateItem): Item[];
|
/**
|
||||||
|
* Get array of an item with its mods + condition properties (e.g durability)
|
||||||
|
* Apply randomisation adjustments to condition if item base is found in ragfair.json/dynamic/condition
|
||||||
|
* @param userID id of owner of item
|
||||||
|
* @param itemWithMods Item and mods, get condition of first item (only first array item is modified)
|
||||||
|
* @param itemDetails db details of first item
|
||||||
|
*/
|
||||||
|
protected randomiseOfferItemUpdProperties(userID: string, itemWithMods: IItem[], 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
|
||||||
|
* @returns condition id
|
||||||
|
*/
|
||||||
|
protected getDynamicConditionIdForTpl(tpl: string): string | undefined;
|
||||||
|
/**
|
||||||
|
* Alter an items condition based on its item base type
|
||||||
|
* @param conditionSettingsId also the parentId of item being altered
|
||||||
|
* @param itemWithMods Item to adjust condition details of
|
||||||
|
* @param itemDetails db item details of first item in array
|
||||||
|
*/
|
||||||
|
protected randomiseItemCondition(conditionSettingsId: string, itemWithMods: IItem[], itemDetails: ITemplateItem): void;
|
||||||
|
/**
|
||||||
|
* Adjust an items durability/maxDurability value
|
||||||
|
* @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 randomiseWeaponDurability(item: IItem, 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: IItem[], currentMultiplier: number, maxMultiplier: number): void;
|
||||||
/**
|
/**
|
||||||
* Add missing conditions to an item if needed
|
* Add missing conditions to an item if needed
|
||||||
* Durabiltiy for repairable items
|
* Durabiltiy for repairable items
|
||||||
* HpResource for medical items
|
* HpResource for medical items
|
||||||
* @param item item to add conditions to
|
* @param item item to add conditions to
|
||||||
* @returns Item with conditions added
|
|
||||||
*/
|
*/
|
||||||
protected addMissingCondition(item: Item): Item;
|
protected addMissingConditions(item: IItem): void;
|
||||||
/**
|
/**
|
||||||
* Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based
|
* Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based
|
||||||
* @param offerItems Items for sale in offer
|
* @param offerItems Items for sale in offer
|
||||||
* @returns barter scheme
|
* @param barterConfig Barter config from ragfairConfig.dynamic.barter
|
||||||
|
* @returns Barter scheme
|
||||||
*/
|
*/
|
||||||
protected createBarterRequirement(offerItems: Item[]): IBarterScheme[];
|
protected createBarterBarterScheme(offerItems: IItem[], barterConfig: IBarterDetails): IBarterScheme[];
|
||||||
/**
|
/**
|
||||||
* Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter`
|
* Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter`
|
||||||
* @returns array with tpl/price values
|
* @returns array with tpl/price values
|
||||||
*/
|
*/
|
||||||
protected getFleaPricesAsArray(): {
|
protected getFleaPricesAsArray(): ITplWithFleaPrice[];
|
||||||
tpl: string;
|
|
||||||
price: number;
|
|
||||||
}[];
|
|
||||||
/**
|
/**
|
||||||
* Create a random currency-based barter scheme for an array of items
|
* Create a random currency-based barter scheme for an array of items
|
||||||
* @param offerItems Items on offer
|
* @param offerWithChildren Items on offer
|
||||||
|
* @param isPackOffer Is the barter scheme being created for a pack offer
|
||||||
|
* @param multipler What to multiply the resulting price by
|
||||||
* @returns Barter scheme for offer
|
* @returns Barter scheme for offer
|
||||||
*/
|
*/
|
||||||
protected createCurrencyRequirement(offerItems: Item[]): IBarterScheme[];
|
protected createCurrencyBarterScheme(offerWithChildren: IItem[], isPackOffer: boolean, multipler?: number): IBarterScheme[];
|
||||||
/**
|
|
||||||
* Create a flea offer and store it in the Ragfair server offers array
|
|
||||||
* @param userID owner of the offer
|
|
||||||
* @param time time offer is put up
|
|
||||||
* @param items items in the offer
|
|
||||||
* @param barterScheme cost of item (currency or barter)
|
|
||||||
* @param loyalLevel Loyalty level needed to buy item
|
|
||||||
* @param price price of offer
|
|
||||||
* @param sellInOnePiece
|
|
||||||
* @returns Ragfair offer
|
|
||||||
*/
|
|
||||||
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
|
|
||||||
}
|
}
|
||||||
|
139
types/generators/RepeatableQuestGenerator.d.ts
vendored
Normal file
139
types/generators/RepeatableQuestGenerator.d.ts
vendored
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
import { RepeatableQuestRewardGenerator } from "@spt/generators/RepeatableQuestRewardGenerator";
|
||||||
|
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||||
|
import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper";
|
||||||
|
import { IExit } from "@spt/models/eft/common/ILocationBase";
|
||||||
|
import { ITraderInfo } from "@spt/models/eft/common/tables/IBotBase";
|
||||||
|
import { IQuestCondition, IQuestConditionCounterCondition } from "@spt/models/eft/common/tables/IQuest";
|
||||||
|
import { IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests";
|
||||||
|
import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig";
|
||||||
|
import { IQuestTypePool } from "@spt/models/spt/repeatable/IQuestTypePool";
|
||||||
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
|
import { MathUtil } from "@spt/utils/MathUtil";
|
||||||
|
import { ObjectId } from "@spt/utils/ObjectId";
|
||||||
|
import { ProbabilityObjectArray, RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||||
|
export declare class RepeatableQuestGenerator {
|
||||||
|
protected logger: ILogger;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
|
protected mathUtil: MathUtil;
|
||||||
|
protected databaseService: DatabaseService;
|
||||||
|
protected itemHelper: ItemHelper;
|
||||||
|
protected localisationService: LocalisationService;
|
||||||
|
protected objectId: ObjectId;
|
||||||
|
protected repeatableQuestHelper: RepeatableQuestHelper;
|
||||||
|
protected repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator;
|
||||||
|
protected configServer: ConfigServer;
|
||||||
|
protected cloner: ICloner;
|
||||||
|
protected questConfig: IQuestConfig;
|
||||||
|
protected maxRandomNumberAttempts: number;
|
||||||
|
constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner);
|
||||||
|
/**
|
||||||
|
* 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, ITraderInfo>, 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): IExit[];
|
||||||
|
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: IExit): 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;
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user