Compare commits

...

23 Commits
1.2.1 ... main

Author SHA1 Message Date
4f4606c65b Added in custom configurations for "boss" PMCs spawning and reduced it from the default as I found they were spawning too often. 2023-02-17 14:15:53 -05:00
596292c332 Valens Progression v1.3.2 Compatible with AKI 3.5.*
* Hotfix for PMCs not generating with proper equipment.
2023-02-17 14:06:16 -05:00
93fd538d06 Added Equipment Weighting to PMCs 2023-02-16 13:55:40 -05:00
d78e51911e Update types for AKI 3.5.1 2023-02-16 13:22:45 -05:00
b8fb281ec2 Package change for 1.3.0 and compatibility for SPT-AKI 3.5.0 2023-02-13 13:59:29 -05:00
8f556bf48f Final changes for 1.3.0; Compatibility for SPT-AKI v3.5.0 2023-02-13 13:58:41 -05:00
1f0daaa06a Initial updates for 3.5.0 compatibility
* Completion of conversion to 3.5.0 server backend, and initial LL1 framework for PMCs in pmc.ts
* Completion of LL1 requirements for PMCs in pmc.ts
* Removed scav file for now by commenting out in mod.ts and scav.ts
* TODO: Completion of LL2 and LL3 requirements for PMCs in pmc.ts; Enable scav.ts and rework scav.ts to be compatible?
2023-02-13 03:27:30 -05:00
14add1d9b5 Types update for 3.5.0 2023-02-12 23:21:22 -05:00
8c4fae1d12 More work 2023-01-16 20:26:44 -05:00
08606cd070 3.5.0 type updates 2023-01-15 00:21:11 -05:00
654f7a0803 Package update 2023-01-08 01:55:55 -05:00
2dcdc3d1b9 RC1 of 3.5.0 compatibility? 2023-01-08 01:54:44 -05:00
61cc3c144a no message 2023-01-08 01:28:04 -05:00
3d6935baab Doing more dumb stuff, haha oops. 2023-01-08 01:27:37 -05:00
d08c4c8c42 Added back pmc and scav ts configs - oops 2023-01-08 01:25:31 -05:00
95507c79f0 Revert "Remove configs."
This reverts commit 3be44986e8e6b4c05557538c4ca62c5c3fc69230.
2023-01-08 01:25:05 -05:00
3be44986e8 Remove configs. 2023-01-08 01:23:25 -05:00
0abdb7e21a Remove all custom configs and logging. 2023-01-08 01:22:36 -05:00
f58ed247d4 Changed PMC config to import from IBotConfig. 2023-01-08 01:15:38 -05:00
fae14998cc Update types to 3.5.0 and some additions of server side changes on scavs/assault bots. 2023-01-08 01:07:39 -05:00
7a5877034a Upate types for 3.4.0 2022-12-25 18:45:30 -05:00
37ef6a4439 ​Compatibility update for SPT-Aki v3.2.3 2022-09-11 21:55:55 -04:00
3113e0615b Hotfix for scavs spawning with high tier ammo at pLvl 25 instead of 33. 2022-09-10 11:24:04 -04:00
298 changed files with 6683 additions and 2136 deletions

View File

@ -1,3 +0,0 @@
{
"DebugMode": false
}

View File

@ -1,96 +0,0 @@
{
"pmcProgression": true,
"customWhitelist1":
{
"levelRange":
{
"min": 1,
"max": 15
},
"equipment":
{
"FirstPrimaryWeapon": []
},
"cartridge":
{
"Caliber762x54R": []
}
},
"customWhitelist2":
{
"levelRange":
{
"min": 16,
"max": 24
},
"equipment":
{
"FirstPrimaryWeapon": []
},
"cartridge":
{
"Caliber762x54R": []
}
},
"customWhitelist3":
{
"levelRange":
{
"min": 25,
"max": 33
},
"equipment":
{
"FirstPrimaryWeapon": []
},
"cartridge":
{
"Caliber762x54R": []
}
},
"customWhitelist4":
{
"levelRange":
{
"min": 34,
"max": 45
},
"equipment":
{
"FirstPrimaryWeapon": []
},
"cartridge":
{
"Caliber762x54R": []
}
},
"customWhitelist5":
{
"levelRange":
{
"min": 46,
"max": 70
},
"equipment":
{
"FirstPrimaryWeapon": []
},
"cartridge":
{
"Caliber762x54R": []
}
}
}

View File

@ -1,102 +0,0 @@
{
"scavProgression": true,
"customWhitelist1":
{
"weaponModLimits": {
"scopeLimit": 1,
"lightLaserLimit": 1
},
"randomisedWeaponModSlots": [],
"blacklist": [],
"whitelist": [{
"levelRange":
{
"min": 1,
"max": 25
},
"equipment":
{
"FirstPrimaryWeapon": []
},
"cartridge":
{
"Caliber762x54R": []
}}]
},
"customWhitelist2": {
"levelRange":
{
"min": 16,
"max": 30
},
"equipment":
{
"FirstPrimaryWeapon": []
},
"cartridge":
{
"Caliber762x54R": []
}
},
"customWhitelist3":
{
"levelRange":
{
"min": 31,
"max": 40
},
"equipment":
{
"FirstPrimaryWeapon": []
},
"cartridge":
{
"Caliber762x54R": []
}
},
"customWhitelist4":
{
"levelRange":
{
"min": 41,
"max": 50
},
"equipment":
{
"FirstPrimaryWeapon": []
},
"cartridge":
{
"Caliber762x54R": []
}
},
"customWhitelist5":
{
"levelRange":
{
"min": 51,
"max": 70
},
"equipment":
{
"FirstPrimaryWeapon": []
},
"cartridge":
{
"Caliber762x54R": []
}
}
}

View File

@ -1,23 +0,0 @@
export interface PmcConfig
{
pmcProgression: boolean
customWhitelist1: EquipmentFilterDetails
customWhitelist2: EquipmentFilterDetails
customWhitelist3: EquipmentFilterDetails
customWhitelist4: EquipmentFilterDetails
customWhitelist5: EquipmentFilterDetails
}
export interface EquipmentFilterDetails
{
levelRange: MinMax;
equipment: Record<string, string[]>;
cartridge: Record<string, string[]>;
}
export interface MinMax
{
max: number;
min: number;
}

View File

@ -1,37 +0,0 @@
export interface ScavConfig
{
scavProgression: boolean
customWhitelist1: EquipmentFilters
customWhitelist2: EquipmentFilterDetails
customWhitelist3: EquipmentFilterDetails
customWhitelist4: EquipmentFilterDetails
customWhitelist5: EquipmentFilterDetails
}
export interface EquipmentFilters
{
weaponModLimits: ModLimits;
randomisedWeaponModSlots?: string[];
blacklist: EquipmentFilterDetails[];
whitelist: EquipmentFilterDetails[];
}
export interface ModLimits {
/** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */
scopeLimit?: number;
/** How many lasers or lights are allowed on a weapon - hard coded to work with TACTICAL_COMBO, and FLASHLIGHT */
lightLaserLimit?: number;
}
export interface EquipmentFilterDetails
{
levelRange: MinMax;
equipment: Record<string, string[]>;
cartridge: Record<string, string[]>;
}
export interface MinMax
{
max: number;
min: number;
}

View File

@ -1,10 +1,10 @@
{ {
"name": "Valens-Progression", "name": "Valens-Progression",
"version": "1.2.0", "version": "1.3.3",
"main": "src/mod.js", "main": "src/mod.js",
"license": "CC BY-NC-ND 4.0", "license": "CC BY-NC-ND 4.0",
"author": "Valens", "author": "Valens",
"akiVersion": "3.2.*", "akiVersion": ">=3.5.*",
"scripts": { "scripts": {
"setup:environment": "npm i", "setup:environment": "npm i",
"build:unzipped": "copyfiles -e \"./node_modules/**/*.*\" -e \"./dist/**/*.*\" -e \"./package-lock.json\" -e \"./tsconfig.json\" -e \"./README.txt\" -e \"./mod.code-workspace\" \"./**/*.*\" ./dist", "build:unzipped": "copyfiles -e \"./node_modules/**/*.*\" -e \"./dist/**/*.*\" -e \"./package-lock.json\" -e \"./tsconfig.json\" -e \"./README.txt\" -e \"./mod.code-workspace\" \"./**/*.*\" ./dist",

View File

@ -1,21 +0,0 @@
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { Config } from "../config/config";
export class Logger
{
private modConfig: Config = require("../config/config.json");
private logger: ILogger;
constructor (logger: ILogger)
{
this.logger = logger;
}
public info(text: string, forced = false): void
{
if (this.modConfig.DebugMode || forced)
{
this.logger.info(text);
}
}
}

View File

@ -1,173 +1,38 @@
import { DependencyContainer } from "tsyringe";
import { IPostDBLoadMod } from "@spt-aki/models/external/IPostDBLoadMod";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
import { IPostDBLoadMod } from "@spt-aki/models/external/IPostDBLoadMod";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { PlayerService } from "@spt-aki/services/PlayerService"; import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { ProfileController } from "@spt-aki/controllers/ProfileController"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DependencyContainer } from "tsyringe";
import { ApplicationContext } from "@spt-aki/context/ApplicationContext"; //import { Scavs } from "./scavs";
import { ContextVariableType } from "../types/context/ContextVariableType"; import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
import {StaticRouterModService} from "@spt-aki/services/mod/staticRouter/StaticRouterModService";
import { Logger } from "./logger";
// import { IPreAkiLoadMod } from "@spt-aki/models/external/IPreAkiLoadMod";
import { Scavs } from "./scavs";
import { PMCs } from "./pmc"; import { PMCs } from "./pmc";
import { BotGenerator } from "@spt-aki/generators/BotGenerator";
import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase";
class ValensProgression implements IPostDBLoadMod class ValensProgression implements IPostDBLoadMod
{ {
private logger: ILogger;
private configServer: ConfigServer; private configServer: ConfigServer;
private locationConfig: ILocationConfig
private botConfig: IBotConfig; private botConfig: IBotConfig;
private databaseServer: DatabaseServer; private databaseServer: DatabaseServer;
private playerService: PlayerService; // private scavs: Scavs;
private profileController: ProfileController
private applicationContext: ApplicationContext
private contextVariableType: ContextVariableType;
private staticRouterModService: StaticRouterModService;
private static container: DependencyContainer;
private scavs: Scavs;
private pmcs: PMCs; private pmcs: PMCs;
public postDBLoad(container: DependencyContainer): void public postDBLoad(container: DependencyContainer): void
{ {
// get database from server // get database from server
const logger = container.resolve<ILogger>("WinstonLogger");
const vLogger = new Logger(logger);
this.configServer = container.resolve<ConfigServer>("ConfigServer"); this.configServer = container.resolve<ConfigServer>("ConfigServer");
this.locationConfig = this.configServer.getConfig<ILocationConfig>(ConfigTypes.LOCATION);
this.botConfig = this.configServer.getConfig<IBotConfig>(ConfigTypes.BOT); this.botConfig = this.configServer.getConfig<IBotConfig>(ConfigTypes.BOT);
this.databaseServer = container.resolve<DatabaseServer>("DatabaseServer"); this.databaseServer = container.resolve<DatabaseServer>("DatabaseServer");
this.applicationContext = container.resolve<ApplicationContext>("ApplicationContext");
this.profileController = container.resolve<ProfileController>("ProfileController");
this.playerService = container.resolve<PlayerService>("PlayerService");
this.staticRouterModService = container.resolve<StaticRouterModService>("StaticRouterModService");
this.scavs = new Scavs(vLogger, this.botConfig, this.databaseServer); // this.scavs = new Scavs(this.botConfig, this.databaseServer);
this.scavs.updateScavs(); // this.scavs.updateScavs();
this.pmcs = new PMCs(vLogger, this.botConfig, this.databaseServer); this.pmcs = new PMCs(this.locationConfig, this.botConfig, this.databaseServer);
this.pmcs.updatePmcs(); this.pmcs.updatePmcs();
} }
/*public preAkiLoad(container: DependencyContainer): void
{
// We will save a reference to the dependency container to resolve dependencies
// that we may need down the line
ValensProgression.container = container;
// Wait until WatermarkLocale gets resolved by the server and run code afterwards to replace
// the getDescription() function with the one below called 'replacementFunction()
container.afterResolution("BotGenerator", (_t, result: BotGenerator) =>
{
// We want to replace the original method logic with something different
result.generateDogtag = (bot: IBotBase) =>
{
// We are calling a replacement function, technically you could also do:
// result.login = this.replacementFunction;
return this.generateDogtags(bot);
}
// The modifier Always makes sure this replacement method is ALWAYS replaced
}, {frequency: "Always"});
}
public generateDogtags(bot: IBotBase)
{
const profile = this.profileController.getCompleteProfile(sessionId);
const playerLevel = this.playerService.calculateLevel(profile[0]); // find(x=>x._id === sessionId)
const usecLvl = this.databaseServer.getTables().bots["usec"].experience.level;
const bearLvl = this.databaseServer.getTables().bots["bear"].experience.level;
if (playerLevel >= 1 && playerLevel <= 15)
{
this.generateDogtagLL1(usecLvl, bearLvl);
}
if (playerLevel >= 16 && playerLevel <= 25)
{
this.generateDogtagLL2(usecLvl, bearLvl);
}
if (playerLevel >= 26 && playerLevel <= 36)
{
this.generateDogtagLL3(usecLvl, bearLvl);
}
if (playerLevel >= 37)
{
this.generateDogtagLL4(usecLvl, bearLvl);
}
const upd: Upd = {
SpawnedInSession: true,
Dogtag: {
AccountId: bot.aid,
ProfileId: bot._id,
Nickname: bot.Info.Nickname,
Side: bot.Info.Side,
Level: bot.Info.Level,
Time: (new Date().toISOString()),
Status: "Killed by ",
KillerAccountId: "Unknown",
KillerProfileId: "Unknown",
KillerName: "Unknown",
WeaponName: "Unknown"
}
}
const inventoryItem: Item = {
_id: this.hashUtil.generate(),
_tpl: ((bot.Info.Side === "Usec") ? BaseClasses.DOG_TAG_USEC : BaseClasses.DOG_TAG_BEAR),
parentId: bot.Inventory.equipment,
slotId: "Dogtag",
location: undefined,
upd: upd
}
bot.Inventory.items.push(inventoryItem);
return bot;
}
private generateDogtagLL1(usecLvl: {max: number; min: number;}, bearLvl: {max: number; min: number;}): void
{
usecLvl.max = 15;
usecLvl.min = 1;
bearLvl.max = 15;
bearLvl.min = 1;
}
private generateDogtagLL2(usecLvl: {max: number; min: number;}, bearLvl: {max: number; min: number;}): void
{
usecLvl.max = 25;
usecLvl.min = 16;
bearLvl.max = 25;
bearLvl.min = 16;
}
private generateDogtagLL3(usecLvl: {max: number; min: number;}, bearLvl: {max: number; min: number;}): void
{
usecLvl.max = 36;
usecLvl.min = 26;
bearLvl.max = 36;
bearLvl.min = 26;
}
private generateDogtagLL4(usecLvl: {max: number; min: number;}, bearLvl: {max: number; min: number;}): void
{
usecLvl.max = 70;
usecLvl.min = 37;
bearLvl.max = 70;
bearLvl.min = 37;
}*/
} }
module.exports = { mod: new ValensProgression() } module.exports = { mod: new ValensProgression() }

1126
src/pmc.ts

File diff suppressed because it is too large Load Diff

View File

@ -1,508 +1,491 @@
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; // import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; // import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables";
import { Logger } from "./logger"; // import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { ScavConfig } from "../config/ts/scav";
import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
export class Scavs // export class Scavs
{ // {
private modConfig: ScavConfig = require("../config/scav.json"); // private botConfig: IBotConfig;
private logger: Logger; // private databaseServer: IDatabaseTables;
private botConfig: IBotConfig;
private databaseServer: IDatabaseTables;
constructor (logger: Logger, botConfig: IBotConfig, databaseServer: DatabaseServer) // constructor (botConfig: IBotConfig, databaseServer: DatabaseServer)
{ // {
this.logger = logger; // this.botConfig = botConfig;
this.botConfig = botConfig; // this.databaseServer = databaseServer.getTables();
this.databaseServer = databaseServer.getTables(); // }
}
public updateScavs(): void // public updateScavs(): void
{ // {
const mod = this.modConfig; // this.generateScavs();
// }
if (mod.scavProgression) // private generateScavs()
{ // {
this.generateScavs(); // // Scav Progression Start
this.logger.info("Valens Scav Progression Changes Applied");
}
else
{
this.botConfig.equipment.assault = mod.customWhitelist1;
this.botConfig.equipment.assault.whitelist.push(mod.customWhitelist2);
this.botConfig.equipment.assault.whitelist.push(mod.customWhitelist3);
this.botConfig.equipment.assault.whitelist.push(mod.customWhitelist4);
this.botConfig.equipment.assault.whitelist.push(mod.customWhitelist5);
this.logger.info("Custom Scav Progression Changes Applied");
}
}
private generateScavs() // // Scav Gear
{ // const primaryWeaponArrayScav = ["5f2a9575926fd9352339381f", "5aafa857e5b5b00018480968", "56dee2bdd2720bc8328b4567", "54491c4f4bdc2db1078b4568", "576165642459773c7a400233", "5a38e6bac4a2826c6e06d79b", "57f4c844245977379d5c14d1", "57d14d2524597714373db789", "57f3c6bd24597738e730fa2f", "59f9cabd86f7743a10721f46", "5ea03f7400685063ec28bfa8", "60339954d62c9b14ed777c06", "5c07c60e0db834002330051f", "5ac66d9b5acfc4001633997a", "5bf3e03b0db834001d2c4a9c", "5ac4cd105acfc40016339859", "5644bd2b4bdc2d3b4c8b4572", "5bf3e0490db83400196199af", "59d6088586f774275f37482f", "5a0ec13bfcdbcb00165aa685", "59ff346386f77477562ff5e2", "57dc2fa62459775949412633", "5839a40f24597726f856b511", "583990e32459771419544dd2", "5b0bbe4e5acfc40dc528a72d", "59e6687d86f77411d949b251", "59e6152586f77473dc057aa1", "587e02ff24597743df3deaeb", "574d967124597745970e7c94", "5c501a4d2e221602b412b540", "57838ad32459774a17445cd2", "5c46fbd72e2216398b5a8c9c", "5ae08f0a5acfc408fb1398a1", "5bfea6e90db834001b7347f3", "55801eed4bdc2d89578b4588", "5de652c31b7e3716273428be"];
// Scav Progression Start // const holsterArrayScav = ["576a581d2459771e7b1bc4f1", "56d59856d2720bd8418b456a", "56e0598dd2720bb5668b45a6", "5a17f98cfcdbcb0980087290", "579204f224597773d619e051", "5448bd6b4bdc2dfc2f8b4569", "571a12c42459771f627b58a0", "5cadc190ae921500103bb3b6", "5e81c3cbac2bb513793cdc75"];
// const backpackArrayScav = ["59e763f286f7742ee57895da", "56e335e4d2720b6c058b456d", "544a5cde4bdc2d39388b456b", "5f5e45cc5021ce62144be7aa", "56e33634d2720bd8058b456b", "56e33680d2720be2748b4576", "5ab8ee7786f7742d8f33f0b9", "5ab8f04f86f774585f4237d8"];
// const tacticalVestArrayScav = ["5d5d646386f7742797261fd9", "5c0e446786f7742013381639", "5e4abc1f86f774069619fbaa", "572b7adb24597762ae139821", "5fd4c5477a8d854fa0105061", "5fd4c4fa16cac650092f6771", "5648a69d4bdc2ded0b8b457b", "5e4abfed86f77406a2713cf7", "59e7643b86f7742cbf2c109a", "5929a2a086f7744f4b234d43", "5ab8dab586f77441cd04f2a2", "5ca20abf86f77418567a43f2", "5c0e6a1586f77404597b4965"];
// const earpieceArrayScav = ["5c165d832e2216398b5a7e36", "5b432b965acfc47a8774094e", "6033fa48ffd42c541047f728"];
// const headwearArrayScav = ["5ea05cf85ad9772e6624305d", "5df8a58286f77412631087ed", "5c0d2727d174af02a012cf58", "5c08f87c0db8340019124324", "59e7711e86f7746cae05fbe1", "5a7c4850e899ef00150be885", "5aa7cfc0e5b5b00015693143", "5aa7d03ae5b5b00016327db5", "5c06c6a80db834001b735491", "5c066ef40db834001966a595", "5aa2b9ede5b5b000137b758b", "59e7708286f7742cbd762753", "572b7fa124597762b472f9d2", "5bd073c986f7747f627e796c", "59e770f986f7742cbe3164ef", "572b7d8524597762b472f9d1", "5a43943586f77416ad2f06e2", "5a43957686f7742a2c2f11b0", "5aa2b8d7e5b5b00014028f4a", "5aa2ba19e5b5b00014028f4e", "5aa2a7e8e5b5b00016327c16", "5aa2b87de5b5b00016327c25", "5aa2b89be5b5b0001569311f", "5b4329075acfc400153b78ff", "5ab8f20c86f7745cdb629fb2"];
// const armorVestArrayScav = ["5ab8e79e86f7742d8b372e78", "5e9dacf986f774054d6b89f4", "5c0e53c886f7747fa54205c7", "5c0e51be86f774598e797894", "5ab8e4ed86f7742d8e50c7fa", "5c0e5edb86f77461f55ed1f7", "5b44d22286f774172b0c9de8", "5c0e5bab86f77461f55ed1f3", "59e7635f86f7742cbf2c1095", "5df8a2ca86f7740bfe6df777", "5648a7494bdc2d9d488b4583", "62a09d79de7ac81993580530"];
// const eyewearArrayScav = ["557ff21e4bdc2d89578b4586", "59e770b986f7742cbd762754", "5b432be65acfc433000ed01f", "5aa2b923e5b5b000137b7589", "5aa2b986e5b5b00014028f4c", "5aa2b9aee5b5b00015693121", "603409c80ca681766b6a0fb2"];
// const faceCoverArrayScav = ["5b432b2f5acfc4771e1c6622", "5e54f79686f7744022011103", "5b432c305acfc40019478128", "5b432b6c5acfc4001a599bf0", "59e7715586f7742ee5789605", "5bd06f5d86f77427101ad47c", "5bd0716d86f774171822ef4b", "5bd071d786f7747e707b93a3", "572b7f1624597762ae139822", "5ab8f39486f7745cd93a1cca", "5ab8f4ff86f77431c60d91ba", "5b432f3d5acfc4704b4a1dfb", "572b7fa524597762b747ce82", "5b4326435acfc433000ed01d", "5bd073a586f7747e6f135799", "5e54f76986f7740366043752", "5c1a1e3f2e221602b66cc4c2"];
// Scav Gear // // Scav Ammo
const primaryWeaponArrayScav = ["5f2a9575926fd9352339381f", "5aafa857e5b5b00018480968", "56dee2bdd2720bc8328b4567", "54491c4f4bdc2db1078b4568", "576165642459773c7a400233", "5a38e6bac4a2826c6e06d79b", "57f4c844245977379d5c14d1", "57d14d2524597714373db789", "57f3c6bd24597738e730fa2f", "59f9cabd86f7743a10721f46", "5ea03f7400685063ec28bfa8", "60339954d62c9b14ed777c06", "5c07c60e0db834002330051f", "5ac66d9b5acfc4001633997a", "5bf3e03b0db834001d2c4a9c", "5ac4cd105acfc40016339859", "5644bd2b4bdc2d3b4c8b4572", "5bf3e0490db83400196199af", "59d6088586f774275f37482f", "5a0ec13bfcdbcb00165aa685", "59ff346386f77477562ff5e2", "57dc2fa62459775949412633", "5839a40f24597726f856b511", "583990e32459771419544dd2", "5b0bbe4e5acfc40dc528a72d", "59e6687d86f77411d949b251", "59e6152586f77473dc057aa1", "587e02ff24597743df3deaeb", "574d967124597745970e7c94", "5c501a4d2e221602b412b540", "57838ad32459774a17445cd2", "5c46fbd72e2216398b5a8c9c", "5ae08f0a5acfc408fb1398a1", "5bfea6e90db834001b7347f3", "55801eed4bdc2d89578b4588", "5de652c31b7e3716273428be"]; // const ammo762x54ArrayScav = ["5887431f2459777e1612938f", "5e023cf8186a883be655e54f"];
const holsterArrayScav = ["576a581d2459771e7b1bc4f1", "56d59856d2720bd8418b456a", "56e0598dd2720bb5668b45a6", "5a17f98cfcdbcb0980087290", "579204f224597773d619e051", "5448bd6b4bdc2dfc2f8b4569", "571a12c42459771f627b58a0", "5cadc190ae921500103bb3b6", "5e81c3cbac2bb513793cdc75"]; // const ammo762x54ArrayScav2 = ammo762x54ArrayScav.concat(...["59e77a2386f7742ee578960a", "560d61e84bdc2da74d8b4571"]);
const backpackArrayScav = ["59e763f286f7742ee57895da", "56e335e4d2720b6c058b456d", "544a5cde4bdc2d39388b456b", "5f5e45cc5021ce62144be7aa", "56e33634d2720bd8058b456b", "56e33680d2720be2748b4576", "5ab8ee7786f7742d8f33f0b9", "5ab8f04f86f774585f4237d8"];
const tacticalVestArrayScav = ["5d5d646386f7742797261fd9", "5c0e446786f7742013381639", "5e4abc1f86f774069619fbaa", "572b7adb24597762ae139821", "5fd4c5477a8d854fa0105061", "5fd4c4fa16cac650092f6771", "5648a69d4bdc2ded0b8b457b", "5e4abfed86f77406a2713cf7", "59e7643b86f7742cbf2c109a", "5929a2a086f7744f4b234d43", "5ab8dab586f77441cd04f2a2", "5ca20abf86f77418567a43f2", "5c0e6a1586f77404597b4965"];
const earpieceArrayScav = ["5c165d832e2216398b5a7e36", "5b432b965acfc47a8774094e", "6033fa48ffd42c541047f728"];
const headwearArrayScav = ["5ea05cf85ad9772e6624305d", "5df8a58286f77412631087ed", "5c0d2727d174af02a012cf58", "5c08f87c0db8340019124324", "59e7711e86f7746cae05fbe1", "5a7c4850e899ef00150be885", "5aa7cfc0e5b5b00015693143", "5aa7d03ae5b5b00016327db5", "5c06c6a80db834001b735491", "5c066ef40db834001966a595", "5aa2b9ede5b5b000137b758b", "59e7708286f7742cbd762753", "572b7fa124597762b472f9d2", "5bd073c986f7747f627e796c", "59e770f986f7742cbe3164ef", "572b7d8524597762b472f9d1", "5a43943586f77416ad2f06e2", "5a43957686f7742a2c2f11b0", "5aa2b8d7e5b5b00014028f4a", "5aa2ba19e5b5b00014028f4e", "5aa2a7e8e5b5b00016327c16", "5aa2b87de5b5b00016327c25", "5aa2b89be5b5b0001569311f", "5b4329075acfc400153b78ff", "5ab8f20c86f7745cdb629fb2"];
const armorVestArrayScav = ["5ab8e79e86f7742d8b372e78", "5e9dacf986f774054d6b89f4", "5c0e53c886f7747fa54205c7", "5c0e51be86f774598e797894", "5ab8e4ed86f7742d8e50c7fa", "5c0e5edb86f77461f55ed1f7", "5b44d22286f774172b0c9de8", "5c0e5bab86f77461f55ed1f3", "59e7635f86f7742cbf2c1095", "5df8a2ca86f7740bfe6df777", "5648a7494bdc2d9d488b4583", "62a09d79de7ac81993580530"];
const eyewearArrayScav = ["557ff21e4bdc2d89578b4586", "59e770b986f7742cbd762754", "5b432be65acfc433000ed01f", "5aa2b923e5b5b000137b7589", "5aa2b986e5b5b00014028f4c", "5aa2b9aee5b5b00015693121", "603409c80ca681766b6a0fb2"];
const faceCoverArrayScav = ["5b432b2f5acfc4771e1c6622", "5e54f79686f7744022011103", "5b432c305acfc40019478128", "5b432b6c5acfc4001a599bf0", "59e7715586f7742ee5789605", "5bd06f5d86f77427101ad47c", "5bd0716d86f774171822ef4b", "5bd071d786f7747e707b93a3", "572b7f1624597762ae139822", "5ab8f39486f7745cd93a1cca", "5ab8f4ff86f77431c60d91ba", "5b432f3d5acfc4704b4a1dfb", "572b7fa524597762b747ce82", "5b4326435acfc433000ed01d", "5bd073a586f7747e6f135799", "5e54f76986f7740366043752", "5c1a1e3f2e221602b66cc4c2"];
// Scav Ammo
const ammo762x54ArrayScav = ["5887431f2459777e1612938f", "5e023cf8186a883be655e54f"];
const ammo762x54ArrayScav2 = ammo762x54ArrayScav.concat(...["59e77a2386f7742ee578960a", "560d61e84bdc2da74d8b4571"]);
const ammo762x51ArrayScav = ["5e023e6e34d52a55c3304f71", "5e023e53d4353e3302577c4c"]; // const ammo762x51ArrayScav = ["5e023e6e34d52a55c3304f71", "5e023e53d4353e3302577c4c"];
const ammo762x51ArrayScav2 = ammo762x51ArrayScav.concat(...["58dd3ad986f77403051cba8f", "5a608bf24f39f98ffc77720e", "5a6086ea4f39f99cd479502f"]); // const ammo762x51ArrayScav2 = ammo762x51ArrayScav.concat(...["58dd3ad986f77403051cba8f", "5a608bf24f39f98ffc77720e", "5a6086ea4f39f99cd479502f"]);
const ammo762x39ArrayScav = ["5656d7c34bdc2d9d198b4587", "59e4cf5286f7741778269d8a"]; // const ammo762x39ArrayScav = ["5656d7c34bdc2d9d198b4587", "59e4cf5286f7741778269d8a"];
const ammo762x39ArrayScav2 = ammo762x39ArrayScav.concat(...["59e4d24686f7741776641ac7", "59e0d99486f7744a32234762"]); // const ammo762x39ArrayScav2 = ammo762x39ArrayScav.concat(...["59e4d24686f7741776641ac7", "59e0d99486f7744a32234762"]);
const ammo762x25TTArrayScav = ["5735fdcd2459776445391d61", "5735ff5c245977640e39ba7e", "573601b42459776410737435", "573602322459776445391df1", "5736026a245977644601dc61", "573603c924597764442bd9cb"]; // const ammo762x25TTArrayScav = ["5735fdcd2459776445391d61", "5735ff5c245977640e39ba7e", "573601b42459776410737435", "573602322459776445391df1", "5736026a245977644601dc61", "573603c924597764442bd9cb"];
const ammo762x25TTArrayScav2 = ammo762x25TTArrayScav.concat(...["573603562459776430731618"]); // const ammo762x25TTArrayScav2 = ammo762x25TTArrayScav.concat(...["573603562459776430731618"]);
const ammo366TKMArrayScav = ["59e6542b86f77411dc52a77a", "59e655cb86f77411dc52a77b", "59e6658b86f77411d949b250"]; // const ammo366TKMArrayScav = ["59e6542b86f77411dc52a77a", "59e655cb86f77411dc52a77b", "59e6658b86f77411d949b250"];
const ammo366TKMArrayScav2 = ammo366TKMArrayScav.concat(...["5f0596629e22f464da6bbdd9"]); // const ammo366TKMArrayScav2 = ammo366TKMArrayScav.concat(...["5f0596629e22f464da6bbdd9"]);
const ammo556x45ArrayScav = ["59e6920f86f77411d82aa167", "54527a984bdc2d4e668b4567", "59e68f6f86f7746c9f75e846", "59e6906286f7746c9f75e847"]; // const ammo556x45ArrayScav = ["59e6920f86f77411d82aa167", "54527a984bdc2d4e668b4567", "59e68f6f86f7746c9f75e846", "59e6906286f7746c9f75e847"];
const ammo556x45ArrayScav2 = ammo556x45ArrayScav.concat(...["59e690b686f7746c9f75e848"]); // const ammo556x45ArrayScav2 = ammo556x45ArrayScav.concat(...["59e690b686f7746c9f75e848"]);
const ammo545x39ArrayScav = ["56dff4a2d2720bbd668b456a", "56dff3afd2720bba668b4567", "56dff2ced2720bb4668b4567", "56dff4ecd2720b5f5a8b4568"]; // const ammo545x39ArrayScav = ["56dff4a2d2720bbd668b456a", "56dff3afd2720bba668b4567", "56dff2ced2720bb4668b4567", "56dff4ecd2720b5f5a8b4568"];
const ammo545x39ArrayScav2 = ammo545x39ArrayScav.concat(...["56dfef82d2720bbd668b4567", "56dff061d2720bb5668b4567", "56dff026d2720bb8668b4567", "5c0d5e4486f77478390952fe"]); // const ammo545x39ArrayScav2 = ammo545x39ArrayScav.concat(...["56dfef82d2720bbd668b4567", "56dff061d2720bb5668b4567", "56dff026d2720bb8668b4567", "5c0d5e4486f77478390952fe"]);
const ammo9x18ArrayScav = ["573719762459775a626ccbc1", "57371e4124597760ff7b25f1", "5737207f24597760ff7b25f2"]; // const ammo9x18ArrayScav = ["573719762459775a626ccbc1", "57371e4124597760ff7b25f1", "5737207f24597760ff7b25f2"];
const ammo9x18ArrayScav2 = ammo9x18ArrayScav.concat(...["573718ba2459775a75491131", "573719df2459775a626ccbc2", "57371aab2459775a77142f22", "57372140245977611f70ee91"]); // const ammo9x18ArrayScav2 = ammo9x18ArrayScav.concat(...["573718ba2459775a75491131", "573719df2459775a626ccbc2", "57371aab2459775a77142f22", "57372140245977611f70ee91"]);
const ammo9x19ArrayScav = ["5c3df7d588a4501f290594e5", "56d59d3ad2720bdb418b4577"]; // const ammo9x19ArrayScav = ["5c3df7d588a4501f290594e5", "56d59d3ad2720bdb418b4577"];
const ammo9x19ArrayScav2 = ammo9x19ArrayScav.concat(...["5c925fa22e221601da359b7b", "5efb0e16aeb21837e749c7ff", "5efb0da7a29a85116f6ea05f"]); // const ammo9x19ArrayScav2 = ammo9x19ArrayScav.concat(...["5c925fa22e221601da359b7b", "5efb0e16aeb21837e749c7ff", "5efb0da7a29a85116f6ea05f"]);
const ammo9x39ArrayScav = ["57a0dfb82459774d3078b56c"]; // const ammo9x39ArrayScav = ["57a0dfb82459774d3078b56c"];
const ammo9x39ArrayScav2 = ammo9x39ArrayScav.concat(...["57a0e5022459774d1673f889", "5c0d688c86f77413ae3407b2", "5c0d668f86f7747ccb7f13b2"]); // const ammo9x39ArrayScav2 = ammo9x39ArrayScav.concat(...["57a0e5022459774d1673f889", "5c0d688c86f77413ae3407b2", "5c0d668f86f7747ccb7f13b2"]);
const ammo1143x23ACPArrayScav = ["5e81f423763d9f754677bf2e", "5efb0d4f4bc50b58e81710f3"]; // const ammo1143x23ACPArrayScav = ["5e81f423763d9f754677bf2e", "5efb0d4f4bc50b58e81710f3"];
const ammo1143x23ACPArrayScav2 = ammo1143x23ACPArrayScav.concat(...["5efb0cabfb3e451d70735af5", "5efb0fc6aeb21837e749c801"]); // const ammo1143x23ACPArrayScav2 = ammo1143x23ACPArrayScav.concat(...["5efb0cabfb3e451d70735af5", "5efb0fc6aeb21837e749c801"]);
const ammo12x70ArrayScav = ["560d5e524bdc2d25448b4571", "5d6e6772a4b936088465b17c", "5d6e67fba4b9361bc73bc779", "58820d1224597753c90aeb13", "5d6e6869a4b9361c140bcfde", "5d6e6891a4b9361bd473feea","5d6e6806a4b936088465b17e", "5d6e689ca4b9361bc8618956", "5d6e68e6a4b9361c140bcfe0"]; // const ammo12x70ArrayScav = ["560d5e524bdc2d25448b4571", "5d6e6772a4b936088465b17c", "5d6e67fba4b9361bc73bc779", "58820d1224597753c90aeb13", "5d6e6869a4b9361c140bcfde", "5d6e6891a4b9361bd473feea","5d6e6806a4b936088465b17e", "5d6e689ca4b9361bc8618956", "5d6e68e6a4b9361c140bcfe0"];
const ammo12x70ArrayScav2 = ammo12x70ArrayScav.concat(...["5d6e68b3a4b9361bca7e50b5", "5d6e68dea4b9361bcc29e659", "5d6e68a8a4b9360b6c0d54e2", "5d6e6911a4b9361bd5780d52", "5d6e68c4a4b9361b93413f79", "5c0d591486f7744c505b416f"]); // const ammo12x70ArrayScav2 = ammo12x70ArrayScav.concat(...["5d6e68b3a4b9361bca7e50b5", "5d6e68dea4b9361bcc29e659", "5d6e68a8a4b9360b6c0d54e2", "5d6e6911a4b9361bd5780d52", "5d6e68c4a4b9361b93413f79", "5c0d591486f7744c505b416f"]);
const ammo20x70ArrayScav = ["5a38ebd9c4a282000d722a5b", "5d6e695fa4b936359b35d852", "5d6e6a42a4b9364f07165f52", "5d6e6a53a4b9361bd473feec", "5d6e69b9a4b9361bc8618958", "5d6e69c7a4b9360b6c0d54e4"]; // const ammo20x70ArrayScav = ["5a38ebd9c4a282000d722a5b", "5d6e695fa4b936359b35d852", "5d6e6a42a4b9364f07165f52", "5d6e6a53a4b9361bd473feec", "5d6e69b9a4b9361bc8618958", "5d6e69c7a4b9360b6c0d54e4"];
const ammo20x70ArrayScav2 = ammo20x70ArrayScav.concat(...["5d6e6a05a4b93618084f58d0", "5d6e6a5fa4b93614ec501745"]); // const ammo20x70ArrayScav2 = ammo20x70ArrayScav.concat(...["5d6e6a05a4b93618084f58d0", "5d6e6a5fa4b93614ec501745"]);
// Scav Whitelist // // Scav Whitelist
const progressionWhitelistScav1: EquipmentFilters = // const progressionWhitelistScav1: EquipmentFilters =
{ // {
"weaponModLimits": { // "weaponModLimits": {},
"scopeLimit": 1, // "weaponSightWhitelist": {},
"lightLaserLimit": 1 // "nvgIsActiveChancePercent": 5,
}, // "faceShieldIsActiveChancePercent": 85,
"randomisedWeaponModSlots": [], // "lightLaserIsActiveChancePercent": 75,
"blacklist": [], // "randomisation": [],
"whitelist": [{ // "blacklist": [],
"levelRange": // "weightingAdjustments": [],
{ // "whitelist": [{
"min": 1, // "levelRange":
"max": 25 // {
}, // "min": 1,
"equipment": // "max": 32
{ // },
"FirstPrimaryWeapon": [...primaryWeaponArrayScav], // "equipment":
"Holster": [...holsterArrayScav], // {
"Backpack": [...backpackArrayScav], // "FirstPrimaryWeapon": [...primaryWeaponArrayScav],
"TacticalVest": [...tacticalVestArrayScav], // "Holster": [...holsterArrayScav],
"Earpiece": [...earpieceArrayScav], // "Backpack": [...backpackArrayScav],
"Headwear": [...headwearArrayScav], // "TacticalVest": [...tacticalVestArrayScav],
"ArmorVest": [...armorVestArrayScav], // "Earpiece": [...earpieceArrayScav],
"Eyewear": [...eyewearArrayScav], // "Headwear": [...headwearArrayScav],
"FaceCover": [...faceCoverArrayScav] // "ArmorVest": [...armorVestArrayScav],
}, // "Eyewear": [...eyewearArrayScav],
"cartridge": // "FaceCover": [...faceCoverArrayScav]
{ // },
"Caliber762x54R": [...ammo762x54ArrayScav], // "cartridge":
"Caliber762x51": [...ammo762x51ArrayScav], // {
"Caliber762x39": [...ammo762x39ArrayScav], // "Caliber762x54R": [...ammo762x54ArrayScav],
"Caliber762x25TT": [...ammo762x25TTArrayScav], // "Caliber762x51": [...ammo762x51ArrayScav],
"Caliber366TKM": [...ammo366TKMArrayScav], // "Caliber762x39": [...ammo762x39ArrayScav],
"Caliber556x45NATO": [...ammo556x45ArrayScav], // "Caliber762x25TT": [...ammo762x25TTArrayScav],
"Caliber545x39": [...ammo545x39ArrayScav], // "Caliber366TKM": [...ammo366TKMArrayScav],
"Caliber1143x23ACP": [...ammo1143x23ACPArrayScav], // "Caliber556x45NATO": [...ammo556x45ArrayScav],
"Caliber9x39": [...ammo9x39ArrayScav], // "Caliber545x39": [...ammo545x39ArrayScav],
"Caliber9x19PARA": [...ammo9x19ArrayScav], // "Caliber1143x23ACP": [...ammo1143x23ACPArrayScav],
"Caliber9x18PM": [...ammo9x18ArrayScav], // "Caliber9x39": [...ammo9x39ArrayScav],
"Caliber12g": [...ammo12x70ArrayScav], // "Caliber9x19PARA": [...ammo9x19ArrayScav],
"Caliber20g": [...ammo20x70ArrayScav] // "Caliber9x18PM": [...ammo9x18ArrayScav],
} // "Caliber12g": [...ammo12x70ArrayScav],
}] // "Caliber20g": [...ammo20x70ArrayScav]
} // }
// }],
// "clothing": []
// }
const progressionWhitelistScav2: EquipmentFilterDetails = // const progressionWhitelistScav2: EquipmentFilterDetails =
{ // {
"levelRange": // "levelRange":
{ // {
"min": 33, // "min": 33,
"max": 70 // "max": 70
}, // },
"equipment": // "equipment":
{ // {
"FirstPrimaryWeapon": [...primaryWeaponArrayScav], // "FirstPrimaryWeapon": [...primaryWeaponArrayScav],
"Holster": [...holsterArrayScav], // "Holster": [...holsterArrayScav],
"Backpack": [...backpackArrayScav], // "Backpack": [...backpackArrayScav],
"TacticalVest": [...tacticalVestArrayScav], // "TacticalVest": [...tacticalVestArrayScav],
"Earpiece": [...earpieceArrayScav], // "Earpiece": [...earpieceArrayScav],
"Headwear": [...headwearArrayScav], // "Headwear": [...headwearArrayScav],
"ArmorVest": [...armorVestArrayScav], // "ArmorVest": [...armorVestArrayScav],
"Eyewear": [...eyewearArrayScav], // "Eyewear": [...eyewearArrayScav],
"FaceCover": [...faceCoverArrayScav] // "FaceCover": [...faceCoverArrayScav]
}, // },
"cartridge": // "cartridge":
{ // {
"Caliber762x54R": [...ammo762x54ArrayScav2], // "Caliber762x54R": [...ammo762x54ArrayScav2],
"Caliber762x51": [...ammo762x51ArrayScav2], // "Caliber762x51": [...ammo762x51ArrayScav2],
"Caliber762x39": [...ammo762x39ArrayScav2], // "Caliber762x39": [...ammo762x39ArrayScav2],
"Caliber762x25TT": [...ammo762x25TTArrayScav2], // "Caliber762x25TT": [...ammo762x25TTArrayScav2],
"Caliber366TKM": [...ammo366TKMArrayScav2], // "Caliber366TKM": [...ammo366TKMArrayScav2],
"Caliber556x45NATO": [...ammo556x45ArrayScav2], // "Caliber556x45NATO": [...ammo556x45ArrayScav2],
"Caliber545x39": [...ammo545x39ArrayScav2], // "Caliber545x39": [...ammo545x39ArrayScav2],
"Caliber1143x23ACP": [...ammo1143x23ACPArrayScav2], // "Caliber1143x23ACP": [...ammo1143x23ACPArrayScav2],
"Caliber9x39": [...ammo9x39ArrayScav2], // "Caliber9x39": [...ammo9x39ArrayScav2],
"Caliber9x19PARA": [...ammo9x19ArrayScav2], // "Caliber9x19PARA": [...ammo9x19ArrayScav2],
"Caliber9x18PM": [...ammo9x18ArrayScav2], // "Caliber9x18PM": [...ammo9x18ArrayScav2],
"Caliber12g": [...ammo12x70ArrayScav2], // "Caliber12g": [...ammo12x70ArrayScav2],
"Caliber20g": [...ammo20x70ArrayScav2] // "Caliber20g": [...ammo20x70ArrayScav2]
} // }
} // }
// Scav Gear Weighting Changes // // Scav Gear Weighting Changes
const scavEquipment = this.databaseServer.bots.types.assault.inventory.equipment; // const scavEquipment = this.databaseServer.bots.types.assault.inventory.equipment;
const scavChances = this.databaseServer.bots.types.assault.chances; // const scavChances = this.databaseServer.bots.types.assault.chances;
const scavAmmo = this.databaseServer.bots.types.assault.inventory.Ammo; // const scavAmmo = this.databaseServer.bots.types.assault.inventory.Ammo;
// Scav Primary Weapon Weighting && Chance Edits // // Scav Primary Weapon Weighting && Chance Edits
scavChances.mods.mod_foregrip = 15; // scavChances.mods.mod_foregrip = 15;
scavEquipment.FirstPrimaryWeapon= { // scavEquipment.FirstPrimaryWeapon= {
"56dee2bdd2720bc8328b4567": 23, // "56dee2bdd2720bc8328b4567": 23,
"54491c4f4bdc2db1078b4568": 25, // "54491c4f4bdc2db1078b4568": 25,
"576165642459773c7a400233": 23, // "576165642459773c7a400233": 23,
"5a38e6bac4a2826c6e06d79b": 23, // "5a38e6bac4a2826c6e06d79b": 23,
"57f4c844245977379d5c14d1": 25, // "57f4c844245977379d5c14d1": 25,
"57d14d2524597714373db789": 25, // "57d14d2524597714373db789": 25,
"59f9cabd86f7743a10721f46": 23, // "59f9cabd86f7743a10721f46": 23,
"5ea03f7400685063ec28bfa8": 23, // "5ea03f7400685063ec28bfa8": 23,
"60339954d62c9b14ed777c06": 23, // "60339954d62c9b14ed777c06": 23,
"5c07c60e0db834002330051f": 25, // "5c07c60e0db834002330051f": 25,
"5ac66d9b5acfc4001633997a": 23, // "5ac66d9b5acfc4001633997a": 23,
"5bf3e03b0db834001d2c4a9c": 23, // "5bf3e03b0db834001d2c4a9c": 23,
"5ac4cd105acfc40016339859": 23, // "5ac4cd105acfc40016339859": 23,
"5644bd2b4bdc2d3b4c8b4572": 23, // "5644bd2b4bdc2d3b4c8b4572": 23,
"5bf3e0490db83400196199af": 23, // "5bf3e0490db83400196199af": 23,
"59d6088586f774275f37482f": 23, // "59d6088586f774275f37482f": 23,
"5a0ec13bfcdbcb00165aa685": 23, // "5a0ec13bfcdbcb00165aa685": 23,
"59ff346386f77477562ff5e2": 23, // "59ff346386f77477562ff5e2": 23,
"57dc2fa62459775949412633": 25, // "57dc2fa62459775949412633": 25,
"5839a40f24597726f856b511": 25, // "5839a40f24597726f856b511": 25,
"583990e32459771419544dd2": 25, // "583990e32459771419544dd2": 25,
"5b0bbe4e5acfc40dc528a72d": 5, // "5b0bbe4e5acfc40dc528a72d": 5,
"59e6687d86f77411d949b251": 41, // "59e6687d86f77411d949b251": 41,
"59e6152586f77473dc057aa1": 41, // "59e6152586f77473dc057aa1": 41,
"587e02ff24597743df3deaeb": 11, // "587e02ff24597743df3deaeb": 11,
"574d967124597745970e7c94": 27, // "574d967124597745970e7c94": 27,
"5c501a4d2e221602b412b540": 5, // "5c501a4d2e221602b412b540": 5,
"57838ad32459774a17445cd2": 5, // "57838ad32459774a17445cd2": 5,
"5c46fbd72e2216398b5a8c9c": 5, // "5c46fbd72e2216398b5a8c9c": 5,
"5ae08f0a5acfc408fb1398a1": 23, // "5ae08f0a5acfc408fb1398a1": 23,
"5bfea6e90db834001b7347f3": 5, // "5bfea6e90db834001b7347f3": 5,
"55801eed4bdc2d89578b4588": 5, // "55801eed4bdc2d89578b4588": 5,
"5de652c31b7e3716273428be": 23, // "5de652c31b7e3716273428be": 23,
"5f2a9575926fd9352339381f": 7, // "5f2a9575926fd9352339381f": 7,
"5aafa857e5b5b00018480968": 7 // "5aafa857e5b5b00018480968": 7
} // }
// Scav Holster (Secondary Weapon) Weighting // // Scav Holster (Secondary Weapon) Weighting
scavChances.equipment.Holster = 12; // scavChances.equipment.Holster = 12;
scavEquipment.Holster = { // scavEquipment.Holster = {
"576a581d2459771e7b1bc4f1": 25, // "576a581d2459771e7b1bc4f1": 25,
"56d59856d2720bd8418b456a": 17, // "56d59856d2720bd8418b456a": 17,
"56e0598dd2720bb5668b45a6": 12, // "56e0598dd2720bb5668b45a6": 12,
"5a17f98cfcdbcb0980087290": 17, // "5a17f98cfcdbcb0980087290": 17,
"579204f224597773d619e051": 27, // "579204f224597773d619e051": 27,
"5448bd6b4bdc2dfc2f8b4569": 31, // "5448bd6b4bdc2dfc2f8b4569": 31,
"571a12c42459771f627b58a0": 31, // "571a12c42459771f627b58a0": 31,
"5cadc190ae921500103bb3b6": 17, // "5cadc190ae921500103bb3b6": 17,
"5e81c3cbac2bb513793cdc75": 12 // "5e81c3cbac2bb513793cdc75": 12
} // }
// Scav Backpack Weighting && Chance Edit // // Scav Backpack Weighting && Chance Edit
scavChances.equipment.Backpack = 55; // scavChances.equipment.Backpack = 55;
scavEquipment.Backpack = { // scavEquipment.Backpack = {
"59e763f286f7742ee57895da": 11, // "59e763f286f7742ee57895da": 11,
"56e335e4d2720b6c058b456d": 16, // "56e335e4d2720b6c058b456d": 16,
"544a5cde4bdc2d39388b456b": 25, // "544a5cde4bdc2d39388b456b": 25,
"5f5e45cc5021ce62144be7aa": 29, // "5f5e45cc5021ce62144be7aa": 29,
"56e33634d2720bd8058b456b": 29, // "56e33634d2720bd8058b456b": 29,
"56e33680d2720be2748b4576": 30, // "56e33680d2720be2748b4576": 30,
"5ab8ee7786f7742d8f33f0b9": 30, // "5ab8ee7786f7742d8f33f0b9": 30,
"5ab8f04f86f774585f4237d8": 30, // "5ab8f04f86f774585f4237d8": 30,
"628e1ffc83ec92260c0f437f": 6, // "628e1ffc83ec92260c0f437f": 6,
"5df8a4d786f77412672a1e3b": 2 // "5df8a4d786f77412672a1e3b": 2
} // }
// Scav Tac Vest Weighting // // Scav Tac Vest Weighting
scavEquipment.TacticalVest = { // scavEquipment.TacticalVest = {
"5d5d646386f7742797261fd9": 14, // "5d5d646386f7742797261fd9": 14,
"5c0e446786f7742013381639": 14, // "5c0e446786f7742013381639": 14,
"5e4abc1f86f774069619fbaa": 20, // "5e4abc1f86f774069619fbaa": 20,
"572b7adb24597762ae139821": 20, // "572b7adb24597762ae139821": 20,
"5fd4c5477a8d854fa0105061": 20, // "5fd4c5477a8d854fa0105061": 20,
"5fd4c4fa16cac650092f6771": 20, // "5fd4c4fa16cac650092f6771": 20,
"5648a69d4bdc2ded0b8b457b": 6, // "5648a69d4bdc2ded0b8b457b": 6,
"5e4abfed86f77406a2713cf7": 20, // "5e4abfed86f77406a2713cf7": 20,
"59e7643b86f7742cbf2c109a": 20, // "59e7643b86f7742cbf2c109a": 20,
"5929a2a086f7744f4b234d43": 20, // "5929a2a086f7744f4b234d43": 20,
"5ab8dab586f77441cd04f2a2": 8, // "5ab8dab586f77441cd04f2a2": 8,
"5ca20abf86f77418567a43f2": 10, // "5ca20abf86f77418567a43f2": 10,
"5c0e6a1586f77404597b4965": 8 // "5c0e6a1586f77404597b4965": 8
} // }
// Scav Headset/Earpiece Weighting && Chance Edit // // Scav Headset/Earpiece Weighting && Chance Edit
scavChances.equipment.Earpiece = 30; // scavChances.equipment.Earpiece = 30;
scavEquipment.Earpiece = { // scavEquipment.Earpiece = {
"5c165d832e2216398b5a7e36": 32, // "5c165d832e2216398b5a7e36": 32,
"5b432b965acfc47a8774094e": 34, // "5b432b965acfc47a8774094e": 34,
"6033fa48ffd42c541047f728": 34 // "6033fa48ffd42c541047f728": 34
} // }
// Scav Headwear/Helmet Weighting // // Scav Headwear/Helmet Weighting
scavChances.mods.mod_nvg = 10; // scavChances.mods.mod_nvg = 10;
scavEquipment.Headwear = { // scavEquipment.Headwear = {
"5ea05cf85ad9772e6624305d": 16, // "5ea05cf85ad9772e6624305d": 16,
"5df8a58286f77412631087ed": 16, // "5df8a58286f77412631087ed": 16,
"5c0d2727d174af02a012cf58": 16, // "5c0d2727d174af02a012cf58": 16,
"5c08f87c0db8340019124324": 16, // "5c08f87c0db8340019124324": 16,
"59e7711e86f7746cae05fbe1": 16, // "59e7711e86f7746cae05fbe1": 16,
"5a7c4850e899ef00150be885": 16, // "5a7c4850e899ef00150be885": 16,
"5aa7cfc0e5b5b00015693143": 16, // "5aa7cfc0e5b5b00015693143": 16,
"5aa7d03ae5b5b00016327db5": 16, // "5aa7d03ae5b5b00016327db5": 16,
"5c06c6a80db834001b735491": 16, // "5c06c6a80db834001b735491": 16,
"5c066ef40db834001966a595": 16, // "5c066ef40db834001966a595": 16,
"5aa2b9ede5b5b000137b758b": 16, // "5aa2b9ede5b5b000137b758b": 16,
"59e7708286f7742cbd762753": 16, // "59e7708286f7742cbd762753": 16,
"572b7fa124597762b472f9d2": 16, // "572b7fa124597762b472f9d2": 16,
"5bd073c986f7747f627e796c": 16, // "5bd073c986f7747f627e796c": 16,
"59e770f986f7742cbe3164ef": 16, // "59e770f986f7742cbe3164ef": 16,
"572b7d8524597762b472f9d1": 16, // "572b7d8524597762b472f9d1": 16,
"5a43943586f77416ad2f06e2": 16, // "5a43943586f77416ad2f06e2": 16,
"5a43957686f7742a2c2f11b0": 16, // "5a43957686f7742a2c2f11b0": 16,
"5aa2b8d7e5b5b00014028f4a": 16, // "5aa2b8d7e5b5b00014028f4a": 16,
"5aa2ba19e5b5b00014028f4e": 16, // "5aa2ba19e5b5b00014028f4e": 16,
"5aa2a7e8e5b5b00016327c16": 16, // "5aa2a7e8e5b5b00016327c16": 16,
"5aa2b87de5b5b00016327c25": 16, // "5aa2b87de5b5b00016327c25": 16,
"5aa2b89be5b5b0001569311f": 16, // "5aa2b89be5b5b0001569311f": 16,
"5b4329075acfc400153b78ff": 16, // "5b4329075acfc400153b78ff": 16,
"5ab8f20c86f7745cdb629fb2": 16 // "5ab8f20c86f7745cdb629fb2": 16
} // }
// Scav Armor Vest Weighting // // Scav Armor Vest Weighting
scavEquipment.ArmorVest = { // scavEquipment.ArmorVest = {
"5ab8e79e86f7742d8b372e78": 3, // "5ab8e79e86f7742d8b372e78": 3,
"5e9dacf986f774054d6b89f4": 3, // "5e9dacf986f774054d6b89f4": 3,
"5c0e53c886f7747fa54205c7": 16, // "5c0e53c886f7747fa54205c7": 16,
"5c0e51be86f774598e797894": 16, // "5c0e51be86f774598e797894": 16,
"5ab8e4ed86f7742d8e50c7fa": 22, // "5ab8e4ed86f7742d8e50c7fa": 22,
"5c0e5edb86f77461f55ed1f7": 22, // "5c0e5edb86f77461f55ed1f7": 22,
"5b44d22286f774172b0c9de8": 22, // "5b44d22286f774172b0c9de8": 22,
"5c0e5bab86f77461f55ed1f3": 22, // "5c0e5bab86f77461f55ed1f3": 22,
"59e7635f86f7742cbf2c1095": 22, // "59e7635f86f7742cbf2c1095": 22,
"5df8a2ca86f7740bfe6df777": 22, // "5df8a2ca86f7740bfe6df777": 22,
"5648a7494bdc2d9d488b4583": 22, // "5648a7494bdc2d9d488b4583": 22,
"62a09d79de7ac81993580530": 8 // "62a09d79de7ac81993580530": 8
} // }
// Scav Eyewear Weighting // // Scav Eyewear Weighting
scavEquipment.Eyewear = { // scavEquipment.Eyewear = {
"557ff21e4bdc2d89578b4586": 22, // "557ff21e4bdc2d89578b4586": 22,
"59e770b986f7742cbd762754": 23, // "59e770b986f7742cbd762754": 23,
"5b432be65acfc433000ed01f": 23, // "5b432be65acfc433000ed01f": 23,
"5aa2b923e5b5b000137b7589": 9, // "5aa2b923e5b5b000137b7589": 9,
"5aa2b986e5b5b00014028f4c": 23, // "5aa2b986e5b5b00014028f4c": 23,
"5aa2b9aee5b5b00015693121": 14, // "5aa2b9aee5b5b00015693121": 14,
"603409c80ca681766b6a0fb2": 7 // "603409c80ca681766b6a0fb2": 7
} // }
// Scav Facecover Weighting // // Scav Facecover Weighting
scavEquipment.FaceCover = { // scavEquipment.FaceCover = {
"5b432b2f5acfc4771e1c6622": 21, // "5b432b2f5acfc4771e1c6622": 21,
"5e54f79686f7744022011103": 15, // "5e54f79686f7744022011103": 15,
"5b432c305acfc40019478128": 21, // "5b432c305acfc40019478128": 21,
"5b432b6c5acfc4001a599bf0": 21, // "5b432b6c5acfc4001a599bf0": 21,
"59e7715586f7742ee5789605": 24, // "59e7715586f7742ee5789605": 24,
"5bd06f5d86f77427101ad47c": 21, // "5bd06f5d86f77427101ad47c": 21,
"5bd0716d86f774171822ef4b": 21, // "5bd0716d86f774171822ef4b": 21,
"5bd071d786f7747e707b93a3": 21, // "5bd071d786f7747e707b93a3": 21,
"572b7f1624597762ae139822": 21, // "572b7f1624597762ae139822": 21,
"5ab8f39486f7745cd93a1cca": 21, // "5ab8f39486f7745cd93a1cca": 21,
"5ab8f4ff86f77431c60d91ba": 21, // "5ab8f4ff86f77431c60d91ba": 21,
"5b432f3d5acfc4704b4a1dfb": 25, // "5b432f3d5acfc4704b4a1dfb": 25,
"572b7fa524597762b747ce82": 30, // "572b7fa524597762b747ce82": 30,
"5b4326435acfc433000ed01d": 30, // "5b4326435acfc433000ed01d": 30,
"5bd073a586f7747e6f135799": 20, // "5bd073a586f7747e6f135799": 20,
"5e54f76986f7740366043752": 15, // "5e54f76986f7740366043752": 15,
"5c1a1e3f2e221602b66cc4c2": 20 // "5c1a1e3f2e221602b66cc4c2": 20
} // }
// Scav Ammo Weighting // // Scav Ammo Weighting
// 762x54R Weighting // // 762x54R Weighting
scavAmmo.Caliber762x54R = { // scavAmmo.Caliber762x54R = {
"5887431f2459777e1612938f": 45, // "5887431f2459777e1612938f": 45,
"5e023cf8186a883be655e54f": 45, // "5e023cf8186a883be655e54f": 45,
"59e77a2386f7742ee578960a": 60, // "59e77a2386f7742ee578960a": 60,
"560d61e84bdc2da74d8b4571": 50 // "560d61e84bdc2da74d8b4571": 50
} // }
// 762x51 Weighting // // 762x51 Weighting
scavAmmo.Caliber762x51 = { // scavAmmo.Caliber762x51 = {
"5e023e6e34d52a55c3304f71": 25, // "5e023e6e34d52a55c3304f71": 25,
"5e023e53d4353e3302577c4c": 25, // "5e023e53d4353e3302577c4c": 25,
"58dd3ad986f77403051cba8f": 100, // "58dd3ad986f77403051cba8f": 100,
"5a608bf24f39f98ffc77720e": 100, // "5a608bf24f39f98ffc77720e": 100,
"5a6086ea4f39f99cd479502f": 50 // "5a6086ea4f39f99cd479502f": 50
} // }
// 762x39 Weighting // // 762x39 Weighting
scavAmmo.Caliber762x39 = { // scavAmmo.Caliber762x39 = {
"5656d7c34bdc2d9d198b4587": 30, // "5656d7c34bdc2d9d198b4587": 30,
"59e4cf5286f7741778269d8a": 30, // "59e4cf5286f7741778269d8a": 30,
"59e4d24686f7741776641ac7": 30, // "59e4d24686f7741776641ac7": 30,
"59e0d99486f7744a32234762": 10 // "59e0d99486f7744a32234762": 10
} // }
// 762x25 Weighting // // 762x25 Weighting
scavAmmo.Caliber762x25TT = { // scavAmmo.Caliber762x25TT = {
"5735fdcd2459776445391d61": 7, // "5735fdcd2459776445391d61": 7,
"5735ff5c245977640e39ba7e": 20, // "5735ff5c245977640e39ba7e": 20,
"573601b42459776410737435": 20, // "573601b42459776410737435": 20,
"573602322459776445391df1": 20, // "573602322459776445391df1": 20,
"5736026a245977644601dc61": 7, // "5736026a245977644601dc61": 7,
"573603c924597764442bd9cb": 6, // "573603c924597764442bd9cb": 6,
"573603562459776430731618": 20 // "573603562459776430731618": 20
} // }
// 366TKM Weighting // // 366TKM Weighting
scavAmmo.Caliber366TKM = { // scavAmmo.Caliber366TKM = {
"59e6542b86f77411dc52a77a": 30, // "59e6542b86f77411dc52a77a": 30,
"59e655cb86f77411dc52a77b": 80, // "59e655cb86f77411dc52a77b": 80,
"59e6658b86f77411d949b250": 10, // "59e6658b86f77411d949b250": 10,
"5f0596629e22f464da6bbdd9": 80 // "5f0596629e22f464da6bbdd9": 80
} // }
// 5.56x45 Weighting // // 5.56x45 Weighting
scavAmmo.Caliber556x45NATO = { // scavAmmo.Caliber556x45NATO = {
"59e6920f86f77411d82aa167": 20, // "59e6920f86f77411d82aa167": 20,
"54527a984bdc2d4e668b4567": 40, // "54527a984bdc2d4e668b4567": 40,
"59e68f6f86f7746c9f75e846": 40, // "59e68f6f86f7746c9f75e846": 40,
"59e6906286f7746c9f75e847": 40, // "59e6906286f7746c9f75e847": 40,
"59e690b686f7746c9f75e848": 40 // "59e690b686f7746c9f75e848": 40
} // }
// 5.45x39 Weighting // // 5.45x39 Weighting
scavAmmo.Caliber545x39 = { // scavAmmo.Caliber545x39 = {
"56dff4a2d2720bbd668b456a": 15, // "56dff4a2d2720bbd668b456a": 15,
"56dff3afd2720bba668b4567": 15, // "56dff3afd2720bba668b4567": 15,
"56dff2ced2720bb4668b4567": 15, // "56dff2ced2720bb4668b4567": 15,
"56dff4ecd2720b5f5a8b4568": 15, // "56dff4ecd2720b5f5a8b4568": 15,
"56dfef82d2720bbd668b4567": 20, // "56dfef82d2720bbd668b4567": 20,
"56dff061d2720bb5668b4567": 25, // "56dff061d2720bb5668b4567": 25,
"56dff026d2720bb8668b4567": 25, // "56dff026d2720bb8668b4567": 25,
"5c0d5e4486f77478390952fe": 25 // "5c0d5e4486f77478390952fe": 25
} // }
// 9x18 Weighting // // 9x18 Weighting
scavAmmo.Caliber9x18PM = { // scavAmmo.Caliber9x18PM = {
"573719762459775a626ccbc1": 20, // "573719762459775a626ccbc1": 20,
"57371e4124597760ff7b25f1": 30, // "57371e4124597760ff7b25f1": 30,
"5737207f24597760ff7b25f2": 50, // "5737207f24597760ff7b25f2": 50,
"573718ba2459775a75491131": 30, // "573718ba2459775a75491131": 30,
"573719df2459775a626ccbc2": 80, // "573719df2459775a626ccbc2": 80,
"57371aab2459775a77142f22": 60, // "57371aab2459775a77142f22": 60,
"57372140245977611f70ee91": 70 // "57372140245977611f70ee91": 70
} // }
// 9x19 Weighting // // 9x19 Weighting
scavAmmo.Caliber9x19PARA = { // scavAmmo.Caliber9x19PARA = {
"5c3df7d588a4501f290594e5": 30, // "5c3df7d588a4501f290594e5": 30,
"56d59d3ad2720bdb418b4577": 30, // "56d59d3ad2720bdb418b4577": 30,
"5c925fa22e221601da359b7b": 80, // "5c925fa22e221601da359b7b": 80,
"5efb0e16aeb21837e749c7ff": 80, // "5efb0e16aeb21837e749c7ff": 80,
"5efb0da7a29a85116f6ea05f": 80 // "5efb0da7a29a85116f6ea05f": 80
} // }
// 9x39 Weighting // // 9x39 Weighting
scavAmmo.Caliber9x39 = { // scavAmmo.Caliber9x39 = {
"57a0dfb82459774d3078b56c": 60, // "57a0dfb82459774d3078b56c": 60,
"57a0e5022459774d1673f889": 80, // "57a0e5022459774d1673f889": 80,
"5c0d688c86f77413ae3407b2": 80, // "5c0d688c86f77413ae3407b2": 80,
"5c0d668f86f7747ccb7f13b2": 40 // "5c0d668f86f7747ccb7f13b2": 40
} // }
// 1143x23 ACP Weighting // // 1143x23 ACP Weighting
scavAmmo.Caliber1143x23ACP = { // scavAmmo.Caliber1143x23ACP = {
"5e81f423763d9f754677bf2e": 60, // "5e81f423763d9f754677bf2e": 60,
"5efb0d4f4bc50b58e81710f3": 60, // "5efb0d4f4bc50b58e81710f3": 60,
"5efb0cabfb3e451d70735af5": 100, // "5efb0cabfb3e451d70735af5": 100,
"5efb0fc6aeb21837e749c801": 100 // "5efb0fc6aeb21837e749c801": 100
} // }
// 12 Gauge Weighting // // 12 Gauge Weighting
scavAmmo.Caliber12g = { // scavAmmo.Caliber12g = {
"560d5e524bdc2d25448b4571": 60, // "560d5e524bdc2d25448b4571": 60,
"5d6e6772a4b936088465b17c": 60, // "5d6e6772a4b936088465b17c": 60,
"5d6e67fba4b9361bc73bc779": 60, // "5d6e67fba4b9361bc73bc779": 60,
"58820d1224597753c90aeb13": 60, // "58820d1224597753c90aeb13": 60,
"5d6e6869a4b9361c140bcfde": 100, // "5d6e6869a4b9361c140bcfde": 100,
"5d6e6891a4b9361bd473feea": 100, // "5d6e6891a4b9361bd473feea": 100,
"5d6e6806a4b936088465b17e": 100, // "5d6e6806a4b936088465b17e": 100,
"5d6e689ca4b9361bc8618956": 100, // "5d6e689ca4b9361bc8618956": 100,
"5d6e68e6a4b9361c140bcfe0": 100, // "5d6e68e6a4b9361c140bcfe0": 100,
"5d6e68b3a4b9361bca7e50b5": 100, // "5d6e68b3a4b9361bca7e50b5": 100,
"5d6e68dea4b9361bcc29e659": 100, // "5d6e68dea4b9361bcc29e659": 100,
"5d6e68a8a4b9360b6c0d54e2": 100, // "5d6e68a8a4b9360b6c0d54e2": 100,
"5d6e6911a4b9361bd5780d52": 100, // "5d6e6911a4b9361bd5780d52": 100,
"5d6e68c4a4b9361b93413f79": 100, // "5d6e68c4a4b9361b93413f79": 100,
"5c0d591486f7744c505b416f": 100 // "5c0d591486f7744c505b416f": 100
} // }
// 20 Gauge Weighting // // 20 Gauge Weighting
scavAmmo.Caliber20g = { // scavAmmo.Caliber20g = {
"5a38ebd9c4a282000d722a5b": 60, // "5a38ebd9c4a282000d722a5b": 60,
"5d6e695fa4b936359b35d852": 60, // "5d6e695fa4b936359b35d852": 60,
"5d6e6a42a4b9364f07165f52": 100, // "5d6e6a42a4b9364f07165f52": 100,
"5d6e6a53a4b9361bd473feec": 100, // "5d6e6a53a4b9361bd473feec": 100,
"5d6e69b9a4b9361bc8618958": 60, // "5d6e69b9a4b9361bc8618958": 60,
"5d6e69c7a4b9360b6c0d54e4": 60, // "5d6e69c7a4b9360b6c0d54e4": 60,
"5d6e6a05a4b93618084f58d0": 100, // "5d6e6a05a4b93618084f58d0": 100,
"5d6e6a5fa4b93614ec501745": 100 // "5d6e6a5fa4b93614ec501745": 100
} // }
this.botConfig.equipment.assault = progressionWhitelistScav1; // this.botConfig.equipment.assault = progressionWhitelistScav1;
this.botConfig.equipment.assault.whitelist.push(progressionWhitelistScav2); // this.botConfig.equipment.assault.whitelist.push(progressionWhitelistScav2);
} // }
} // }

6
types/ErrorHandler.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
export declare class ErrorHandler {
private logger;
private readLine;
constructor();
handleCriticalError(err: any): void;
}

1
types/Program.d.ts vendored
View File

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

View File

@ -8,8 +8,29 @@ export declare class BotCallbacks {
protected botController: BotController; protected botController: BotController;
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
constructor(botController: BotController, httpResponse: HttpResponseUtil); constructor(botController: BotController, httpResponse: HttpResponseUtil);
/**
* Handle singleplayer/settings/bot/limit
* @returns string
*/
getBotLimit(url: string, info: IEmptyRequestData, sessionID: string): string; getBotLimit(url: string, info: IEmptyRequestData, sessionID: string): string;
/**
* Handle singleplayer/settings/bot/difficulty
* @returns string
*/
getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string;
/**
* Handle client/game/bot/generate
* @returns IGetBodyResponseData
*/
generateBots(url: string, info: IGenerateBotsRequestData, sessionID: string): IGetBodyResponseData<IBotBase[]>; generateBots(url: string, info: IGenerateBotsRequestData, sessionID: string): IGetBodyResponseData<IBotBase[]>;
/**
* Handle singleplayer/settings/bot/maxCap
* @returns string
*/
getBotCap(): string; getBotCap(): string;
/**
* Handle singleplayer/settings/bot/getBotBehaviours
* @returns string
*/
getBotBehaviours(): string;
} }

View File

@ -1,17 +1,17 @@
import { BundleLoader } from "../loaders/BundleLoader"; import { BundleLoader } from "../loaders/BundleLoader";
import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { IHttpServer } from "../models/spt/server/IHttpServer";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { HttpFileUtil } from "../utils/HttpFileUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class BundleCallbacks { export declare class BundleCallbacks {
protected logger: ILogger; protected logger: ILogger;
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected httpServer: IHttpServer; 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, httpServer: IHttpServer, bundleLoader: BundleLoader, configServer: ConfigServer); constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer);
sendBundle(sessionID: string, req: any, resp: any, body: any): any; sendBundle(sessionID: string, req: any, resp: any, body: any): any;
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;

View File

@ -3,6 +3,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { ISuit } from "../models/eft/common/tables/ITrader"; import { ISuit } from "../models/eft/common/tables/ITrader";
import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothingRequestData"; import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothingRequestData";
import { IGetSuitsResponse } from "../models/eft/customization/IGetSuitsResponse";
import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
@ -13,10 +14,15 @@ export declare class CustomizationCallbacks {
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);
getSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<{ /**
_id: string; * Handles client/trading/customization/storage
suites: string[]; * @returns
}>; */
getSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetSuitsResponse>;
/**
* Handles client/trading/customization
* @returns ISuit[]
*/
getTraderSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISuit[]>; getTraderSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISuit[]>;
wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;

View File

@ -1,32 +1,74 @@
import { HideoutController } from "../controllers/HideoutController";
import { RagfairController } from "../controllers/RagfairController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IGlobals } from "../models/eft/common/IGlobals"; import { IGlobals } from "../models/eft/common/IGlobals";
import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem";
import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase";
import { IQuest } from "../models/eft/common/tables/IQuest"; import { IQuest } from "../models/eft/common/tables/IQuest";
import { IGetItemPricesResponse } from "../models/eft/game/IGetItemPricesResponse";
import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea";
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase"; import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase";
import { IHideoutSettingsBase } from "../models/eft/hideout/IHideoutSettingsBase"; import { IHideoutSettingsBase } from "../models/eft/hideout/IHideoutSettingsBase";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { ILanguageBase } from "../models/spt/server/ILocaleBase";
import { ISettingsBase } from "../models/spt/server/ISettingsBase"; import { ISettingsBase } from "../models/spt/server/ISettingsBase";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
/**
* Handle client requests
*/
export declare class DataCallbacks { export declare class DataCallbacks {
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer); protected ragfairController: RagfairController;
protected hideoutController: HideoutController;
constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController);
/**
* Handles client/settings
* @returns ISettingsBase
*/
getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISettingsBase>; getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISettingsBase>;
/**
* Handles client/globals
* @returns IGlobals
*/
getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGlobals>; getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGlobals>;
/**
* Handles client/items
* @returns string
*/
getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string;
getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>; /**
* Handles client/handbook/templates
* @returns IHandbookBase
*/
getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHandbookBase>;
/**
* Handles client/customization
* @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
* @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[]>; getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IQuest[]>;
getHideoutSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutSettingsBase>; getHideoutSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutSettingsBase>;
getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutArea[]>; getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutArea[]>;
gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutProduction[]>; gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutProduction[]>;
getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutScavCase[]>; getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutScavCase[]>;
getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILanguageBase[]>; getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, string>>;
getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>; getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
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
* TODO - fully implement this
*/
getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetItemPricesResponse>;
} }

View File

@ -1,6 +1,7 @@
import { DialogueController } from "../controllers/DialogueController"; import { DialogueController } from "../controllers/DialogueController";
import { OnUpdate } from "../di/OnUpdate"; import { OnUpdate } from "../di/OnUpdate";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IChatServer } from "../models/eft/dialog/IChatServer";
import { IFriendRequestData } from "../models/eft/dialog/IFriendRequestData"; import { IFriendRequestData } from "../models/eft/dialog/IFriendRequestData";
import { IGetAllAttachmentsRequestData } from "../models/eft/dialog/IGetAllAttachmentsRequestData"; import { IGetAllAttachmentsRequestData } from "../models/eft/dialog/IGetAllAttachmentsRequestData";
import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse";
@ -20,26 +21,38 @@ import { DialogueInfo } from "../models/eft/profile/IAkiProfile";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class DialogueCallbacks extends OnUpdate { 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
* @returns IGetFriendListDataResponse
*/
getFriendList(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetFriendListDataResponse>; getFriendList(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetFriendListDataResponse>;
getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData<any[]>; /**
* Handles client/chatServer/list
* @returns
*/
getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData<IChatServer[]>;
getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo[]>; getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo[]>;
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<any>; getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo>;
removeDialog(url: string, info: IRemoveDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>; removeDialog(url: string, info: IRemoveDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
pinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>; pinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
unpinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>; unpinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
setRead(url: string, info: ISetDialogReadRequestData, sessionID: string): IGetBodyResponseData<any[]>; setRead(url: string, info: ISetDialogReadRequestData, sessionID: string): IGetBodyResponseData<any[]>;
/**
* Handles client/mail/dialog/getAllAttachments
* @returns IGetAllAttachmentsResponse
*/
getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData<IGetAllAttachmentsResponse>; getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData<IGetAllAttachmentsResponse>;
listOutbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>; listOutbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>;
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; friendRequest(url: string, request: IFriendRequestData, sessionID: string): INullResponseData;
sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData<number>; sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData<number>;
onUpdate(timeSinceLastRun: number): boolean; onUpdate(timeSinceLastRun: number): Promise<boolean>;
getRoute(): string; getRoute(): string;
} }

View File

@ -1,8 +1,13 @@
import { GameController } from "../controllers/GameController"; import { GameController } from "../controllers/GameController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData";
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
import { IGameLogoutResponseData } from "../models/eft/game/IGameLogoutResponseData";
import { IGameStartResponse } from "../models/eft/game/IGameStartResponse";
import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData"; import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData";
import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData"; import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
@ -13,13 +18,37 @@ declare class GameCallbacks {
protected watermark: Watermark; protected watermark: Watermark;
protected gameController: GameController; protected gameController: GameController;
constructor(httpResponse: HttpResponseUtil, watermark: Watermark, gameController: GameController); constructor(httpResponse: HttpResponseUtil, watermark: Watermark, gameController: GameController);
/**
* Handle client/game/version/validate
* @returns INullResponseData
*/
versionValidate(url: string, info: IVersionValidateRequestData, sessionID: string): INullResponseData; versionValidate(url: string, info: IVersionValidateRequestData, sessionID: string): INullResponseData;
gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>; /**
gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>; * Handle client/game/start
* @returns IGameStartResponse
*/
gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameStartResponse>;
/**
* Handle client/game/logout
* @returns IGameLogoutResponseData
*/
gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameLogoutResponseData>;
/**
* Handle client/game/config
* @returns IGameConfigResponse
*/
getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData<IGameConfigResponse>; getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData<IGameConfigResponse>;
getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>; getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IServerDetails[]>;
validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>; validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICheckVersionResponse>;
gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>; /**
* Handle client/game/keepalive
* @returns IGameKeepAliveResponse
*/
gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameKeepAliveResponse>;
/**
* Handle singleplayer/settings/version
* @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; reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData;
} }

View File

@ -1,8 +1,8 @@
import { HandbookController } from "../controllers/HandbookController"; import { HandbookController } from "../controllers/HandbookController";
import { OnLoad } from "../di/OnLoad"; import { OnLoad } from "../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(): void; onLoad(): Promise<void>;
getRoute(): string; getRoute(): string;
} }

View File

@ -7,6 +7,7 @@ import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealReques
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IWorkoutData } from "../models/eft/health/IWorkoutData";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class HealthCallbacks { export declare class HealthCallbacks {
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
@ -21,7 +22,27 @@ export declare class HealthCallbacks {
* @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>; syncHealth(url: string, info: ISyncHealthRequestData, sessionID: string): IGetBodyResponseData<string>;
/**
* Custom aki server request found in modules/QTEPatch.cs
* @param url
* @param info HealthListener.Instance.CurrentHealth class
* @param sessionID session id
* @returns empty response, no data sent back to client
*/
handleWorkoutEffects(url: string, info: IWorkoutData, sessionID: string): IGetBodyResponseData<string>;
/**
* Handle Eat
* @returns IItemEventRouterResponse
*/
offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle Heal
* @returns IItemEventRouterResponse
*/
offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle RestoreHealth
* @returns IItemEventRouterResponse
*/
healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse;
} }

View File

@ -1,7 +1,9 @@
import { HideoutController } from "../controllers/HideoutController"; import { HideoutController } from "../controllers/HideoutController";
import { OnUpdate } from "../di/OnUpdate"; import { OnUpdate } from "../di/OnUpdate";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData";
import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData";
import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData"; import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData";
import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData"; import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData";
import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData"; import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData";
@ -10,24 +12,64 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou
import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData"; import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData";
import { IHideoutUpgradeCompleteRequestData } from "../models/eft/hideout/IHideoutUpgradeCompleteRequestData"; import { IHideoutUpgradeCompleteRequestData } from "../models/eft/hideout/IHideoutUpgradeCompleteRequestData";
import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData"; import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData";
import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
export declare class HideoutCallbacks extends OnUpdate { 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
*/
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutUpgradeComplete
*/
upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutPutItemsInAreaSlots
*/
putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse; putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutTakeItemsFromAreaSlots
*/
takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse; takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutToggleArea
*/
toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutSingleProductionStart
*/
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse; singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutScavCaseProductionStart
*/
scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse; scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse;
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /**
* Handle HideoutContinuousProductionStart
*/
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutTakeProduction
*/
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
onUpdate(timeSinceLastRun: number): boolean; /**
* Handle HideoutQuickTimeEvent
*/
handleQTEEvent(pmcData: IPmcData, request: IHandleQTEEventRequestData, sessionId: string): IItemEventRouterResponse;
/**
* Handle client/game/profile/items/moving - RecordShootingRangePoints
*/
recordShootingRangePoints(pmcData: IPmcData, request: IRecordShootingRangePoints, sessionId: string): IItemEventRouterResponse;
/**
* Handle client/game/profile/items/moving - RecordShootingRangePoints
*/
improveArea(pmcData: IPmcData, request: IHideoutImproveAreaRequestData, sessionId: string): IItemEventRouterResponse;
onUpdate(timeSinceLastRun: number): Promise<boolean>;
getRoute(): string; getRoute(): string;
} }

View File

@ -1,9 +1,9 @@
import { OnLoad } from "../di/OnLoad"; import { OnLoad } from "../di/OnLoad";
import { IHttpServer } from "../models/spt/server/IHttpServer"; import { HttpServer } from "../servers/HttpServer";
export declare class HttpCallbacks extends OnLoad { export declare class HttpCallbacks implements OnLoad {
protected httpServer: IHttpServer; protected httpServer: HttpServer;
constructor(httpServer: IHttpServer); constructor(httpServer: HttpServer);
onLoad(): void; onLoad(): Promise<void>;
getRoute(): string; getRoute(): string;
getImage(): string; getImage(): string;
} }

View File

@ -1,23 +1,49 @@
import { InraidController } from "../controllers/InraidController"; import { InraidController } from "../controllers/InraidController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
/**
* Handle client requests
*/
export declare class InraidCallbacks { export declare class InraidCallbacks {
protected inraidController: InraidController; protected inraidController: InraidController;
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected configServer: ConfigServer; constructor(inraidController: InraidController, httpResponse: HttpResponseUtil);
protected airdropConfig: IAirdropConfig; /**
protected inraidConfig: IInRaidConfig; * Handle client/location/getLocalloot
constructor(inraidController: InraidController, httpResponse: HttpResponseUtil, configServer: ConfigServer); * @param url
* @param info register player request
* @param sessionID Session id
* @returns Null http response
*/
registerPlayer(url: string, info: IRegisterPlayerRequestData, sessionID: string): INullResponseData; registerPlayer(url: string, info: IRegisterPlayerRequestData, sessionID: string): INullResponseData;
/**
* Handle raid/profile/save
* @param url
* @param info Save progress request
* @param sessionID Session id
* @returns Null http response
*/
saveProgress(url: string, info: ISaveProgressRequestData, sessionID: string): INullResponseData; saveProgress(url: string, info: ISaveProgressRequestData, sessionID: string): INullResponseData;
/**
* Handle singleplayer/settings/raid/endstate
* @returns
*/
getRaidEndState(): string; getRaidEndState(): string;
getRaidMenuSettings(url: string, info: IEmptyRequestData, sessionID: string): string; /**
getWeaponDurability(url: string, info: any, sessionID: string): string; * Handle singleplayer/settings/raid/menu
getAirdropConfig(url: string, info: any, sessionID: string): string; * @returns JSON as string
*/
getRaidMenuSettings(): string;
/**
* Handle singleplayer/settings/weapon/durability
* @returns
*/
getWeaponDurability(): string;
/**
* Handle singleplayer/airdrop/config
* @returns JSON as string
*/
getAirdropConfig(): string;
} }

View File

@ -10,15 +10,23 @@ import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { InsuranceService } from "../services/InsuranceService"; import { InsuranceService } from "../services/InsuranceService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../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;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected insuranceConfig: IInsuranceConfig; protected insuranceConfig: IInsuranceConfig;
constructor(insuranceController: InsuranceController, insuranceService: InsuranceService, httpResponse: HttpResponseUtil, configServer: ConfigServer); constructor(insuranceController: InsuranceController, insuranceService: InsuranceService, httpResponse: HttpResponseUtil, configServer: ConfigServer);
/**
* Handle client/insurance/items/list/cost
* @returns IGetInsuranceCostResponseData
*/
getInsuranceCost(url: string, info: IGetInsuranceCostRequestData, sessionID: string): IGetBodyResponseData<IGetInsuranceCostResponseData>; getInsuranceCost(url: string, info: IGetInsuranceCostRequestData, sessionID: string): IGetBodyResponseData<IGetInsuranceCostResponseData>;
/**
* Handle Insure
* @returns IItemEventRouterResponse
*/
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
onUpdate(secondsSinceLastRun: number): boolean; onUpdate(secondsSinceLastRun: number): Promise<boolean>;
getRoute(): string; getRoute(): string;
} }

View File

@ -16,6 +16,7 @@ import { IInventorySwapRequestData } from "../models/eft/inventory/IInventorySwa
import { IInventoryTagRequestData } from "../models/eft/inventory/IInventoryTagRequestData"; import { IInventoryTagRequestData } from "../models/eft/inventory/IInventoryTagRequestData";
import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryToggleRequestData";
import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData";
import { IOpenRandomLootContainerRequestData } from "../models/eft/inventory/IOpenRandomLootContainerRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
export declare class InventoryCallbacks { export declare class InventoryCallbacks {
protected inventoryController: InventoryController; protected inventoryController: InventoryController;
@ -36,4 +37,5 @@ export declare class InventoryCallbacks {
createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse; createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse;
deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse; deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse;
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
} }

View File

@ -1,4 +1,5 @@
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { Warning } from "../models/eft/itemEvent/IItemEventRouterBase";
import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest"; import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ItemEventRouter } from "../routers/ItemEventRouter";
@ -8,4 +9,5 @@ export declare class ItemEventCallbacks {
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): IGetBodyResponseData<IItemEventRouterResponse>;
protected getErrorCode(warnings: Warning[]): number;
} }

View File

@ -7,10 +7,10 @@ import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequest
import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData";
import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData";
import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData";
import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData";
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData";
import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData";
import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
@ -34,9 +34,13 @@ export declare class MatchCallbacks {
serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any> | IGetBodyResponseData<true>; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any> | IGetBodyResponseData<true>;
joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData<IJoinMatchResult[]>; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData<IJoinMatchResult[]>;
getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<string>; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<string>;
/**
* Handle client/match/group/status
* @returns
*/
getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<any>; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<any>;
createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData<any>; createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData<any>;
deleteGroup(url: string, info: any, sessionID: string): INullResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData;
startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData;
endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData;
getRaidConfiguration(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData;
} }

View File

@ -1,22 +1,21 @@
import { OnLoad } from "../di/OnLoad"; import { OnLoad } from "../di/OnLoad";
import { PostAkiModLoader } from "../loaders/PostAkiModLoader"; import { PostAkiModLoader } from "../loaders/PostAkiModLoader";
import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { IHttpServer } from "../models/spt/server/IHttpServer";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { LocalisationService } from "../services/LocalisationService";
import { HttpFileUtil } from "../utils/HttpFileUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
declare class ModCallbacks extends OnLoad { declare class ModCallbacks implements OnLoad {
protected logger: ILogger; protected logger: ILogger;
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected httpServer: IHttpServer; protected httpFileUtil: HttpFileUtil;
protected postAkiModLoader: PostAkiModLoader; protected postAkiModLoader: PostAkiModLoader;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected httpConfig: IHttpConfig; protected httpConfig: IHttpConfig;
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpServer: IHttpServer, postAkiModLoader: PostAkiModLoader, configServer: ConfigServer); constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, localisationService: LocalisationService, configServer: ConfigServer);
onLoad(): 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 }; export { ModCallbacks };

View File

@ -4,6 +4,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { INotifierChannel } from "../models/eft/notifier/INotifier";
import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData";
import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class NotifierCallbacks { export declare class NotifierCallbacks {
protected httpServerHelper: HttpServerHelper; protected httpServerHelper: HttpServerHelper;
@ -19,6 +20,10 @@ export declare class NotifierCallbacks {
sendNotification(sessionID: string, req: any, resp: any, data: any): void; sendNotification(sessionID: string, req: any, resp: any, data: any): void;
getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData<any[]>; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData<any[]>;
createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<INotifierChannel>; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<INotifierChannel>;
selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData<any>; /**
* Handle client/game/profile/select
* @returns ISelectProfileResponse
*/
selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData<ISelectProfileResponse>;
notify(url: string, info: any, sessionID: string): string; notify(url: string, info: any, sessionID: string): string;
} }

View File

@ -1,8 +1,8 @@
import { PresetController } from "../controllers/PresetController"; import { PresetController } from "../controllers/PresetController";
import { OnLoad } from "../di/OnLoad"; import { OnLoad } from "../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(): void; onLoad(): Promise<void>;
getRoute(): string; getRoute(): string;
} }

View File

@ -21,6 +21,13 @@ export declare class QuestCallbacks {
acceptQuest(pmcData: IPmcData, body: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; acceptQuest(pmcData: IPmcData, body: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle client/quest/list
* @param url
* @param info
* @param sessionID
* @returns
*/
listQuests(url: string, info: IListQuestsRequestData, sessionID: string): IGetBodyResponseData<IQuest[]>; listQuests(url: string, info: IListQuestsRequestData, sessionID: string): IGetBodyResponseData<IQuest[]>;
activityPeriods(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcDataRepeatableQuest[]>; activityPeriods(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcDataRepeatableQuest[]>;
} }

View File

@ -1,5 +1,6 @@
import { OnLoad } from "../di/OnLoad";
import { OnUpdate } from "../di/OnUpdate";
import { RagfairController } from "../controllers/RagfairController"; import { RagfairController } from "../controllers/RagfairController";
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
@ -14,7 +15,6 @@ import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferReque
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer"; import { RagfairServer } from "../servers/RagfairServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
@ -22,23 +22,26 @@ import { JsonUtil } from "../utils/JsonUtil";
/** /**
* 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 logger: ILogger;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected ragfairServer: RagfairServer; protected ragfairServer: RagfairServer;
protected ragfairController: RagfairController; protected ragfairController: RagfairController;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
constructor(httpResponse: HttpResponseUtil, logger: ILogger, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer); constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer);
onLoad(): void; onLoad(): Promise<void>;
getRoute(): string; getRoute(): string;
search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData<IGetOffersResult>; search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData<IGetOffersResult>;
getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData<IGetItemPriceResult>; getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData<IGetItemPriceResult>;
getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>;
addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse; addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse;
extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
onUpdate(timeSinceLastRun: number): boolean; /**
* Handle /client/items/prices
* Called when clicking an item to list on flea
*/
getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>>;
onUpdate(timeSinceLastRun: number): Promise<boolean>;
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
} }

View File

@ -6,6 +6,20 @@ import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepa
export declare class RepairCallbacks { export declare class RepairCallbacks {
protected repairController: RepairController; protected repairController: RepairController;
constructor(repairController: RepairController); constructor(repairController: RepairController);
/**
* use trader to repair item
* @param pmcData
* @param body
* @param sessionID
* @returns
*/
traderRepair(pmcData: IPmcData, body: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse; traderRepair(pmcData: IPmcData, body: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
/**
* Use repair kit to repair item
* @param pmcData
* @param body
* @param sessionID
* @returns
*/
repair(pmcData: IPmcData, body: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse; repair(pmcData: IPmcData, body: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
} }

View File

@ -1,9 +1,10 @@
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate"; import { OnLoad } from "../di/OnLoad";
import { OnUpdate } from "../di/OnUpdate";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
export declare class SaveCallbacks extends OnLoadOnUpdate { export declare class SaveCallbacks implements OnLoad, OnUpdate {
protected saveServer: SaveServer; protected saveServer: SaveServer;
constructor(saveServer: SaveServer); constructor(saveServer: SaveServer);
onLoad(): void; onLoad(): Promise<void>;
getRoute(): string; getRoute(): string;
onUpdate(secondsSinceLastRun: number): boolean; onUpdate(secondsSinceLastRun: number): Promise<boolean>;
} }

View File

@ -6,6 +6,9 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag
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
*/
processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse;
processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
} }

View File

@ -1,17 +1,22 @@
import { OnLoad } from "../di/OnLoad";
import { OnUpdate } from "../di/OnUpdate";
import { TraderController } from "../controllers/TraderController"; import { TraderController } from "../controllers/TraderController";
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class TraderCallbacks extends OnLoadOnUpdate { export declare class TraderCallbacks implements OnLoad, OnUpdate {
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected traderController: TraderController; protected traderController: TraderController;
constructor(httpResponse: HttpResponseUtil, traderController: TraderController); constructor(httpResponse: HttpResponseUtil, traderController: TraderController);
onLoad(): void; onLoad(): Promise<void>;
onUpdate(): boolean; onUpdate(): Promise<boolean>;
getRoute(): string; getRoute(): string;
getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]>; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]>;
/**
* Handle client/trading/api/getUserAssortPrice/trader
* @returns
*/
getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, IBarterScheme[][]>>; 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>;
getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>;

View File

@ -1,10 +1,15 @@
import { WeatherController } from "../controllers/WeatherController"; import { WeatherController } from "../controllers/WeatherController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { IWeatherData } from "../models/eft/weather/IWeatherData";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class WeatherCallbacks { export declare class WeatherCallbacks {
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected weatherController: WeatherController; protected weatherController: WeatherController;
constructor(httpResponse: HttpResponseUtil, weatherController: WeatherController); constructor(httpResponse: HttpResponseUtil, weatherController: WeatherController);
getWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>; /**
* Handle client/weather
* @returns IWeatherData
*/
getWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IWeatherData>;
} }

View File

@ -3,6 +3,15 @@ import { ContextVariableType } from "./ContextVariableType";
export declare class ApplicationContext { export declare class ApplicationContext {
private variables; private variables;
private static holderMaxSize; private static holderMaxSize;
/**
* Called like:
*
* const registerPlayerInfo = this.applicationContext.getLatestValue(ContextVariableType.REGISTER_PLAYER_REQUEST).getValue<IRegisterPlayerRequestData>();
*
* const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.MATCH_INFO).getValue<IStartOfflineRaidRequestData>();
* @param type
* @returns
*/
getLatestValue(type: ContextVariableType): ContextVariable; getLatestValue(type: ContextVariableType): ContextVariable;
getValues(type: ContextVariableType): ContextVariable[]; getValues(type: ContextVariableType): ContextVariable[];
addValue(type: ContextVariableType, value: any): void; addValue(type: ContextVariableType, value: any): void;

View File

@ -4,7 +4,7 @@ export declare class ContextVariable {
private timestamp; private timestamp;
private type; private type;
constructor(value: any, type: ContextVariableType); constructor(value: any, type: ContextVariableType);
getValue(): any; getValue<T>(): T;
getTimestamp(): Date; getTimestamp(): Date;
getType(): ContextVariableType; getType(): ContextVariableType;
} }

View File

@ -1,4 +1,10 @@
export declare enum ContextVariableType { export declare enum ContextVariableType {
/** Logged in users session id */
SESSION_ID = 0, SESSION_ID = 0,
MATCH_INFO = 1 /** Currently acive raid information */
RAID_CONFIGURATION = 1,
/** Timestamp when client first connected */
CLIENT_START_TIMESTAMP = 2,
/** When player is loading into map and loot is requested */
REGISTER_PLAYER_REQUEST = 3
} }

View File

@ -1,25 +1,44 @@
import { ApplicationContext } from "../context/ApplicationContext";
import { BotGenerator } from "../generators/BotGenerator"; import { BotGenerator } from "../generators/BotGenerator";
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
import { BotHelper } from "../helpers/BotHelper"; import { BotHelper } from "../helpers/BotHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData"; import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData";
import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotBase } from "../models/eft/common/tables/IBotBase";
import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { IBotCore } from "../models/eft/common/tables/IBotCore";
import { Difficulty } from "../models/eft/common/tables/IBotType"; import { Difficulty } from "../models/eft/common/tables/IBotType";
import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
import { LocalisationService } from "../services/LocalisationService";
import { JsonUtil } from "../utils/JsonUtil";
export declare class BotController { export declare class BotController {
protected logger: ILogger;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected botGenerator: BotGenerator; protected botGenerator: BotGenerator;
protected botHelper: BotHelper; protected botHelper: BotHelper;
protected botDifficultyHelper: BotDifficultyHelper;
protected botGenerationCacheService: BotGenerationCacheService;
protected localisationService: LocalisationService;
protected profileHelper: ProfileHelper;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected applicationContext: ApplicationContext;
protected jsonUtil: JsonUtil;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, configServer: ConfigServer); static readonly pmcTypeLabel = "PMC";
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
/** /**
* Return the number of bot loadout varieties to be generated * Return the number of bot loadout varieties to be generated
* @param type bot Type we want the loadout gen count for * @param type bot Type we want the loadout gen count for
* @returns * @returns number of bots to generate
*/ */
getBotPresetGenerationLimit(type: string): number; getBotPresetGenerationLimit(type: string): number;
/**
* Get the core.json difficulty settings from database\bots
* @returns IBotCore
*/
getBotCoreDifficulty(): IBotCore; getBotCoreDifficulty(): IBotCore;
/** /**
* Get bot difficulty settings * Get bot difficulty settings
@ -29,7 +48,24 @@ export declare class BotController {
* @returns Difficulty object * @returns Difficulty object
*/ */
getBotDifficulty(type: string, difficulty: string): Difficulty; getBotDifficulty(type: string, difficulty: string): Difficulty;
protected getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string): Difficulty; /**
* Generate bot profiles and store in cache
* @param sessionId Session id
* @param info bot generation request info
* @returns IBotBase array
*/
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[]; generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
/**
* Get the difficulty passed in, if its not "asoline", get selected difficulty from config
* @param requestedDifficulty
* @returns
*/
getPMCDifficulty(requestedDifficulty: string): string;
/**
* Get the max number of bots allowed on a map
* Looks up location player is entering when getting cap value
* @returns cap number
*/
getBotCap(): number; getBotCap(): number;
getPmcBotTypes(): Record<string, Record<string, Record<string, number>>>;
} }

View File

@ -5,16 +5,18 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin
import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData"; import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { EventOutputHolder } from "../routers/EventOutputHolder";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { LocalisationService } from "../services/LocalisationService";
export declare class CustomizationController { export declare class CustomizationController {
protected logger: ILogger; protected logger: ILogger;
protected itemEventRouter: ItemEventRouter; protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected localisationService: LocalisationService;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper); constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper);
getTraderSuits(traderID: string, sessionID: string): ISuit[]; getTraderSuits(traderID: string, sessionID: string): ISuit[];
wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse; wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse; buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;

View File

@ -2,24 +2,78 @@ import { DialogueHelper } from "../helpers/DialogueHelper";
import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse";
import { IGetFriendListDataResponse } from "../models/eft/dialog/IGetFriendListDataResponse"; import { IGetFriendListDataResponse } from "../models/eft/dialog/IGetFriendListDataResponse";
import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDialogViewResponseData"; import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDialogViewResponseData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { DialogueInfo, Message } from "../models/eft/profile/IAkiProfile"; import { DialogueInfo, Message } from "../models/eft/profile/IAkiProfile";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class DialogueController { export declare class DialogueController {
protected httpResponse: HttpResponseUtil;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected timeUtil: TimeUtil;
protected dialogueHelper: DialogueHelper; protected dialogueHelper: DialogueHelper;
constructor(httpResponse: HttpResponseUtil, saveServer: SaveServer, dialogueHelper: DialogueHelper); constructor(saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper);
update(): void;
getFriendList(sessionID: string): IGetFriendListDataResponse; getFriendList(sessionID: string): IGetFriendListDataResponse;
generateDialogueList(sessionID: string): IGetBodyResponseData<DialogueInfo[]>; /**
* Create array holding trader dialogs and mail interactions with player
* Set the content of the dialogue on the list tab.
* @param sessionID Session Id
* @returns array of dialogs
*/
generateDialogueList(sessionID: string): DialogueInfo[];
/**
* Get the content of a dialogue
* @param dialogueID Dialog id
* @param sessionID Session Id
* @returns DialogueInfo
*/
getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo; getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo;
/**
* Handle player clicking 'messenger' and seeing all the messages they've recieved
* Set the content of the dialogue on the details panel, showing all the messages
* for the specified dialogue.
* @param dialogueID Dialog id
* @param sessionID Session id
* @returns IGetMailDialogViewResponseData object
*/
generateDialogueView(dialogueID: string, sessionID: string): IGetMailDialogViewResponseData; generateDialogueView(dialogueID: string, sessionID: string): IGetMailDialogViewResponseData;
/**
* Get a count of messages with attachments from a particular dialog
* @param sessionID Session id
* @param dialogueID Dialog id
* @returns Count of messages with attachments
*/
protected getUnreadMessagesWithAttachmentsCount(sessionID: string, dialogueID: string): number;
/**
* Does array have messages with uncollected rewards (includes expired rewards)
* @param messages Messages to check
* @returns true if uncollected rewards found
*/
protected messagesHaveUncollectedRewards(messages: Message[]): boolean;
removeDialogue(dialogueID: string, sessionID: string): void; removeDialogue(dialogueID: string, sessionID: string): void;
setDialoguePin(dialogueID: string, shouldPin: boolean, sessionID: string): void; setDialoguePin(dialogueID: string, shouldPin: boolean, sessionID: string): void;
setRead(dialogueIDs: string[], sessionID: string): void; setRead(dialogueIDs: string[], sessionID: string): void;
/**
* Get all uncollected items attached to mail in a particular dialog
* @param dialogueID Dialog to get mail attachments from
* @param sessionID Session id
* @returns
*/
getAllAttachments(dialogueID: string, sessionID: string): IGetAllAttachmentsResponse; getAllAttachments(dialogueID: string, sessionID: string): IGetAllAttachmentsResponse;
protected messagesHaveUncollectedRewards(messages: Message[]): boolean; /**
* Get messages from a specific dialog that have items not expired
* @param sessionId Session id
* @param dialogueId Dialog to get mail attachments from
* @returns Message array
*/
protected getActiveMessagesFromDialog(sessionId: string, dialogueId: string): Message[];
/**
* Return array of messages with uncollected items (includes expired)
* @param messages Messages to parse
* @returns messages with items to collect
*/
protected getMessagesWithAttachments(messages: Message[]): Message[];
/**
* Delete expired items. triggers when updating traders.
* @param sessionID Session id
*/
protected removeExpiredItems(sessionID: string): void; protected removeExpiredItems(sessionID: string): void;
update(): void;
} }

View File

@ -1,29 +1,80 @@
import { ApplicationContext } from "../context/ApplicationContext";
import { HideoutHelper } from "../helpers/HideoutHelper";
import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { HttpServerHelper } from "../helpers/HttpServerHelper";
import { ProfileHelper } from "../helpers/ProfileHelper"; import { ProfileHelper } from "../helpers/ProfileHelper";
import { PreAkiModLoader } from "../loaders/PreAkiModLoader";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IPmcData } from "../models/eft/common/IPmcData";
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { LocaleService } from "../services/LocaleService"; import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomLocationWaveService } from "../services/CustomLocationWaveService";
import { LocalisationService } from "../services/LocalisationService";
import { OpenZoneService } from "../services/OpenZoneService";
import { ProfileFixerService } from "../services/ProfileFixerService"; import { ProfileFixerService } from "../services/ProfileFixerService";
import { Watermark } from "../utils/Watermark"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { TimeUtil } from "../utils/TimeUtil";
export declare class GameController { export declare class GameController {
protected logger: ILogger; protected logger: ILogger;
protected watermark: Watermark; protected databaseServer: DatabaseServer;
protected timeUtil: TimeUtil;
protected preAkiModLoader: PreAkiModLoader;
protected httpServerHelper: HttpServerHelper; protected httpServerHelper: HttpServerHelper;
protected localeService: LocaleService; protected hideoutHelper: HideoutHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected profileFixerService: ProfileFixerService; protected profileFixerService: ProfileFixerService;
protected localisationService: LocalisationService;
protected customLocationWaveService: CustomLocationWaveService;
protected openZoneService: OpenZoneService;
protected seasonalEventService: SeasonalEventService;
protected applicationContext: ApplicationContext;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected httpConfig: IHttpConfig; protected httpConfig: IHttpConfig;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
constructor(logger: ILogger, watermark: Watermark, httpServerHelper: HttpServerHelper, localeService: LocaleService, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, configServer: ConfigServer); protected locationConfig: ILocationConfig;
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string): void; constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer);
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
/**
* When player logs in, iterate over all active effects and reduce timer
* TODO - add body part HP regen
* @param pmcProfile
*/
protected updateProfileHealthValues(pmcProfile: IPmcData): void;
/**
* Waves with an identical min/max values spawn nothing, the number of bots that spawn is the difference between min and max
*/
protected fixBrokenOfflineMapWaves(): void;
/**
* Make Rogues spawn later to allow for scavs to spawn first instead of rogues filling up all spawn positions
*/
protected fixRoguesSpawningInstantlyOnLighthouse(): void;
/**
* Get a list of installed mods and save their details to the profile being used
* @param fullProfile Profile to add mod details to
*/
protected saveActiveModsToProfile(fullProfile: IAkiProfile): void;
/**
* Add the logged in players name to PMC name pool
* @param pmcProfile
*/
protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
/**
* Blank out the "test" mail message from prapor
*/
protected removePraporTestMessage(): void;
/**
* Make non-trigger-spawned raiders spawn earlier + always
*/
protected adjustLabsRaiderSpawnRate(): void;
protected logProfileDetails(fullProfile: IAkiProfile): void; protected logProfileDetails(fullProfile: IAkiProfile): void;
getGameConfig(sessionID: string): IGameConfigResponse; getGameConfig(sessionID: string): IGameConfigResponse;
getServer(): any[]; getServer(): IServerDetails[];
getValidGameVersion(): any; getValidGameVersion(): ICheckVersionResponse;
} }

View File

@ -1,23 +1,28 @@
import { ItemHelper } from "../helpers/ItemHelper";
import { PaymentService } from "../services/PaymentService";
import { InventoryHelper } from "../helpers/InventoryHelper";
import { HealthHelper } from "../helpers/HealthHelper"; import { HealthHelper } from "../helpers/HealthHelper";
import { InventoryHelper } from "../helpers/InventoryHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData"; import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData";
import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData"; import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData";
import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData";
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
import { IWorkoutData } from "../models/eft/health/IWorkoutData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { LocalisationService } from "../services/LocalisationService";
import { PaymentService } from "../services/PaymentService";
import { JsonUtil } from "../utils/JsonUtil";
export declare class HealthController { export declare class HealthController {
protected logger: ILogger; protected logger: ILogger;
protected itemEventRouter: ItemEventRouter; protected jsonUtil: JsonUtil;
protected eventOutputHolder: EventOutputHolder;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected paymentService: PaymentService; protected paymentService: PaymentService;
protected inventoryHelper: InventoryHelper; protected inventoryHelper: InventoryHelper;
protected localisationService: LocalisationService;
protected healthHelper: HealthHelper; protected healthHelper: HealthHelper;
constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); constructor(logger: ILogger, jsonUtil: JsonUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, healthHelper: HealthHelper);
/** /**
* stores in-raid player health * stores in-raid player health
* @param pmcData Player profile * @param pmcData Player profile
@ -25,7 +30,7 @@ export declare class HealthController {
* @param sessionID * @param sessionID
* @param addEffects Should effects found be added or removed from profile * @param addEffects Should effects found be added or removed from profile
*/ */
saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
/** /**
* When healing in menu * When healing in menu
* @param pmcData * @param pmcData
@ -34,13 +39,35 @@ export declare class HealthController {
* @returns * @returns
*/ */
offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Consume food/water outside of a raid
* @param pmcData Player profile
* @param body request Object
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Occurs on post-raid healing page * Occurs on post-raid healing page
* @param pmcData player profile * @param pmcData player profile
* @param info Request data from client * @param healthTreatmentRequest Request data from client
* @param sessionID Session id * @param sessionID Session id
* @returns * @returns
*/ */
healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse;
/**
* applies skills from hideout workout.
* @param pmcData Player profile
* @param info Request data
* @param sessionID
*/
applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void;
/**
* Iterate over treatment request diff and find effects to remove from player limbs
* @param sessionId
* @param profile Profile to update
* @param treatmentRequest client request
* @param output response to send to client
*/
protected removeEffectsAfterPostRaidHeal(sessionId: string, profile: IPmcData, treatmentRequest: IHealthTreatmentRequestData, output: IItemEventRouterResponse): void;
} }

View File

@ -7,7 +7,9 @@ import { ProfileHelper } from "../helpers/ProfileHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase";
import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData";
import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData";
import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData";
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData"; import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData";
import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData"; import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData";
@ -16,19 +18,23 @@ import { IHideoutTakeItemOutRequestData } from "../models/eft/hideout/IHideoutTa
import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData"; import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData";
import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData"; import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData";
import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData"; import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData";
import { IQteData } from "../models/eft/hideout/IQteData";
import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { FenceService } from "../services/FenceService";
import { LocalisationService } from "../services/LocalisationService";
import { PlayerService } from "../services/PlayerService"; import { PlayerService } from "../services/PlayerService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
import { JsonUtil } from "../utils/JsonUtil";
export declare class HideoutController { export declare class HideoutController {
protected logger: ILogger; protected logger: ILogger;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
@ -40,19 +46,36 @@ export declare class HideoutController {
protected playerService: PlayerService; protected playerService: PlayerService;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected paymentHelper: PaymentHelper; protected paymentHelper: PaymentHelper;
protected itemEventRouter: ItemEventRouter; protected eventOutputHolder: EventOutputHolder;
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected scavCaseRewardGenerator: ScavCaseRewardGenerator;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected fenceService: FenceService;
protected static nameBackendCountersCrafting: string; protected static nameBackendCountersCrafting: 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, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil); constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService);
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Start a hideout area upgrade
* @param pmcData Player profile
* @param request upgrade start request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
startUpgrade(pmcData: IPmcData, request: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Complete a hideout area upgrade
* @param pmcData Player profile
* @param request Completed upgrade request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutPutItemsInAreaSlots
* Create item in hideout slot item array, remove item from player inventory * 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
@ -60,7 +83,14 @@ 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; /**
* 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
@ -71,7 +101,21 @@ export declare class HideoutController {
* @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: HideoutArea): IItemEventRouterResponse;
toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; /**
* Toggle area on/off
* @param pmcData Player profile
* @param request Toggle area request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
toggleArea(pmcData: IPmcData, request: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Start production for an item from hideout area
* @param pmcData Player profile
* @param body Start prodution of single item request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse; singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Handles event after clicking 'start' on the scav case hideout page * Handles event after clicking 'start' on the scav case hideout page
@ -81,24 +125,96 @@ 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 recipieId recipie id to save into Production dict
*/ */
protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[]): void; protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[], recipieId: string): void;
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /**
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; * Start production of continuously created item
protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; * @param pmcData Player profile
* @param request Continious production request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
continuousProductionStart(pmcData: IPmcData, request: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Take completed item out of hideout area and place into player inventory
* @param pmcData Player profile
* @param request Remove production from area request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
takeProduction(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Take recipie-type production out of hideout area and place into player inventory
* @param sessionID Session id
* @param recipe Completed recipie of item
* @param pmcData Player profile
* @param request Remove production from area request
* @param output Output object to update
* @returns IItemEventRouterResponse
*/
protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** /**
* Handles giving rewards stored in player profile to player after clicking 'get rewards' * Handles giving rewards stored in player profile to player after clicking 'get rewards'
* @param sessionID * @param sessionID Session id
* @param pmcData * @param pmcData Player profile
* @param body * @param request Get rewards from scavcase craft request
* @param output * @param output Output object to update
* @returns * @returns IItemEventRouterResponse
*/
protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
/**
* Start area production for item
* @param pmcData Player profile
* @param request Start production request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
registerProduction(pmcData: IPmcData, request: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Get quick time event list for hideout
* // TODO - implement this
* @param sessionId Session id
* @returns IQteData array
*/
getQteList(sessionId: string): IQteData[];
/**
* Handle HideoutQuickTimeEvent on client/game/profile/items/moving
* Called after completing workout at gym
* @param sessionId Session id
* @param pmcData Profile to adjust
* @param request QTE result object
*/
handleQTEEventOutcome(sessionId: string, pmcData: IPmcData, request: IHandleQTEEventRequestData): IItemEventRouterResponse;
/**
* Record a high score from the shooting range into a player profiles overallcounters
* @param sessionId Session id
* @param pmcData Profile to update
* @param request shooting range score request
* @returns IItemEventRouterResponse
*/
recordShootingRangePoints(sessionId: string, pmcData: IPmcData, request: IRecordShootingRangePoints): IItemEventRouterResponse;
/**
* Handle client/game/profile/items/moving - HideoutImproveArea
* @param sessionId Session id
* @param pmcData profile to improve area in
* @param request improve area request data
*/
improveArea(sessionId: string, pmcData: IPmcData, request: IHideoutImproveAreaRequestData): IItemEventRouterResponse;
/**
* Function called every x seconds as part of onUpdate event
*/ */
protected handleScavCase(sessionID: string, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
update(): void; update(): void;
} }

View File

@ -1,3 +1,4 @@
import { ApplicationContext } from "../context/ApplicationContext";
import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; import { PlayerScavGenerator } from "../generators/PlayerScavGenerator";
import { HealthHelper } from "../helpers/HealthHelper"; import { HealthHelper } from "../helpers/HealthHelper";
import { InRaidHelper } from "../helpers/InRaidHelper"; import { InRaidHelper } from "../helpers/InRaidHelper";
@ -6,8 +7,10 @@ import { ProfileHelper } from "../helpers/ProfileHelper";
import { QuestHelper } from "../helpers/QuestHelper"; import { QuestHelper } from "../helpers/QuestHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
@ -16,6 +19,9 @@ import { SaveServer } from "../servers/SaveServer";
import { InsuranceService } from "../services/InsuranceService"; import { InsuranceService } from "../services/InsuranceService";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
/**
* 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;
@ -30,17 +36,47 @@ export declare class InraidController {
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected insuranceService: InsuranceService; protected insuranceService: InsuranceService;
protected inRaidHelper: InRaidHelper; protected inRaidHelper: InRaidHelper;
protected applicationContext: ApplicationContext;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected airdropConfig: IAirdropConfig;
protected inraidConfig: IInRaidConfig; protected inraidConfig: IInRaidConfig;
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer);
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
saveProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
/** /**
* Handle updating the profile post-pmc raid * Save locationId to active profiles inraid object AND app context
* @param sessionID Session id
* @param info Register player request
*/
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
/**
* Save profile state to disk
* Handles pmc/pscav
* @param offraidData post-raid request data
* @param sessionID Session id
*/
savePostRaidProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
/**
* Handle updating player profile post-pmc raid
* @param sessionID session id * @param sessionID session id
* @param offraidData post-raid data of raid * @param offraidData post-raid data
*/ */
protected savePmcProgress(sessionID: string, offraidData: ISaveProgressRequestData): void; 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 * Reduce body part hp to % of max
* @param pmcData profile to edit * @param pmcData profile to edit
@ -66,6 +102,31 @@ export declare class InraidController {
* @param isPlayerScav Was the player a pScav * @param isPlayerScav Was the player a pScav
*/ */
protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; 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; 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; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void;
/**
* Get the inraid config from configs/inraid.json
* @returns InRaid Config
*/
getInraidConfig(): IInRaidConfig;
/**
* Get airdrop config from configs/airdrop.json
* @returns Airdrop config
*/
getAirdropConfig(): IAirdropConfig;
} }

View File

@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig"; import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil";
export declare class InsuranceController { export declare class InsuranceController {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected itemEventRouter: ItemEventRouter; protected eventOutputHolder: EventOutputHolder;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
@ -30,15 +30,24 @@ export declare class InsuranceController {
protected insuranceService: InsuranceService; protected insuranceService: InsuranceService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected insuranceConfig: IInsuranceConfig; protected insuranceConfig: IInsuranceConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required 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);
insuranceService: InsuranceService, configServer: ConfigServer); /**
* Process insurance items prior to being given to player in mail
*/
processReturn(): void; processReturn(): void;
/**
* Add insurance to an item
* @param pmcData Player profile
* @param body Insurance request
* @param sessionID Session id
* @returns IItemEventRouterResponse object to send to client
*/
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Calculate insurance cost * Calculate insurance cost
* @param info request object * @param info request object
* @param sessionID session id * @param sessionID session id
* @returns response object to send to client * @returns IGetInsuranceCostResponseData object to send to client
*/ */
cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData;
} }

View File

@ -2,6 +2,7 @@ import { InventoryHelper } from "../helpers/InventoryHelper";
import { PaymentHelper } from "../helpers/PaymentHelper"; import { PaymentHelper } from "../helpers/PaymentHelper";
import { PresetHelper } from "../helpers/PresetHelper"; import { PresetHelper } from "../helpers/PresetHelper";
import { ProfileHelper } from "../helpers/ProfileHelper"; import { ProfileHelper } from "../helpers/ProfileHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData"; import { IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData";
import { IInventoryBindRequestData } from "../models/eft/inventory/IInventoryBindRequestData"; import { IInventoryBindRequestData } from "../models/eft/inventory/IInventoryBindRequestData";
@ -20,34 +21,46 @@ import { IInventorySwapRequestData } from "../models/eft/inventory/IInventorySwa
import { IInventoryTagRequestData } from "../models/eft/inventory/IInventoryTagRequestData"; import { IInventoryTagRequestData } from "../models/eft/inventory/IInventoryTagRequestData";
import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryToggleRequestData";
import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData"; import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData";
import { IOpenRandomLootContainerRequestData } from "../models/eft/inventory/IOpenRandomLootContainerRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { EventOutputHolder } from "../routers/EventOutputHolder";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { FenceService } from "../services/FenceService"; import { FenceService } from "../services/FenceService";
import { LocalisationService } from "../services/LocalisationService";
import { RagfairOfferService } from "../services/RagfairOfferService"; import { RagfairOfferService } from "../services/RagfairOfferService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
export declare class InventoryController { export declare class InventoryController {
protected logger: ILogger; protected logger: ILogger;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected fenceService: FenceService; protected fenceService: FenceService;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected inventoryHelper: InventoryHelper; protected inventoryHelper: InventoryHelper;
protected ragfairOfferService: RagfairOfferService; protected ragfairOfferService: RagfairOfferService;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected weightedRandomHelper: WeightedRandomHelper;
protected paymentHelper: PaymentHelper; protected paymentHelper: PaymentHelper;
protected itemEventRouter: ItemEventRouter; protected localisationService: LocalisationService;
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter); protected eventOutputHolder: EventOutputHolder;
protected httpResponseUtil: HttpResponseUtil;
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, weightedRandomHelper: WeightedRandomHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
/** /**
* Move Item * Move Item
* change location of item with parentId and slotId * change location of item with parentId and slotId
* transfers items from one profile to another if fromOwner/toOwner is set in the body. * transfers items from one profile to another if fromOwner/toOwner is set in the body.
* otherwise, move is contained within the same profile_f. * otherwise, move is contained within the same profile_f.
*/ * @param pmcData Profile
moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; * @param moveRequest Move request data
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
moveItem(pmcData: IPmcData, moveRequest: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Remove Item from Profile * Remove Item from Profile
* Deep tree item deletion, also removes items from insurance list * Deep tree item deletion, also removes items from insurance list
@ -116,10 +129,23 @@ export declare class InventoryController {
protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; protected getExaminedItemTpl(body: 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.
* @param pmcData Player profile
* @param request sort request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/ */
sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse; sortInventory(pmcData: IPmcData, request: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse;
createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse; createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse;
deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse; deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse;
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle 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
* @returns IItemEventRouterResponse
*/
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
} }

View File

@ -7,6 +7,7 @@ import { LootItem } from "../models/spt/services/LootItem";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
@ -15,12 +16,13 @@ export declare class LocationController {
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected logger: ILogger; protected logger: ILogger;
protected locationGenerator: LocationGenerator; protected locationGenerator: LocationGenerator;
protected localisationService: LocalisationService;
protected lootGenerator: LootGenerator; protected lootGenerator: LootGenerator;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected airdropConfig: IAirdropConfig; protected airdropConfig: IAirdropConfig;
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, logger: ILogger, locationGenerator: LocationGenerator, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
get(location: string): ILocationBase; get(location: string): ILocationBase;
generate(name: string): ILocationBase; generate(name: string): ILocationBase;
generateAll(): ILocationsGenerateAllResponse; generateAll(): ILocationsGenerateAllResponse;

View File

@ -6,15 +6,16 @@ import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequest
import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData";
import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData";
import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData";
import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData";
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData";
import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IBotConfig } from "../models/spt/config/IBotConfig";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
import { IMatchConfig } from "../models/spt/config/IMatchConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
import { BotLootCacheService } from "../services/BotLootCacheService"; import { BotLootCacheService } from "../services/BotLootCacheService";
import { MatchLocationService } from "../services/MatchLocationService"; import { MatchLocationService } from "../services/MatchLocationService";
import { ProfileSnapshotService } from "../services/ProfileSnapshotService"; import { ProfileSnapshotService } from "../services/ProfileSnapshotService";
@ -27,11 +28,12 @@ export declare class MatchController {
protected botLootCacheService: BotLootCacheService; protected botLootCacheService: BotLootCacheService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected profileSnapshotService: ProfileSnapshotService; protected profileSnapshotService: ProfileSnapshotService;
protected botGenerationCacheService: BotGenerationCacheService;
protected applicationContext: ApplicationContext; protected applicationContext: ApplicationContext;
protected matchConfig: IMatchConfig; protected matchConfig: IMatchConfig;
protected inraidConfig: IInRaidConfig; protected inraidConfig: IInRaidConfig;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, applicationContext: ApplicationContext); constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext);
getEnabled(): boolean; getEnabled(): boolean;
getProfile(info: IGetProfileRequestData): IPmcData[]; getProfile(info: IGetProfileRequestData): IPmcData[];
createGroup(sessionID: string, info: ICreateGroupRequestData): any; createGroup(sessionID: string, info: ICreateGroupRequestData): any;
@ -39,6 +41,17 @@ export declare class MatchController {
joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[];
protected getMatch(location: string): any; protected getMatch(location: string): any;
getGroupStatus(info: IGetGroupStatusRequestData): any; getGroupStatus(info: IGetGroupStatusRequestData): any;
startOfflineRaid(info: IStartOfflineRaidRequestData, sessionID: string): void; /**
* Handle /client/raid/configuration
* @param request
* @param sessionID
*/
startOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void;
/**
* Convert a difficulty value from pre-raid screen to a bot difficulty
* @param botDifficulty dropdown difficulty value
* @returns bot difficulty
*/
protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: string): string;
endOfflineRaid(info: IEndOfflineRaidRequestData, sessionID: string): void; endOfflineRaid(info: IEndOfflineRaidRequestData, sessionID: string): void;
} }

View File

@ -1,10 +1,10 @@
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { INoteActionData } from "../models/eft/notes/INoteActionData"; import { INoteActionData } from "../models/eft/notes/INoteActionData";
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { EventOutputHolder } from "../routers/EventOutputHolder";
export declare class NoteController { export declare class NoteController {
protected itemEventRouter: ItemEventRouter; protected eventOutputHolder: EventOutputHolder;
constructor(itemEventRouter: ItemEventRouter); constructor(eventOutputHolder: EventOutputHolder);
addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;

View File

@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData";
import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; import { WeaponBuild } from "../models/eft/profile/IAkiProfile";
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { EventOutputHolder } from "../routers/EventOutputHolder";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
export declare class PresetBuildController { export declare class PresetBuildController {
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected itemEventRouter: ItemEventRouter; protected eventOutputHolder: EventOutputHolder;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer); constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer);
getUserBuilds(sessionID: string): WeaponBuild[]; getUserBuilds(sessionID: string): WeaponBuild[];
saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;

View File

@ -1,6 +1,7 @@
import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; import { PlayerScavGenerator } from "../generators/PlayerScavGenerator";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper"; import { ProfileHelper } from "../helpers/ProfileHelper";
import { QuestHelper } from "../helpers/QuestHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IMiniProfile } from "../models/eft/launcher/IMiniProfile"; import { IMiniProfile } from "../models/eft/launcher/IMiniProfile";
@ -24,8 +25,9 @@ export declare class ProfileController {
protected profileFixerService: ProfileFixerService; protected profileFixerService: ProfileFixerService;
protected playerScavGenerator: PlayerScavGenerator; protected playerScavGenerator: PlayerScavGenerator;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
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(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper);
getMiniProfiles(): IMiniProfile[]; getMiniProfiles(): IMiniProfile[];
getMiniProfile(sessionID: string): any; getMiniProfile(sessionID: string): any;
getCompleteProfile(sessionID: string): IPmcData[]; getCompleteProfile(sessionID: string): IPmcData[];

View File

@ -5,22 +5,26 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
import { QuestHelper } from "../helpers/QuestHelper"; import { QuestHelper } from "../helpers/QuestHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData"; import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData";
import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData"; import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData";
import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { IQuestConfig } from "../models/spt/config/IQuestConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { LocaleService } from "../services/LocaleService"; import { LocaleService } from "../services/LocaleService";
import { LocalisationService } from "../services/LocalisationService";
import { PlayerService } from "../services/PlayerService"; import { PlayerService } from "../services/PlayerService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class QuestController { export declare class QuestController {
protected logger: ILogger; protected logger: ILogger;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected itemEventRouter: ItemEventRouter; protected httpResponseUtil: HttpResponseUtil;
protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected dialogueHelper: DialogueHelper; protected dialogueHelper: DialogueHelper;
@ -29,9 +33,10 @@ export declare class QuestController {
protected questConditionHelper: QuestConditionHelper; protected questConditionHelper: QuestConditionHelper;
protected playerService: PlayerService; protected playerService: PlayerService;
protected localeService: LocaleService; protected localeService: LocaleService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer);
/** /**
* Get all quests visible to player * Get all quests visible to player
* Exclude quests with incomplete preconditions (level/loyalty) * Exclude quests with incomplete preconditions (level/loyalty)
@ -55,7 +60,30 @@ export declare class QuestController {
* @returns client response * @returns client response
*/ */
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead
* @param startedMessageTextId startedMessageText property from IQuest
* @param questDescriptionId description property from IQuest
* @returns message id
*/
protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string;
/**
* Handle the client accepting a repeatable quest and starting it
* Send starting rewards if any to player and
* Send start notification if any to player
* @param pmcData Profile to update with new quest
* @param acceptedQuest Quest being accepted
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Look for an accepted quest inside player profile, return matching
* @param pmcData Profile to search through
* @param acceptedQuest Quest to search for
* @returns IRepeatableQuest
*/
protected getRepeatableQuestFromProfile(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData): IRepeatableQuest;
/** /**
* Update completed quest in profile * Update completed quest in profile
* Add newly unlocked quests to profile * Add newly unlocked quests to profile
@ -67,13 +95,20 @@ 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 completion of a quest * Send a popup to player on successful completion of a quest
* @param sessionID session id * @param sessionID session id
* @param pmcData player profile * @param pmcData Player profile
* @param completedQuestId completed quest id * @param completedQuestId Completed quest id
* @param questRewards rewards given to player * @param questRewards Rewards given to player
*/ */
protected sendDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Reward[]): void; protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Reward[]): void;
/**
* Look for newly available quests after completing a quest with a requirement to wait x minutes (time-locked) before being available and add data to profile
* @param pmcData Player profile to update
* @param quests Quests to look for wait conditions in
* @param completedQuestId Quest just completed
*/
protected addTimeLockedQuestsToProfile(pmcData: IPmcData, quests: IQuest[], completedQuestId: string): void;
/** /**
* Returns a list of quests that should be failed when a quest is completed * Returns a list of quests that should be failed when a quest is completed
* @param completedQuestId quest completed id * @param completedQuestId quest completed id

View File

@ -12,6 +12,7 @@ import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { ITraderAssort } from "../models/eft/common/tables/ITrader";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IAddOfferRequestData, Requirement } from "../models/eft/ragfair/IAddOfferRequestData"; import { IAddOfferRequestData, Requirement } from "../models/eft/ragfair/IAddOfferRequestData";
@ -23,11 +24,12 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { RagfairServer } from "../servers/RagfairServer"; import { RagfairServer } from "../servers/RagfairServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { LocalisationService } from "../services/LocalisationService";
import { PaymentService } from "../services/PaymentService"; import { PaymentService } from "../services/PaymentService";
import { RagfairOfferService } from "../services/RagfairOfferService"; import { RagfairOfferService } from "../services/RagfairOfferService";
import { RagfairPriceService } from "../services/RagfairPriceService"; import { RagfairPriceService } from "../services/RagfairPriceService";
@ -41,7 +43,7 @@ export declare class RagfairController {
protected logger: ILogger; protected logger: ILogger;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected itemEventRouter: ItemEventRouter; protected eventOutputHolder: EventOutputHolder;
protected ragfairServer: RagfairServer; protected ragfairServer: RagfairServer;
protected ragfairPriceService: RagfairPriceService; protected ragfairPriceService: RagfairPriceService;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
@ -61,22 +63,64 @@ export declare class RagfairController {
protected ragfairOfferService: RagfairOfferService; protected ragfairOfferService: RagfairOfferService;
protected ragfairRequiredItemsService: RagfairRequiredItemsService; protected ragfairRequiredItemsService: RagfairRequiredItemsService;
protected ragfairOfferGenerator: RagfairOfferGenerator; protected ragfairOfferGenerator: RagfairOfferGenerator;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, 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, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult;
/**
* Get offers for the client based on type of search being performed
* @param searchRequest Client search request data
* @param itemsToAdd
* @param traderAssorts Trader assorts
* @param pmcProfile Player profile
* @returns array of offers
*/
protected getOffersForSearchType(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
/**
* Get categories for the type of search being performed, linked/required/all
* @param searchRequest Client search request data
* @param offers ragfair offers to get categories for
* @returns record with tpls + counts
*/
protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
/**
* Add Required offers to offers result
* @param searchRequest Client search request data
* @param assorts
* @param pmcProfile Player profile
* @param result Result object being sent back to client
*/
protected addRequiredOffersToResult(searchRequest: ISearchRequestData, assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData, result: IGetOffersResult): void;
/**
* Add index to all offers passed in (0-indexed)
* @param offers Offers to add index value to
*/
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
*/ */
protected setTraderOfferPurchaseLimits(offer: IRagfairOffer): void; protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, profile: IAkiProfile): void;
/**
* Adjust ragfair offer stack count to match same value as traders assort stack count
* @param offer Flea offer to adjust
*/
protected setTraderOfferStackSize(offer: IRagfairOffer): void;
protected isLinkedSearch(info: ISearchRequestData): boolean; protected isLinkedSearch(info: ISearchRequestData): boolean;
protected isRequiredSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean;
update(): void; update(): void;
getItemPrice(info: IGetMarketPriceRequestData): IGetItemPriceResult; /**
* Called when creating an offer on flea, fills values in top right corner
* @param getPriceRequest
* @returns min/avg/max values for an item based on flea offers available
*/
getItemMinAvgMaxFleaPriceValues(getPriceRequest: IGetMarketPriceRequestData): IGetItemPriceResult;
addPlayerOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse; addPlayerOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer;
getAllFleaPrices(): Record<string, number>; getAllFleaPrices(): Record<string, number>;
getStaticPrices(): Record<string, number>;
removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse;
extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
} }

View File

@ -7,35 +7,35 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData
import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest"; import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest";
import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { IRepairConfig } from "../models/spt/config/IRepairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { PaymentService } from "../services/PaymentService"; import { PaymentService } from "../services/PaymentService";
import { RepairService } from "../services/RepairService";
export declare class RepairController { export declare class RepairController {
protected logger: ILogger; protected logger: ILogger;
protected itemEventRouter: ItemEventRouter; protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
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 configServer: ConfigServer; protected repairService: RepairService;
protected repairConfig: IRepairConfig; protected repairConfig: IRepairConfig;
constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService);
/** /**
* Repair with trader * Repair with trader
* @param pmcData player profile
* @param body endpoint request data
* @param sessionID session id * @param sessionID session id
* @param body endpoint request data
* @param pmcData player profile
* @returns item event router action * @returns item event router action
*/ */
traderRepair(pmcData: IPmcData, body: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse; traderRepair(sessionID: string, body: ITraderRepairActionDataRequest, pmcData: IPmcData): IItemEventRouterResponse;
/** /**
* Repair with repair kit * Repair with repair kit
* @param pmcData player profile
* @param body endpoint request data
* @param sessionID session id * @param sessionID session id
* @param body endpoint request data
* @param pmcData player profile
* @returns item event router action * @returns item event router action
*/ */
repairWithKit(pmcData: IPmcData, body: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse; repairWithKit(sessionID: string, body: IRepairActionDataRequest, pmcData: IPmcData): IItemEventRouterResponse;
} }

View File

@ -1,3 +1,4 @@
import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { PresetHelper } from "../helpers/PresetHelper"; import { PresetHelper } from "../helpers/PresetHelper";
import { ProfileHelper } from "../helpers/ProfileHelper"; import { ProfileHelper } from "../helpers/ProfileHelper";
@ -13,12 +14,14 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ
import { ELocationName } from "../models/enums/ELocationName"; import { ELocationName } from "../models/enums/ELocationName";
import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService"; import { ItemFilterService } from "../services/ItemFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { PaymentService } from "../services/PaymentService"; import { PaymentService } from "../services/PaymentService";
import { ProfileFixerService } from "../services/ProfileFixerService"; import { ProfileFixerService } from "../services/ProfileFixerService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil"; import { MathUtil } from "../utils/MathUtil";
import { ObjectId } from "../utils/ObjectId"; import { ObjectId } from "../utils/ObjectId";
@ -55,6 +58,7 @@ export declare class RepeatableQuestController {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected httpResponse: HttpResponseUtil;
protected mathUtil: MathUtil; protected mathUtil: MathUtil;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
@ -62,14 +66,16 @@ export declare class RepeatableQuestController {
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected profileFixerService: ProfileFixerService; protected profileFixerService: ProfileFixerService;
protected handbookHelper: HandbookHelper;
protected ragfairServerHelper: RagfairServerHelper; protected ragfairServerHelper: RagfairServerHelper;
protected itemEventRouter: ItemEventRouter; protected eventOutputHolder: EventOutputHolder;
protected localisationService: LocalisationService;
protected paymentService: PaymentService; protected paymentService: PaymentService;
protected objectId: ObjectId; protected objectId: ObjectId;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer); constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, handbookHelper: HandbookHelper, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer);
/** /**
* This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint
* Returns an array of objects in the format of repeatable quests to the client. * Returns an array of objects in the format of repeatable quests to the client.
@ -96,6 +102,13 @@ export declare class RepeatableQuestController {
* @returns {array} array of "repeatableQuestObjects" as descibed above * @returns {array} array of "repeatableQuestObjects" as descibed above
*/ */
getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[];
/**
* Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists
* @param repeatableConfig daily/weekly config
* @param pmcData Profile to search
* @returns IPmcDataRepeatableQuest
*/
protected getRepeatableQuestSubTypeFromProfile(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): IPmcDataRepeatableQuest;
/** /**
* This method is called by GetClientRepeatableQuests and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * 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 * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest
@ -104,17 +117,18 @@ export declare class RepeatableQuestController {
/** /**
* 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 * 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 * The templates include Elimination, Completion and Extraction quest types
* *
* @param {string} type quest type: "Elimination", "Completion" or "Extraction" * @param {string} type quest type: "Elimination", "Completion" or "Extraction"
* @param {string} traderId trader from which the quest will be provided * @param {string} traderId trader from which the quest will be provided
* @param {string} side scav daily or pmc daily/weekly quest
* @returns {object} a object which contains the base elements for repeatable quests of the requests type * @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) * (needs to be filled with reward and conditions by called to make a valid quest)
*/ */
generateRepeatableTemplate(type: string, traderId: string): IRepeatableQuest; generateRepeatableTemplate(type: string, traderId: string, side: string): IRepeatableQuest;
/** /**
* Generates a valid Exploration quest * Generates a valid Exploration quest
* *
@ -144,6 +158,12 @@ export declare class RepeatableQuestController {
* @returns {object} object of quest type format for "Elimination" (see assets/database/templates/repeatableQuests.json) * @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; 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. * Exploration repeatable quests can specify a required extraction point.
* This method creates the according object which will be appended to the conditions array * This method creates the according object which will be appended to the conditions array
@ -219,16 +239,17 @@ export declare class RepeatableQuestController {
generateRewardItem(tpl: string, value: number, index: number, preset?: any): IReward; generateRewardItem(tpl: string, value: number, index: number, preset?: any): IReward;
debugLogRepeatableQuestIds(pmcData: IPmcData): void; debugLogRepeatableQuestIds(pmcData: IPmcData): void;
probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>; probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>;
changeRepeatableQuest(pmcDataIn: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; changeRepeatableQuest(pmcData: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
/** /**
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
* @returns a list of rewardable items [[_tpl, itemTemplate],...] * @param repeatableQuestConfig config file
* @returns a list of rewardable items [[_tpl, itemTemplate],...]
*/ */
protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [string, ITemplateItem][]; protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [string, ITemplateItem][];
/** /**
* Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward
* or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * or content of bot loot. Items that are tested as valid may be in a player backpack or stash.
* @param {*} tpl template id of item to check * @param {string} tpl template id of item to check
* @returns boolean: true if item is valid reward * @returns boolean: true if item is valid reward
*/ */
isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean; isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean;

View File

@ -1,20 +1,30 @@
import { RagfairServer } from "../servers/RagfairServer"; import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper"; import { ProfileHelper } from "../helpers/ProfileHelper";
import { TradeHelper } from "../helpers/TradeHelper"; import { TradeHelper } from "../helpers/TradeHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { Upd } from "../models/eft/common/tables/IItem"; import { Upd } from "../models/eft/common/tables/IItem";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer";
import { LocalisationService } from "../services/LocalisationService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
declare class TradeController { declare class TradeController {
protected logger: ILogger; protected logger: ILogger;
protected itemEventRouter: ItemEventRouter; protected eventOutputHolder: EventOutputHolder;
protected tradeHelper: TradeHelper; protected tradeHelper: TradeHelper;
protected itemHelper: ItemHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected ragfairServer: RagfairServer; protected ragfairServer: RagfairServer;
constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer); protected httpResponse: HttpResponseUtil;
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer);
confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse;
confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
} }

View File

@ -1,3 +1,4 @@
import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator";
import { ProfileHelper } from "../helpers/ProfileHelper"; import { ProfileHelper } from "../helpers/ProfileHelper";
import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
@ -6,6 +7,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { FenceService } from "../services/FenceService"; import { FenceService } from "../services/FenceService";
import { TraderAssortService } from "../services/TraderAssortService"; import { TraderAssortService } from "../services/TraderAssortService";
import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class TraderController { export declare class TraderController {
@ -16,9 +18,11 @@ export declare class TraderController {
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected traderAssortService: TraderAssortService; protected traderAssortService: TraderAssortService;
protected traderPurchasePersisterService: TraderPurchasePersisterService;
protected fenceService: FenceService; protected fenceService: FenceService;
protected fenceBaseAssortGenerator: FenceBaseAssortGenerator;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil); constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil);
/** /**
* Runs when onLoad event is fired * Runs when onLoad event is fired
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
@ -38,6 +42,13 @@ export declare class TraderController {
* @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;
getTrader(sessionID: string, traderID: string): ITraderBase; getTrader(sessionID: string, traderID: string): ITraderBase;
getAssort(sessionId: string, traderId: string): ITraderAssort; getAssort(sessionId: string, traderId: string): ITraderAssort;
getPurchasesData(sessionID: string, traderID: string): Record<string, IBarterScheme[][]>; getPurchasesData(sessionID: string, traderID: string): Record<string, IBarterScheme[][]>;

View File

@ -1,11 +1,18 @@
import { WeatherGenerator } from "../generators/WeatherGenerator"; import { WeatherGenerator } from "../generators/WeatherGenerator";
import { IWeatherData } from "../models/eft/weather/IWeatherData"; import { IWeatherData } from "../models/eft/weather/IWeatherData";
import { IWeatherConfig } from "../models/spt/config/IWeatherConfig"; import { IWeatherConfig } from "../models/spt/config/IWeatherConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
export declare class WeatherController { export declare class WeatherController {
protected weatherGenerator: WeatherGenerator; protected weatherGenerator: WeatherGenerator;
protected logger: ILogger;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected weatherConfig: IWeatherConfig; protected weatherConfig: IWeatherConfig;
constructor(weatherGenerator: WeatherGenerator, configServer: ConfigServer); constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer);
generate(): IWeatherData; generate(): IWeatherData;
/**
* Get the current in-raid time (MUST HAVE PLAYER LOGGED INTO CLIENT TO WORK)
* @returns Date object
*/
getCurrentInRaidTime(): Date;
} }

View File

@ -1,10 +1,10 @@
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { EventOutputHolder } from "../routers/EventOutputHolder";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData";
export declare class WishlistController { export declare class WishlistController {
protected itemEvenRouter: ItemEventRouter; protected eventOutputHolder: EventOutputHolder;
constructor(itemEvenRouter: ItemEventRouter); constructor(eventOutputHolder: EventOutputHolder);
addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
} }

View File

@ -3,6 +3,7 @@ import { DependencyContainer } from "tsyringe";
* Handle the registration of classes to be used by the Dependency Injection code * Handle the registration of classes to be used by the Dependency Injection code
*/ */
export declare class Container { export declare class Container {
static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void;
static registerTypes(depContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void;
static registerListTypes(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void;
private static registerUtils; private static registerUtils;

View File

@ -1,4 +1,4 @@
export declare class OnLoad { export interface OnLoad {
onLoad(): void; onLoad(): Promise<void>;
getRoute(): string; getRoute(): string;
} }

View File

@ -1,7 +0,0 @@
import { OnLoad } from "./OnLoad";
import { OnUpdate } from "./OnUpdate";
export declare class OnLoadOnUpdate implements OnLoad, OnUpdate {
onUpdate(timeSinceLastRun: number): boolean;
onLoad(): void;
getRoute(): string;
}

View File

@ -1,4 +1,4 @@
export declare class OnUpdate { export interface OnUpdate {
onUpdate(timeSinceLastRun: number): boolean; onUpdate(timeSinceLastRun: number): Promise<boolean>;
getRoute(): string; getRoute(): string;
} }

View File

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

View File

@ -0,0 +1,200 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotHelper } from "../helpers/BotHelper";
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { ProbabilityHelper } from "../helpers/ProbabilityHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem";
import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
import { ItemFilterService } from "../services/ItemFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
export declare class BotEquipmentModGenerator {
protected logger: ILogger;
protected jsonUtil: JsonUtil;
protected hashUtil: HashUtil;
protected randomUtil: RandomUtil;
protected probabilityHelper: ProbabilityHelper;
protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper;
protected botEquipmentFilterService: BotEquipmentFilterService;
protected itemFilterService: ItemFilterService;
protected profileHelper: ProfileHelper;
protected botWeaponModLimitService: BotWeaponModLimitService;
protected botHelper: BotHelper;
protected botGeneratorHelper: BotGeneratorHelper;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected localisationService: LocalisationService;
protected botEquipmentModPoolService: BotEquipmentModPoolService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer);
/**
* Check mods are compatible and add to array
* @param equipment Equipment item to add mods to
* @param modPool Mod list to choose frm
* @param parentId parentid of item to add mod to
* @param parentTemplate template objet of item to add mods to
* @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type
* @param botRole the bot role being generated for
* @param forceSpawn should this mod be forced to spawn
* @returns Item + compatible mods as an array
*/
generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, botRole: string, forceSpawn?: boolean): Item[];
/**
* Add mods to a weapon using the provided mod pool
* @param sessionId session id
* @param weapon Weapon to add mods to
* @param modPool Pool of compatible mods to attach to weapon
* @param weaponParentId parentId of weapon
* @param parentTemplate Weapon which mods will be generated on
* @param modSpawnChances Mod spawn chances
* @param ammoTpl Ammo tpl to use when generating magazines/cartridges
* @param botRole Role of bot weapon is generated for
* @param botLevel lvel of the bot weapon is being generated for
* @param modLimits limits placed on certian mod types per gun
* @param botEquipmentRole role of bot when accessing bot.json equipment config settings
* @returns Weapon + mods array
*/
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[];
/**
* Is this modslot a front or rear sight
* @param modSlot Slot to check
* @returns true if it's a front/rear sight
*/
protected modIsFrontOrRearSight(modSlot: string): boolean;
/**
* Does the provided mod details show the mod can hold a scope
* @param modSlot e.g. mod_scope, mod_mount
* @param modsParentId Parent id of mod item
* @returns true if it can hold a scope
*/
protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean;
/**
* Set all scope mod chances to 100%
* @param modSpawnChances Chances objet to update
*/
protected setScopeSpawnChancesToFull(modSpawnChances: ModsChances): void;
protected sortModKeys(unsortedKeys: string[]): string[];
/**
* Get a Slot property for an item (chamber/cartridge/slot)
* @param modSlot e.g patron_in_weapon
* @param parentTemplate item template
* @returns Slot item
*/
protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot;
/**
* randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
* never return true for an item that has 0% spawn chance
* @param itemSlot slot the item sits in
* @param modSlot slot the mod sits in
* @param modSpawnChances Chances for various mod spawns
* @returns boolean true if it should spawn
*/
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean;
/**
*
* @param modSlot Slot mod will fit into
* @param isRandomisableSlot Will generate a randomised mod pool if true
* @param modsParent Parent slot the item will be a part of
* @param botEquipBlacklist Blacklist to prevent mods from being picked
* @param itemModPool Pool of items to pick from
* @param weapon array with only weapon tpl in it, ready for mods to be added
* @param ammoTpl ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine)
* @param parentTemplate Parent item the mod will go into
* @returns ITemplateItem
*/
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record<string, string[]>, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem];
/**
* Create a mod item with parameters as properties
* @param modId _id
* @param modTpl _tpl
* @param parentId parentId
* @param modSlot slotId
* @param modTemplate Used to add additional properites in the upd object
* @returns Item object
*/
protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item;
/**
* Get a list of containers that hold ammo
* e.g. mod_magazine / patron_in_weapon_000
* @returns string array
*/
protected getAmmoContainers(): string[];
/**
* Get a random mod from an items compatible mods Filter array
* @param modTpl ???? default value to return if nothing found
* @param parentSlot item mod will go into, used to get combatible items
* @param modSlot Slot to get mod to fill
* @param items items to ensure picked mod is compatible with
* @returns item tpl
*/
protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
/**
* Log errors if mod is not compatible with slot
* @param modToAdd template of mod to check
* @param itemSlot slot the item will be placed in
* @param modSlot slot the mod will fill
* @param parentTemplate template of the mods parent item
* @returns true if valid
*/
protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean;
/**
* Find mod tpls of a provided type and add to modPool
* @param desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope)
* @param modTemplate db object for modItem we get compatible mods from
* @param modPool Pool of mods we are adding to
*/
protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void;
/**
* Get the possible items that fit a slot
* @param parentItemId item tpl to get compatible items for
* @param modSlot Slot item should fit in
* @param botEquipBlacklist equipment that should not be picked
* @returns array of compatible items for that slot
*/
protected getDynamicModPool(parentItemId: string, modSlot: string, botEquipBlacklist: EquipmentFilterDetails): string[];
/**
* Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist
* @param allowedMods base mods to filter
* @param botEquipBlacklist equipment blacklist
* @param modSlot slot mods belong to
* @returns Filtered array of mod tpls
*/
protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[];
/**
* With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines.
* Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0.
* Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
* This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
* @param items The items where the CylinderMagazine's camora are appended to
* @param modPool modPool which should include available cartrigdes
* @param parentId The CylinderMagazine's UID
* @param parentTemplate The CylinderMagazine's template
*/
protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
/**
* Take a record of camoras and merge the compatable shells into one array
* @param camorasWithShells camoras we want to merge into one array
* @returns string array of shells fro luitple camora sources
*/
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
/**
* Filter out non-whitelisted weapon scopes
* @param weapon Weapon scopes will be added to
* @param scopes Full scope pool
* @param botWeaponSightWhitelist whitelist of scope types by weapon base type
* @returns array of scope tpls that have been filtered
*/
protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record<string, string[]>): string[];
}

View File

@ -1,38 +1,40 @@
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
import { BotHelper } from "../helpers/BotHelper"; import { BotHelper } from "../helpers/BotHelper";
import { GameEventHelper } from "../helpers/GameEventHelper";
import { ProfileHelper } from "../helpers/ProfileHelper"; import { ProfileHelper } from "../helpers/ProfileHelper";
import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Health as PmcHealth, IBotBase, Skills } from "../models/eft/common/tables/IBotBase"; import { Health as PmcHealth, IBotBase, Info, Skills } from "../models/eft/common/tables/IBotBase";
import { Health, IBotType, Inventory } from "../models/eft/common/tables/IBotType"; import { Health, IBotType } from "../models/eft/common/tables/IBotType";
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotInventoryGenerator } from "./BotInventoryGenerator";
declare namespace BotGenerator { import { BotLevelGenerator } from "./BotLevelGenerator";
interface IRandomisedBotLevelResult {
level: number;
exp: number;
}
}
export declare class BotGenerator { export declare class BotGenerator {
protected logger: ILogger; protected logger: ILogger;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected timeUtil: TimeUtil;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected botInventoryGenerator: BotInventoryGenerator; protected botInventoryGenerator: BotInventoryGenerator;
protected botLevelGenerator: BotLevelGenerator;
protected botEquipmentFilterService: BotEquipmentFilterService; protected botEquipmentFilterService: BotEquipmentFilterService;
protected weightedRandomHelper: WeightedRandomHelper;
protected botHelper: BotHelper; protected botHelper: BotHelper;
protected gameEventHelper: GameEventHelper; protected botDifficultyHelper: BotDifficultyHelper;
protected seasonalEventService: SeasonalEventService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botEquipmentFilterService: BotEquipmentFilterService, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
/** /**
* Generate a player scav bot object * Generate a player scav bot object
* @param role e.g. assault / pmcbot * @param role e.g. assault / pmcbot
@ -41,29 +43,40 @@ export declare class BotGenerator {
* @returns * @returns
*/ */
generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase; generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase;
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
/** /**
* Choose if a bot should become a PMC by checking if bot type is allowed to become a Pmc in botConfig.convertFromChances and doing a random int check * Create x number of bots of the type/side/difficulty defined in botGenerationDetails
* @param botRole the bot role to check if should be a pmc * @param sessionId Session id
* @returns true if should be a pmc * @param botGenerationDetails details on how to generate bots
* @returns array of bots
*/ */
protected shouldBotBePmc(botRole: string): boolean; prepareAndGenerateBots(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[];
/**
* Get a randomised PMC side based on bot config value 'isUsec'
* @returns pmc side as string
*/
protected getRandomisedPmcSide(): string;
/** /**
* 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
*/ */
protected getCloneOfBotBase(): IBotBase; protected getCloneOfBotBase(): IBotBase;
protected generateBot(sessionId: string, bot: IBotBase, role: string, node: IBotType, isPmc: boolean, isPlayerScav?: boolean): IBotBase; /**
* Create a IBotBase object with equipment/loot/exp etc
* @param sessionId Session id
* @param bot bots base file
* @param botJsonTemplate Bot template from db/bots/x.json
* @param botGenerationDetails details on how to generate the bot
* @returns IBotBase object
*/
protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase;
/**
* Create a bot nickname
* @param botJsonTemplate x.json from database
* @param isPlayerScav Will bot be player scav
* @param botRole role of bot e.g. assault
* @returns Nickname for bot
*/
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string;
/** /**
* Log the number of PMCs generated to the debug console * Log the number of PMCs generated to the debug console
* @param output Generated bot array, ready to send to client
*/ */
protected logPmcGeneratedCount(output: IBotBase[]): void; protected logPmcGeneratedCount(output: IBotBase[]): void;
protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult;
/** /**
* Converts health object to the required format * Converts health object to the required format
* @param healthObj health object from bot json * @param healthObj health object from bot json
@ -73,19 +86,19 @@ export declare class BotGenerator {
protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth;
protected generateSkills(skillsObj: Skills): Skills; protected generateSkills(skillsObj: Skills): Skills;
/** /**
* Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType) * Generate a random Id for a bot and apply to bots _id and aid value
* @param pmcSide eft side (usec/bear) * @param bot bot to update
* @returns pmc side as defined in config * @returns updated IBotBase object
*/ */
protected getPmcRole(pmcSide: string): string;
/**
* Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper)
* @param nodeInventory Bots inventory to iterate over
*/
protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void;
protected generateId(bot: IBotBase): IBotBase; protected generateId(bot: IBotBase): IBotBase;
protected generateInventoryID(profile: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase;
protected getPMCDifficulty(requestedDifficulty: string): string; /**
* Randomise a bots game version and account category
* Chooses from all the game versions (standard, eod etc)
* Chooses account type (default, Sherpa, etc)
* @param botInfo bot info object to update
*/
protected getRandomisedGameVersionAndCategory(botInfo: Info): void;
/** /**
* 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
@ -93,4 +106,3 @@ export declare class BotGenerator {
*/ */
protected generateDogtag(bot: IBotBase): IBotBase; protected generateDogtag(bot: IBotBase): IBotBase;
} }
export {};

View File

@ -1,13 +1,20 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotHelper } from "../helpers/BotHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
import { Inventory, Chances, Generation, Mods } from "../models/eft/common/tables/IBotType"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType";
import { EquipmentSlots } from "../models/enums/EquipmentSlots";
import { EquipmentFilterDetails, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
import { BotWeaponGenerator } from "./BotWeaponGenerator";
import { BotLootGenerator } from "./BotLootGenerator"; import { BotLootGenerator } from "./BotLootGenerator";
import { ILogger } from "../models/spt/utils/ILogger"; import { BotWeaponGenerator } from "./BotWeaponGenerator";
import { DatabaseServer } from "../servers/DatabaseServer";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
export declare class BotInventoryGenerator { export declare class BotInventoryGenerator {
protected logger: ILogger; protected logger: ILogger;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
@ -16,9 +23,90 @@ export declare class BotInventoryGenerator {
protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGenerator: BotWeaponGenerator;
protected botLootGenerator: BotLootGenerator; protected botLootGenerator: BotLootGenerator;
protected botGeneratorHelper: BotGeneratorHelper; protected botGeneratorHelper: BotGeneratorHelper;
protected botHelper: BotHelper;
protected weightedRandomHelper: WeightedRandomHelper; protected weightedRandomHelper: WeightedRandomHelper;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, weightedRandomHelper: WeightedRandomHelper); protected localisationService: LocalisationService;
generateInventory(sessionId: string, templateInventory: Inventory, equipmentChances: Chances, generation: Generation, botRole: string, isPmc: boolean): PmcInventory; protected botEquipmentModPoolService: BotEquipmentModPoolService;
protected generateEquipment(equipmentSlot: string, equipmentPool: Record<string, number>, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory): void; protected botEquipmentModGenerator: BotEquipmentModGenerator;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer);
/**
* Add equipment/weapons/loot to bot
* @param sessionId Session id
* @param botJsonTemplate bot/x.json data from db
* @param botRole Role bot has (assault/pmcBot)
* @param isPmc Is bot being converted into a pmc
* @param botLevel Level of bot being generated
* @returns PmcInventory object with equipment/weapons/loot
*/
generateInventory(sessionId: string, botJsonTemplate: IBotType, botRole: string, isPmc: boolean, botLevel: number): PmcInventory;
/**
* Create a pmcInventory object with all the base/generic items needed
* @returns PmcInventory object
*/
protected generateInventoryBase(): PmcInventory; protected generateInventoryBase(): PmcInventory;
/**
* Add equipment to a bot
* @param templateInventory bot/x.json data from db
* @param equipmentChances Chances items will be added to bot
* @param botRole Role bot has (assault/pmcBot)
* @param botInventory Inventory to add equipment to
* @param botLevel Level of bot
*/
protected generateAndAddEquipmentToBot(templateInventory: Inventory, equipmentChances: Chances, botRole: string, botInventory: PmcInventory, botLevel: number): void;
/**
* Add a piece of equipment with mods to inventory from the provided pools
* @param equipmentSlot Slot to select an item for
* @param equipmentPool Possible items to choose from
* @param modPool Possible mods to apply to item chosen
* @param spawnChances Chances items will be chosen to be added
* @param botRole Role of bot e.g. assault
* @param inventory Inventory to add item into
* @param randomisationDetails settings from bot.json to adjust how item is generated
*/
protected generateEquipment(equipmentSlot: string, equipmentPool: Record<string, number>, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory, randomisationDetails: RandomisationDetails): void;
/**
* Get all possible mods for item and filter down based on equipment blacklist from bot.json config
* @param itemTpl Item mod pool is being retreived and filtered
* @param equipmentBlacklist blacklist to filter mod pool with
* @returns Filtered pool of mods
*/
protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: EquipmentFilterDetails[]): Record<string, string[]>;
/**
* Work out what weapons bot should have equipped and add them to bot inventory
* @param templateInventory bot/x.json data from db
* @param equipmentChances Chances bot can have equipment equipped
* @param sessionId Session id
* @param botInventory Inventory to add weapons to
* @param botRole assault/pmcBot/bossTagilla etc
* @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
*/
protected generateAndAddWeaponsToBot(templateInventory: Inventory, equipmentChances: Chances, sessionId: string, botInventory: PmcInventory, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void;
/**
* Calculate if the bot should have weapons in Primary/Secondary/Holster slots
* @param equipmentChances Chances bot has certain equipment
* @returns What slots bot should have weapons generated for
*/
protected getDesiredWeaponsForBot(equipmentChances: Chances): {
slot: EquipmentSlots;
shouldSpawn: boolean;
}[];
/**
* Add weapon + spare mags/ammo to bots inventory
* @param sessionId Session id
* @param weaponSlot Weapon slot being generated
* @param templateInventory bot/x.json data from db
* @param botInventory Inventory to add weapon+mags/ammo to
* @param equipmentChances Chances bot can have equipment equipped
* @param botRole assault/pmcBot/bossTagilla etc
* @param isPmc Is the bot being generated as a pmc
* @param itemGenerationLimitsMinMax
*/
protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: {
slot: EquipmentSlots;
shouldSpawn: boolean;
}, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void;
} }

29
types/generators/BotLevelGenerator.d.ts vendored Normal file
View File

@ -0,0 +1,29 @@
import { MinMax } from "../models/common/MinMax";
import { IRandomisedBotLevelResult } from "../models/eft/bot/IRandomisedBotLevelResult";
import { ExpTable } from "../models/eft/common/IGlobals";
import { IBotBase } from "../models/eft/common/tables/IBotBase";
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { RandomUtil } from "../utils/RandomUtil";
export declare class BotLevelGenerator {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer;
constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer);
/**
* Return a randomised bot level and exp value
* @param levelDetails min and max of level for bot
* @param botGenerationDetails Deatils to help generate a bot
* @param bot being level is being generated for
* @returns IRandomisedBotLevelResult object
*/
generateBotLevel(levelDetails: MinMax, botGenerationDetails: BotGenerationDetails, bot: IBotBase): IRandomisedBotLevelResult;
/**
* Get the highest level a bot can be relative to the players level, but no futher than the max size from globals.exp_table
* @param playerLevel Players current level
* @param relativeDeltaMax max delta above player level to go
* @returns highest level possible for bot
*/
protected getHighestRelativeBotLevel(playerLevel: number, relativeDeltaMax: number, levelDetails: MinMax, expTable: ExpTable[]): number;
}

View File

@ -1,5 +1,7 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
import { HandbookHelper } from "../helpers/HandbookHelper"; import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
@ -9,6 +11,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { BotLootCacheService } from "../services/BotLootCacheService"; import { BotLootCacheService } from "../services/BotLootCacheService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
import { BotWeaponGenerator } from "./BotWeaponGenerator"; import { BotWeaponGenerator } from "./BotWeaponGenerator";
@ -16,15 +19,29 @@ export declare class BotLootGenerator {
protected logger: ILogger; protected logger: ILogger;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected itemHelper: ItemHelper;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected handbookHelper: HandbookHelper; protected handbookHelper: HandbookHelper;
protected botGeneratorHelper: BotGeneratorHelper; protected botGeneratorHelper: BotGeneratorHelper;
protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGenerator: BotWeaponGenerator;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected botLootCacheService: BotLootCacheService; protected botLootCacheService: BotLootCacheService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botLootCacheService: BotLootCacheService, configServer: ConfigServer); constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer);
generateLoot(sessionId: string, templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances): void; /**
* Add loot to bots containers
* @param sessionId Session id
* @param templateInventory x.json from database/bots
* @param itemCounts Liits on item types to be added as loot
* @param isPmc Will bot be a pmc
* @param botRole Role of bot, e.g. asssult
* @param botInventory Inventory to add loot to
* @param equipmentChances
* @param botLevel Level of bot
*/
generateLoot(sessionId: string, templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances, botLevel: number): void;
protected getRandomisedCount(min: number, max: number, nValue: number): number; protected getRandomisedCount(min: number, max: number, nValue: number): number;
/** /**
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached
@ -47,7 +64,7 @@ export declare class BotLootGenerator {
* @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): void; protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void;
/** /**
* Get a random item from the pool parameter using the biasedRandomNumber system * Get a random item from the pool parameter using the biasedRandomNumber system
* @param pool pool of items to pick an item from * @param pool pool of items to pick an item from
@ -111,7 +128,7 @@ export declare class BotLootGenerator {
* 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 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(isPmc: boolean, botRole: string): Record<string, number>;
/** /**

View File

@ -1,4 +1,5 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { MinMax } from "../models/common/MinMax"; import { MinMax } from "../models/common/MinMax";
@ -11,9 +12,13 @@ import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
import { IInventoryMagGen } from "./weapongen/IInventoryMagGen";
export declare class BotWeaponGenerator { export declare class BotWeaponGenerator {
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected logger: ILogger; protected logger: ILogger;
@ -24,9 +29,14 @@ export declare class BotWeaponGenerator {
protected botGeneratorHelper: BotGeneratorHelper; protected botGeneratorHelper: BotGeneratorHelper;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected botWeaponModLimitService: BotWeaponModLimitService;
protected botEquipmentModGenerator: BotEquipmentModGenerator;
protected localisationService: LocalisationService;
protected inventoryMagGenComponents: IInventoryMagGen[];
protected readonly modMagazineSlotId = "mod_magazine"; protected readonly modMagazineSlotId = "mod_magazine";
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer); constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]);
/** /**
* Pick a random weapon based on weightings and generate a functional weapon * Pick a random weapon based on weightings and generate a functional weapon
* @param equipmentSlot Primary/secondary/holster * @param equipmentSlot Primary/secondary/holster
@ -37,7 +47,7 @@ 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): GenerateWeaponResult; generateRandomWeapon(sessionId: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult;
/** /**
* 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
@ -56,7 +66,7 @@ export declare class BotWeaponGenerator {
* @param isPmc * @param isPmc
* @returns GenerateWeaponResult object * @returns GenerateWeaponResult object
*/ */
generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult; generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult;
/** /**
* 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
@ -67,7 +77,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
*/ */
constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): Item[]; protected constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): Item[];
/** /**
* 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
@ -79,42 +89,26 @@ export declare class BotWeaponGenerator {
/** /**
* 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: Item[], 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 weaponMods mods to attach to weapon * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl)
* @param weaponTemplate db template for weapon * @param magCounts Magazine count to add to inventory
* @param magCounts magazine count to add to inventory * @param inventory Inventory to add magazines to
* @param ammoTpl ammo templateId to add to magazines * @param botRole The bot type we're getting generating extra mags for
* @param inventory inventory to add magazines to
* @param botRole the bot type we're getting generating extra mags for
* @returns
*/ */
addExtraMagazinesToInventory(weaponMods: Item[], weaponTemplate: ITemplateItem, magCounts: MinMax, ammoTpl: string, inventory: PmcInventory, botRole: string): void; addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void;
/** /**
* Create a magazine using the parameters given * Add Grendaes for UBGL to bots vest and secure container
* @param magazineTpl Tpl of the magazine to create * @param weaponMods Weapon array with mods
* @param ammoTpl Ammo to add to magazine * @param generatedWeaponResult result of weapon generation
* @param magTemplate template object of magazine * @param inventory bot inventory to add grenades to
* @returns Item array
*/ */
protected createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; protected addUbglGrenadesToBotInventory(weaponMods: Item[], generatedWeaponResult: GenerateWeaponResult, inventory: PmcInventory): void;
/**
* Get a randomised number of bullets for a specific magazine
* @param magCounts min and max count of magazines
* @param magTemplate magazine to generate bullet count for
* @returns bullet count number
*/
protected getRandomisedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number;
/**
* Get a randomised count of magazines
* @param magCounts min and max value returned value can be between
* @returns numberical value of magazine count
*/
protected getRandomisedMagazineCount(magCounts: MinMax): number;
/** /**
* 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
@ -131,13 +125,6 @@ export declare class BotWeaponGenerator {
* @returns magazine tpl string * @returns magazine tpl string
*/ */
protected getMagazineTplFromWeaponTemplate(weaponMods: Item[], weaponTemplate: ITemplateItem, botRole: string): string; protected getMagazineTplFromWeaponTemplate(weaponMods: Item[], weaponTemplate: ITemplateItem, botRole: string): string;
/**
* Get a weapons default magazine template id
* @param weaponTemplate weapon to get default magazine for
* @returns tpl of magazine
*/
protected getWeaponsDefaultMagazineTpl(weaponTemplate: ITemplateItem): string;
protected addBulletsToVestAndPockets(ammoTpl: string, bulletCount: number, inventory: PmcInventory): void;
/** /**
* 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 ammo a list of ammo tpls the weapon can use
@ -158,6 +145,13 @@ export declare class BotWeaponGenerator {
* @param ammoTpl * @param ammoTpl
*/ */
protected fillExistingMagazines(weaponMods: Item[], magazine: Item, ammoTpl: string): void; protected fillExistingMagazines(weaponMods: Item[], magazine: Item, ammoTpl: string): void;
/**
* Add desired ammo tpl as item to weaponmods array, placed as child to UBGL
* @param weaponMods
* @param ubglMod
* @param ubglAmmoTpl
*/
protected fillUbgl(weaponMods: Item[], ubglMod: Item, ubglAmmoTpl: string): void;
/** /**
* Add cartridge item to weapon Item array, if it already exists, update * Add cartridge item to weapon Item array, if it already exists, update
* @param weaponMods Weapon items array to amend * @param weaponMods Weapon items array to amend

View File

@ -0,0 +1,28 @@
import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
export declare class FenceBaseAssortGenerator {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected handbookHelper: HandbookHelper;
protected itemHelper: ItemHelper;
protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer;
protected traderConfig: ITraderConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer);
/**
* Create base fence assorts dynamically and store in db
*/
generateFenceBaseAssorts(): void;
/**
* Check if item is valid for being added to fence assorts
* @param item Item to check
* @returns true if valid fence item
*/
protected isValidFenceItem(item: ITemplateItem): boolean;
}

View File

@ -1,5 +1,4 @@
import { ContainerHelper } from "../helpers/ContainerHelper"; import { ContainerHelper } from "../helpers/ContainerHelper";
import { GameEventHelper } from "../helpers/GameEventHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { PresetHelper } from "../helpers/PresetHelper"; import { PresetHelper } from "../helpers/PresetHelper";
import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
@ -9,6 +8,8 @@ import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticL
import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { LocalisationService } from "../services/LocalisationService";
import { SeasonalEventService } from "../services/SeasonalEventService";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil"; import { MathUtil } from "../utils/MathUtil";
import { ObjectId } from "../utils/ObjectId"; import { ObjectId } from "../utils/ObjectId";
@ -26,12 +27,13 @@ export declare class LocationGenerator {
protected ragfairServerHelper: RagfairServerHelper; protected ragfairServerHelper: RagfairServerHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected mathUtil: MathUtil; protected mathUtil: MathUtil;
protected gameEventHelper: GameEventHelper; protected seasonalEventService: SeasonalEventService;
protected containerHelper: ContainerHelper; protected containerHelper: ContainerHelper;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected locationConfig: ILocationConfig; protected locationConfig: ILocationConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, gameEventHelper: GameEventHelper, containerHelper: ContainerHelper, presetHelper: PresetHelper, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerProps; generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerProps;
protected getLooseLootMultiplerForLocation(location: string): number; protected getLooseLootMultiplerForLocation(location: string): number;
protected getStaticLootMultiplerForLocation(location: string): number; protected getStaticLootMultiplerForLocation(location: string): number;
@ -47,7 +49,8 @@ export declare class LocationGenerator {
* Add forced spawn point loot into loot parameter array * Add forced spawn point loot into loot parameter array
* @param loot array to add forced loot to * @param loot array to add forced loot to
* @param forcedSpawnPoints forced loot to add * @param forcedSpawnPoints forced loot to add
* @param name of map currently generating forced loot for
*/ */
protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[]): void; protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[], locationName: string): void;
protected createItem(tpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem; protected createItem(tpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
} }

View File

@ -6,17 +6,21 @@ import { LootRequest } from "../models/spt/services/LootRequest";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService"; import { ItemFilterService } from "../services/ItemFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
export declare class LootGenerator { export declare class LootGenerator {
protected logger: ILogger; protected logger: ILogger;
protected hashUtil: HashUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localisationService: LocalisationService;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService); constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService);
/** /**
* Generate a list of items based on options passed in * Generate a list of items based on configuration options parameter
* @param options parameters to adjust what loot is generated * @param options parameters to adjust how loot is generated
* @returns An array of loot items * @returns An array of loot items
*/ */
createRandomloot(options: LootRequest): LootItem[]; createRandomloot(options: LootRequest): LootItem[];
@ -33,23 +37,31 @@ export declare class LootGenerator {
* 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
* @param itemTypeCounts item limit counts * @param itemTypeCounts item limit counts
* @param options item filters
* @param result array to add found item to * @param result array to add found item to
* @returns true if item was valid and added to pool * @returns true if item was valid and added to pool
*/ */
protected findAndAddRandomItemToLoot(items: [string, ITemplateItem][], itemTypeCounts: Record<string, { protected findAndAddRandomItemToLoot(items: [string, ITemplateItem][], itemTypeCounts: Record<string, {
current: number; current: number;
max: number; max: number;
}>, result: LootItem[]): boolean; }>, options: LootRequest, result: LootItem[]): boolean;
/**
* Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values
* @param item item to get stack count of
* @param options loot options
* @returns stack count
*/
protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): 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 globalDefaultPresets presets to choose from
* @param itemTypeCounts item limit counts * @param itemTypeCounts item limit counts
* @param itemBlacklist items to skip
* @param result array to add found preset to * @param result array to add found preset to
* @returns true if preset was valid and added to pool * @returns true if preset was valid and added to pool
*/ */
protected findAndAddRandomPresetToLoot(globalDefaultPresets: [string, Preset][], itemTypeCounts: Record<string, { protected findAndAddRandomPresetToLoot(globalDefaultPresets: [string, Preset][], itemTypeCounts: Record<string, {
current: number; current: number;
max: number; max: number;
}>, result: LootItem[]): boolean; }>, itemBlacklist: string[], result: LootItem[]): boolean;
} }

View File

@ -1,8 +1,10 @@
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService"; import { ItemFilterService } from "../services/ItemFilterService";
import { SeasonalEventService } from "../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
@ -12,10 +14,32 @@ export declare class PMCLootGenerator {
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
protected seasonalEventService: SeasonalEventService;
protected pocketLootPool: string[]; protected pocketLootPool: string[];
protected vestLootPool: string[];
protected backpackLootPool: string[]; protected backpackLootPool: string[];
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService); constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService);
/**
* Create an array of loot items a PMC can have in their pockets
* @returns string array of tpls
*/
generatePMCPocketLootPool(): string[]; generatePMCPocketLootPool(): string[];
/**
* Create an array of loot items a PMC can have in their vests
* @returns string array of tpls
*/
generatePMCVestLootPool(): string[];
/**
* Check if item has a width/hide 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(): string[]; generatePMCBackpackLootPool(): string[];
} }

View File

@ -1,4 +1,7 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotHelper } from "../helpers/BotHelper"; import { BotHelper } from "../helpers/BotHelper";
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper"; import { ProfileHelper } from "../helpers/ProfileHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Skills, Stats } from "../models/eft/common/tables/IBotBase"; import { Skills, Stats } from "../models/eft/common/tables/IBotBase";
@ -10,21 +13,30 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { BotLootCacheService } from "../services/BotLootCacheService"; import { BotLootCacheService } from "../services/BotLootCacheService";
import { FenceService } from "../services/FenceService"; import { FenceService } from "../services/FenceService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { BotGenerator } from "./BotGenerator"; import { BotGenerator } from "./BotGenerator";
export declare class PlayerScavGenerator { export declare class PlayerScavGenerator {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected hashUtil: HashUtil;
protected itemHelper: ItemHelper;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
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 jsonUtil: JsonUtil;
protected fenceService: FenceService; protected fenceService: FenceService;
protected botLootCacheService: BotLootCacheService; protected botLootCacheService: BotLootCacheService;
protected localisationService: LocalisationService;
protected botGenerator: BotGenerator; protected botGenerator: BotGenerator;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected playerScavConfig: IPlayerScavConfig; protected playerScavConfig: IPlayerScavConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, botGenerator: BotGenerator, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer);
/** /**
* Update a player profile to include a new player scav profile * 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

View File

@ -1,6 +1,10 @@
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { Preset } from "../models/eft/common/IGlobals";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
export declare class RagfairAssortGenerator { export declare class RagfairAssortGenerator {
@ -8,18 +12,41 @@ export declare class RagfairAssortGenerator {
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected seasonalEventService: SeasonalEventService;
protected configServer: ConfigServer;
protected generatedAssortItems: Item[]; protected generatedAssortItems: Item[];
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer); protected ragfairConfig: IRagfairConfig;
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
/** /**
* Get an array of unique items that can be sold on the flea * Get an array of unique items that can be sold on the flea
* @returns array of unique items * @returns array of unique items
*/ */
getAssortItems(): Item[]; getAssortItems(): Item[];
/**
* Check internal generatedAssortItems 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 items the flea can sell
* @returns array of unique items * @returns array of unique items
*/ */
protected generateRagfairAssortItems(): Item[]; protected generateRagfairAssortItems(): Item[];
/**
* Get presets from globals.json
* @returns Preset object array
*/
protected getPresets(): Preset[];
/**
* 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
* @param tplId tplid to add to item
* @param id id to add to item
* @returns hydrated Item object
*/
protected createRagfairAssortItem(tplId: string, id?: string): Item; protected createRagfairAssortItem(tplId: string, id?: string): Item;
} }

View File

@ -1,16 +1,19 @@
import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { PaymentHelper } from "../helpers/PaymentHelper";
import { PresetHelper } from "../helpers/PresetHelper"; import { PresetHelper } from "../helpers/PresetHelper";
import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IBarterScheme } from "../models/eft/common/tables/ITrader";
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairOffer, OfferRequirement } from "../models/eft/ragfair/IRagfairOffer";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { Dynamic, IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { FenceService } from "../services/FenceService"; import { FenceService } from "../services/FenceService";
import { LocalisationService } from "../services/LocalisationService";
import { RagfairCategoriesService } from "../services/RagfairCategoriesService"; import { RagfairCategoriesService } from "../services/RagfairCategoriesService";
import { RagfairOfferService } from "../services/RagfairOfferService"; import { RagfairOfferService } from "../services/RagfairOfferService";
import { RagfairPriceService } from "../services/RagfairPriceService"; import { RagfairPriceService } from "../services/RagfairPriceService";
@ -27,18 +30,45 @@ export declare class RagfairOfferGenerator {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected ragfairServerHelper: RagfairServerHelper; protected ragfairServerHelper: RagfairServerHelper;
protected handbookHelper: HandbookHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected ragfairAssortGenerator: RagfairAssortGenerator; protected ragfairAssortGenerator: RagfairAssortGenerator;
protected ragfairOfferService: RagfairOfferService; protected ragfairOfferService: RagfairOfferService;
protected ragfairPriceService: RagfairPriceService; protected ragfairPriceService: RagfairPriceService;
protected localisationService: LocalisationService;
protected paymentHelper: PaymentHelper;
protected ragfairCategoriesService: RagfairCategoriesService; protected ragfairCategoriesService: RagfairCategoriesService;
protected fenceService: FenceService; protected fenceService: FenceService;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); protected allowedFleaPriceItemsForBarter: {
tpl: string;
price: number;
}[];
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer);
createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
/**
* Calculate the offer price that's listed on the flea listing
* @param offerRequirements barter requirements for offer
* @returns rouble cost of offer
*/
protected calculateOfferListingPrice(offerRequirements: OfferRequirement[]): number;
/**
* Get avatar url from trader table in db
* @param isTrader Is user we're getting avatar for a trader
* @param userId persons id to get avatar of
* @returns url of avatar
*/
protected getAvatarUrl(isTrader: boolean, userId: string): string;
/**
* Convert a count of currency into roubles
* @param currencyCount amount of currency to convert into roubles
* @param currencyType Type of currency (euro/dollar/rouble)
* @returns count of roubles
*/
protected calculateRoublePrice(currencyCount: number, currencyType: string): number;
protected getTraderId(userID: string): string; protected getTraderId(userID: string): string;
protected getRating(userID: string): number; protected getRating(userID: string): number;
/** /**
@ -58,13 +88,49 @@ 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[]): void; generateDynamicOffers(expiredOffers?: Item[]): Promise<void>;
protected createOffersForItems(assortItemIndex: string, assortItemsToProcess: Item[], expiredOffers: Item[], config: Dynamic): Promise<void>;
/**
* Create one flea offer for a specific item
* @param items Item to create offer for
* @param isPreset Is item a weapon preset
* @param itemDetails raw db item details
* @returns
*/
protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise<Item[]>;
/** /**
* 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 used)
* @param itemDetails db details of first item
* @returns
*/
protected getItemCondition(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[];
/**
* Get the relevant condition id if item tpl matches in ragfair.json/condition
* @param tpl Item to look for matching condition object
* @returns condition id
*/
protected getDynamicConditionIdForTpl(tpl: string): string;
/**
* Alter an items condition based on its item base type
* @param conditionSettingsId also the parentId of item being altered
* @param item Item to adjust condition details of
* @param itemDetails db item details of first item in array
*/
protected randomiseItemCondition(conditionSettingsId: string, item: Item, itemDetails: ITemplateItem): void;
/**
* Adjust an items durability/maxDurability value
* @param item item (weapon/armor) to adjust
* @param multiplier Value to multiple durability by
*/
protected randomiseDurabilityValues(item: Item, multiplier: number): void;
/** /**
* Add missing conditions to an item if needed * Add missing conditions to an item if needed
* Durabiltiy for repairable items * Durabiltiy for repairable items
@ -72,21 +138,37 @@ export declare class RagfairOfferGenerator {
* @param item item to add conditions to * @param item item to add conditions to
* @returns Item with conditions added * @returns Item with conditions added
*/ */
protected addMissingCondition(item: Item): Item; protected addMissingConditions(item: Item): Item;
protected getOfferRequirements(items: Item[]): { /**
count: number; * Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based
_tpl: string; * @param offerItems Items for sale in offer
* @returns barter scheme
*/
protected createBarterRequirement(offerItems: Item[]): IBarterScheme[];
/**
* Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter`
* @returns array with tpl/price values
*/
protected getFleaPricesAsArray(): {
tpl: string;
price: number;
}[]; }[];
/**
* Create a random currency-based barter scheme for an array of items
* @param offerItems Items on offer
* @returns Barter scheme for offer
*/
protected createCurrencyRequirement(offerItems: Item[]): IBarterScheme[];
/** /**
* Create a flea offer and store it in the Ragfair server offers array * Create a flea offer and store it in the Ragfair server offers array
* @param userID owner of the offer * @param userID owner of the offer
* @param time time offer is put up * @param time time offer is put up
* @param items items in the offer * @param items items in the offer
* @param barterScheme * @param barterScheme cost of item (currency or barter)
* @param loyalLevel * @param loyalLevel Loyalty level needed to buy item
* @param price price of offer * @param price price of offer
* @param sellInOnePiece * @param sellInOnePiece
* @returns * @returns Ragfair offer
*/ */
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
} }

View File

@ -2,7 +2,6 @@ import { ItemHelper } from "../helpers/ItemHelper";
import { Product } from "../models/eft/common/tables/IBotBase"; import { Product } from "../models/eft/common/tables/IBotBase";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase"; import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase";
import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData";
import { IScavCaseConfig } from "../models/spt/config/IScavCaseConfig"; import { IScavCaseConfig } from "../models/spt/config/IScavCaseConfig";
import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "../models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "../models/spt/hideout/ScavCaseRewardCountsAndPrices";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
@ -28,21 +27,15 @@ export declare class ScavCaseRewardGenerator {
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer);
/** /**
* Create an array of rewards that will be given to the player upon completing their scav case build * Create an array of rewards that will be given to the player upon completing their scav case build
* @param body client request * @param recipeId recipe of the scav case craft
* @returns Product array * @returns Product array
*/ */
generate(body: IHideoutScavCaseStartRequestData): Product[]; generate(recipeId: string): Product[];
/** /**
* Get all db items that are not blacklisted in scavcase config * Get all db items that are not blacklisted in scavcase config
* @returns filtered array of db items * @returns filtered array of db items
*/ */
protected getDbItems(): ITemplateItem[]; protected getDbItems(): ITemplateItem[];
/**
* Check if a template id has a blacklisted parent id
* @param tplid template id to check
* @returns true if item is blacklisted
*/
protected itemHasBlacklistedParent(tplid: string): boolean;
/** /**
* Pick a number of items to be rewards, the count is defined by the values in * Pick a number of items to be rewards, the count is defined by the values in
* @param items item pool to pick rewards from * @param items item pool to pick rewards from

View File

@ -1,38 +1,54 @@
import { ApplicationContext } from "../context/ApplicationContext";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { IWeatherData } from "../models/eft/weather/IWeatherData"; import { IWeather, IWeatherData } from "../models/eft/weather/IWeatherData";
import { WindDirection } from "../models/enums/WindDirection";
import { IWeatherConfig } from "../models/spt/config/IWeatherConfig"; import { IWeatherConfig } from "../models/spt/config/IWeatherConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class WeatherGenerator { export declare class WeatherGenerator {
protected weightedRandomHelper: WeightedRandomHelper; protected weightedRandomHelper: WeightedRandomHelper;
protected logger: ILogger;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected applicationContext: ApplicationContext;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected weatherConfig: IWeatherConfig; protected weatherConfig: IWeatherConfig;
constructor(weightedRandomHelper: WeightedRandomHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); constructor(weightedRandomHelper: WeightedRandomHelper, logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, applicationContext: ApplicationContext, configServer: ConfigServer);
calculateTime(data: IWeatherData): IWeatherData; calculateGameTime(data: IWeatherData): IWeatherData;
/** /**
* Get server uptime seconds multiplied by a multiplier and add to current time as seconds * Get server uptime seconds multiplied by a multiplier and add to current time as seconds
* Format to BSGs requirements * Format to BSGs requirements
* @param computedDate current date * @param currentDate current date
* @returns formatted time * @returns formatted time
*/ */
protected getAcceleratedTime(computedDate: Date): string; protected getBsgFormattedInRaidTime(currentDate: Date): string;
/**
* Get the current in-raid time
* @param currentDate (new Date())
* @returns Date object of current in-raid time
*/
getInRaidTime(currentDate: Date): Date;
/** /**
* Get current time formatted to fit BSGs requirement * Get current time formatted to fit BSGs requirement
* @param computedDate date to format into bsg style * @param date date to format into bsg style
* @returns * @returns
*/ */
protected getNormalTime(computedDate: Date): string; protected getBSGFormattedTime(date: Date): string;
/** /**
* Return randomised Weather data * Return randomised Weather data with help of config/weather.json
* @param weatherData weather input data
* @returns Randomised weather data * @returns Randomised weather data
*/ */
generateWeather(weatherData: IWeatherData): IWeatherData; generateWeather(): IWeather;
protected getWeightedFog(): string; /**
* Set IWeather date/time/timestamp values to now
* @param weather Object to update
*/
protected setCurrentDateTime(weather: IWeather): void;
protected getWeightedWindDirection(): WindDirection;
protected getWeightedWindSpeed(): number;
protected getWeightedFog(): number;
protected getWeightedRain(): number; protected getWeightedRain(): number;
protected getRandomFloat(node: string): number; protected getRandomFloat(node: string): number;
protected getRandomInt(node: string): number;
} }

View File

@ -0,0 +1,6 @@
import { InventoryMagGen } from "./InventoryMagGen";
export interface IInventoryMagGen {
getPriority(): number;
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
process(inventoryMagGen: InventoryMagGen): void;
}

View File

@ -0,0 +1,16 @@
import { MinMax } from "../../models/common/MinMax";
import { Inventory } from "../../models/eft/common/tables/IBotBase";
import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem";
export declare class InventoryMagGen {
private magCounts;
private magazineTemplate;
private weaponTemplate;
private ammoTemplate;
private pmcInventory;
constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory);
getMagCount(): MinMax;
getMagazineTemplate(): ITemplateItem;
getWeaponTemplate(): ITemplateItem;
getAmmoTemplate(): ITemplateItem;
getPmcInventory(): Inventory;
}

View File

@ -0,0 +1,12 @@
import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper";
import { RandomUtil } from "../../../utils/RandomUtil";
import { IInventoryMagGen } from "../IInventoryMagGen";
import { InventoryMagGen } from "../InventoryMagGen";
export declare class BarrelInventoryMagGen implements IInventoryMagGen {
protected randomUtil: RandomUtil;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
constructor(randomUtil: RandomUtil, botWeaponGeneratorHelper: BotWeaponGeneratorHelper);
getPriority(): number;
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
process(inventoryMagGen: InventoryMagGen): void;
}

View File

@ -0,0 +1,16 @@
import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "../../../helpers/ItemHelper";
import { ILogger } from "../../../models/spt/utils/ILogger";
import { LocalisationService } from "../../../services/LocalisationService";
import { IInventoryMagGen } from "../IInventoryMagGen";
import { InventoryMagGen } from "../InventoryMagGen";
export declare class ExternalInventoryMagGen implements IInventoryMagGen {
protected logger: ILogger;
protected itemHelper: ItemHelper;
protected localisationService: LocalisationService;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
constructor(logger: ILogger, itemHelper: ItemHelper, localisationService: LocalisationService, botWeaponGeneratorHelper: BotWeaponGeneratorHelper);
getPriority(): number;
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
process(inventoryMagGen: InventoryMagGen): void;
}

View File

@ -0,0 +1,10 @@
import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper";
import { IInventoryMagGen } from "../IInventoryMagGen";
import { InventoryMagGen } from "../InventoryMagGen";
export declare class InternalMagazineInventoryMagGen implements IInventoryMagGen {
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
constructor(botWeaponGeneratorHelper: BotWeaponGeneratorHelper);
getPriority(): number;
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
process(inventoryMagGen: InventoryMagGen): void;
}

View File

@ -0,0 +1,10 @@
import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper";
import { IInventoryMagGen } from "../IInventoryMagGen";
import { InventoryMagGen } from "../InventoryMagGen";
export declare class UbglExternalMagGen implements IInventoryMagGen {
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
constructor(botWeaponGeneratorHelper: BotWeaponGeneratorHelper);
getPriority(): number;
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
process(inventoryMagGen: InventoryMagGen): void;
}

View File

@ -1,29 +1,43 @@
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderAssort } from "../models/eft/common/tables/ITrader";
import { QuestStatus } from "../models/enums/QuestStatus";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { LocalisationService } from "../services/LocalisationService";
import { ItemHelper } from "./ItemHelper"; import { ItemHelper } from "./ItemHelper";
import { QuestHelper } from "./QuestHelper"; import { QuestHelper } from "./QuestHelper";
export declare class AssortHelper { export declare class AssortHelper {
protected logger: ILogger; protected logger: ILogger;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected localisationService: LocalisationService;
protected questHelper: QuestHelper; protected questHelper: QuestHelper;
constructor(logger: ILogger, itemHelper: ItemHelper, databaseServer: DatabaseServer, questHelper: QuestHelper); constructor(logger: ILogger, itemHelper: ItemHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, questHelper: QuestHelper);
/** /**
* Remove assorts from a trader that have not been unlocked yet * Remove assorts from a trader that have not been unlocked yet
* @param pmcProfile player profile * @param pmcProfile player profile
* @param traderId traders id * @param traderId traders id the assort belongs to
* @param assort assort items from a trader * @param traderAssorts All assort items from same trader
* @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders
* @returns assort items minus locked quest assorts * @returns assort items minus locked quest assorts
*/ */
stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, flea?: boolean): ITraderAssort; stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record<string, Record<string, string>>, flea?: boolean): ITraderAssort;
/**
* Get a quest id + the statuses quest can be in to unlock assort
* @param mergedQuestAssorts quest assorts to search for assort id
* @param assortId Assort to look for linked quest id
* @returns quest id + array of quest status the assort should show for
*/
protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record<string, Record<string, string>>, assortId: string): {
questId: string;
status: QuestStatus[];
};
/** /**
* Remove assorts from a trader that have not been unlocked yet * Remove assorts from a trader that have not been unlocked yet
* @param pmcProfile player profile * @param pmcProfile player profile
* @param traderId traders id * @param traderId traders id
* @param assort traders assorts * @param assort traders assorts
* @returns traders assorts minus locked loyality assorts * @returns traders assorts minus locked loyalty assorts
*/ */
stripLockedLoyaltyAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort): ITraderAssort; stripLockedLoyaltyAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort): ITraderAssort;
/** /**

46
types/helpers/BotDifficultyHelper.d.ts vendored Normal file
View File

@ -0,0 +1,46 @@
import { Difficulty } from "../models/eft/common/tables/IBotType";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { LocalisationService } from "../services/LocalisationService";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { BotHelper } from "./BotHelper";
export declare class BotDifficultyHelper {
protected logger: ILogger;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil;
protected localisationService: LocalisationService;
protected botHelper: BotHelper;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer);
getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
/**
* Get difficulty settings for desired bot type, if not found use assault bot types
* @param type bot type to retrieve difficulty of
* @param difficulty difficulty to get settings for (easy/normal etc)
* @returns Difficulty object
*/
getBotDifficultySettings(type: string, difficulty: string): Difficulty;
/**
* Get difficulty settings for a PMC
* @param type "usec" / "bear"
* @param difficulty what difficulty to retrieve
* @returns Difficulty object
*/
protected getDifficultySettings(type: string, difficulty: string): Difficulty;
/**
* Translate chosen value from pre-raid difficulty dropdown into bot difficulty value
* @param dropDownDifficulty Dropdown difficulty value to convert
* @returns bot difficulty
*/
convertBotDifficultyDropdownToBotDifficulty(dropDownDifficulty: string): string;
/**
* Choose a random difficulty from - easy/normal/hard/impossible
* @returns random difficulty
*/
chooseRandomDifficulty(): string;
}

View File

@ -1,159 +1,42 @@
import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper";
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
import { Grid, ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { LocalisationService } from "../services/LocalisationService";
import { ItemFilterService } from "../services/ItemFilterService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
import { ContainerHelper } from "./ContainerHelper";
import { InventoryHelper } from "./InventoryHelper";
import { ItemHelper } from "./ItemHelper"; import { ItemHelper } from "./ItemHelper";
import { ProbabilityHelper } from "./ProbabilityHelper";
import { ProfileHelper } from "./ProfileHelper";
export declare class BotGeneratorHelper { export declare class BotGeneratorHelper {
protected logger: ILogger; protected logger: ILogger;
protected jsonUtil: JsonUtil;
protected hashUtil: HashUtil;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected probabilityHelper: ProbabilityHelper;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected durabilityLimitsHelper: DurabilityLimitsHelper; protected durabilityLimitsHelper: DurabilityLimitsHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected inventoryHelper: InventoryHelper; protected localisationService: LocalisationService;
protected containerHelper: ContainerHelper;
protected botEquipmentFilterService: BotEquipmentFilterService;
protected itemFilterService: ItemFilterService;
protected profileHelper: ProfileHelper;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, localisationService: LocalisationService, configServer: ConfigServer);
/**
* TODO - very similar to generateModsForWeapon
* Check mods are compatible and add to array
* @param equipment Equipment item to add mods to
* @param modPool Mod list to choose frm
* @param parentId parentid of item to add mod to
* @param parentTemplate template objet of item to add mods to
* @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type
* @returns Item + compatible mods as an array
*/
generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances): Item[];
/**
* TODO - very similar to generateModsForEquipment
* @param sessionId session id
* @param weapon Weapon to add mods to
* @param modPool pool of compatible mods to attach to gun
* @param weaponParentId parentId of weapon
* @param parentTemplate
* @param modSpawnChances
* @param ammoTpl ammo tpl to use when generating magazines/cartridges
* @param botRole role of bot weapon is generated for
* @returns Weapon with mods
*/
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string): Item[];
/**
* Generate a pool of mods for this bots mod type if bot has values inside `randomisedWeaponModSlots` array found in bot.json/equipment[botrole]
* @param allowedMods Mods to be added to mod pool
* @param botEquipBlacklist blacklist of items not allowed to be added to mod pool
* @param modSlot Slot to generate mods for
* @param itemModPool base mod pool to replace values of
*/
protected generateDynamicModPool(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string, itemModPool: Record<string, string[]>): void;
/**
* Check if the specific item type on the weapon has reached the set limit
* @param modTpl item to check is limited
* @param currentCount current number of this item on gun
* @param maxLimit mod limit allowed
* @param botRole role of bot we're checking weapon of
* @returns true if limit reached
*/
protected weaponModLimitReached(modTpl: string, currentCount: {
count: number;
}, maxLimit: number, botRole: string): boolean;
/**
* log errors if mod is not valid for a slot
* @param modTpl
* @param found
* @param itemSlot
* @param modTemplate
* @param modSlot
* @param parentTemplate
* @returns true if valid
*/
protected isModValidForSlot(modTpl: string, found: boolean, itemSlot: Slot, modTemplate: ITemplateItem, modSlot: string, parentTemplate: ITemplateItem): boolean;
/**
* Create a mod item with parameters as properties
* @param modId _id
* @param modTpl _tpl
* @param parentId parentId
* @param modSlot slotId
* @param modTemplate Used to add additional properites in the upd object
* @returns Item object
*/
protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem): Item;
/**
* Is this magazine cylinder related (revolvers and grenade launchers)
* @param magazineParentName the name of the magazines parent
* @returns true if it is cylinder related
*/
magazineIsCylinderRelated(magazineParentName: string): boolean;
/**
* randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
* never return true for an item that has 0% spawn chance
* @param itemSlot slot the item sits in
* @param modSlot slot the mod sits in
* @param modSpawnChances Chances for various mod spawns
* @returns boolean true if it should spawn
*/
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean;
/**
* Get a list of containers that hold ammo
* e.g. mod_magazine
* @returns string array
*/
protected getAmmoContainers(): string[];
/**
* Get the slot details for an item (chamber/cartridge/slot)
* @param modSlot e.g patron_in_weapon
* @param parentTemplate item template
* @returns
*/
protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot;
/**
* With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines.
* Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0.
* Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
* This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
* @param items The items where the CylinderMagazine's camora are appended to
* @param modPool modPool which should include available cartrigdes
* @param parentId The CylinderMagazine's UID
* @param parentTemplate The CylinderMagazine's template
* @returns
*/
protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
/**
* Take a record of camoras and merge the compatable shells into one array
* @param camorasWithShells camoras we want to merge into one array
* @returns string array of shells fro luitple camora sources
*/
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
/** /**
* Adds properties to an item * Adds properties to an item
* e.g. Repairable / HasHinge / Foldable / MaxDurability * e.g. Repairable / HasHinge / Foldable / MaxDurability
* @param itemTemplate * @param itemTemplate Item extra properties are being generated for
* @param botRole Used by weapons to randomise the durability values * @param botRole Used by weapons to randomize the durability values. Null for non-equipped items
* @returns Item Upd object with extra properties * @returns Item Upd object with extra properties
*/ */
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: any): { generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): {
upd?: Upd; upd?: Upd;
}; };
/**
* Get the chance for the weapon attachment or helmet equipment to be set as activated
* @param botRole role of bot with weapon/helmet
* @param setting the setting of the weapon attachment/helmet equipment to be activated
* @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null
* @returns Percent chance to be active
*/
protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number;
/** /**
* Create a repairable object for a weapon that containers durability + max durability properties * Create a repairable object for a weapon that containers durability + max durability properties
* @param itemTemplate weapon object being generated for * @param itemTemplate weapon object being generated for
@ -168,32 +51,23 @@ export declare class BotGeneratorHelper {
* @returns Repairable object * @returns Repairable object
*/ */
protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable;
protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
/** /**
* Can an item be added to an item without issue * Can item be added to another item without conflict
* @param items * @param items Items to check compatibilities with
* @param tplToCheck * @param tplToCheck Tpl of the item to check for incompatibilities
* @param equipmentSlot * @param equipmentSlot Slot the item will be placed into
* @returns true if possible * @returns false if no incompatibilities, also has incompatibility reason
*/ */
isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): boolean; isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): {
incompatible: boolean;
reason: string;
};
/** /**
* Adds an item with all its childern into specified equipmentSlots, wherever it fits. * Convert a bots role to the equipment role used in config/bot.json
* @param equipmentSlots * @param botRole Role to convert
* @param parentId * @returns Equipment role (e.g. pmc / assault / bossTagilla)
* @param parentTpl
* @param itemWithChildren
* @param inventory
* @returns a `boolean` indicating item was added
*/ */
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: PmcInventory): boolean; getBotEquipmentRole(botRole: string): string;
/**
* is the provided item allowed inside a container
* @param slot location item wants to be placed in
* @param itemTpl item being placed
* @returns true if allowed
*/
protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean;
} }
/** TODO - move into own class */ /** TODO - move into own class */
export declare class ExhaustableArray<T> { export declare class ExhaustableArray<T> {

View File

@ -1,8 +1,10 @@
import { MinMax } from "../models/common/MinMax";
import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType";
import { IBotConfig } from "../models/spt/config/IBotConfig"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { LocalisationService } from "../services/LocalisationService";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
export declare class BotHelper { export declare class BotHelper {
@ -10,17 +12,27 @@ export declare class BotHelper {
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer);
getBotDifficultySettings(type: string, difficulty: string): Difficulty;
getBotTemplate(role: string): IBotType;
getPmcDifficultySettings(type: string, difficulty: string): Difficulty;
/** /**
* Randomise the chance the PMC will attack their own side * Get a template object for the specified botRole from bots.types db
* @param role botRole to get template for
* @returns IBotType object
*/
getBotTemplate(role: string): IBotType;
/**
* Randomize the chance the PMC will attack their own side
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings * @param difficultySettings pmc difficulty settings
*/ */
randomisePmcHostility(difficultySettings: Difficulty): void; randomizePmcHostility(difficultySettings: Difficulty): void;
/**
* Is the passed in bot role a PMC (usec/bear/pmc)
* @param botRole bot role to check
* @returns true if is pmc
*/
isBotPmc(botRole: string): boolean; isBotPmc(botRole: string): boolean;
isBotBoss(botRole: string): boolean; isBotBoss(botRole: string): boolean;
isBotFollower(botRole: string): boolean; isBotFollower(botRole: string): boolean;
@ -31,7 +43,7 @@ export declare class BotHelper {
*/ */
addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void; addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void;
/** /**
* Add a bot to the ENEMY_BOT_TYPES array * Add a bot to the ENEMY_BOT_TYPES array, do not add itself if its on the enemy list
* @param difficultySettings bot settings to alter * @param difficultySettings bot settings to alter
* @param typesToAdd bot type to add to enemy list * @param typesToAdd bot type to add to enemy list
*/ */
@ -42,4 +54,35 @@ export declare class BotHelper {
* @param typesToAdd bot type to add to revenge list * @param typesToAdd bot type to add to revenge list
*/ */
addBotToRevengeList(difficultySettings: Difficulty, typesToAdd: string[]): void; addBotToRevengeList(difficultySettings: Difficulty, typesToAdd: string[]): void;
/**
* Choose if a bot should become a PMC by checking if bot type is allowed to become a Pmc in botConfig.convertFromChances and doing a random int check
* @param botRole the bot role to check if should be a pmc
* @returns true if should be a pmc
*/
shouldBotBePmc(botRole: string): boolean;
rollChanceToBePmc(role: string, botConvertMinMax: MinMax): boolean;
botRoleIsPmc(botRole: string): boolean;
/**
* Get randomization settings for bot from config/bot.json
* @param botLevel level of bot
* @param botEquipConfig bot equipment json
* @returns RandomisationDetails
*/
getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails;
/**
* Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec
* @returns pmc role
*/
getRandomizedPmcRole(): string;
/**
* Get the corresponding side when sptBear or sptUsec is passed in
* @param botRole role to get side for
* @returns side (usec/bear)
*/
getPmcSideByRole(botRole: string): string;
/**
* Get a randomized PMC side based on bot config value 'isUsec'
* @returns pmc side as string
*/
protected getRandomizedPmcSide(): string;
} }

View File

@ -0,0 +1,83 @@
import { MinMax } from "../models/common/MinMax";
import { Inventory } from "../models/eft/common/tables/IBotBase";
import { Item } from "../models/eft/common/tables/IItem";
import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { EquipmentSlots } from "../models/enums/EquipmentSlots";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { ContainerHelper } from "./ContainerHelper";
import { InventoryHelper } from "./InventoryHelper";
import { ItemHelper } from "./ItemHelper";
export declare class BotWeaponGeneratorHelper {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper;
protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected inventoryHelper: InventoryHelper;
protected localisationService: LocalisationService;
protected containerHelper: ContainerHelper;
constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper);
/**
* Get a randomized number of bullets for a specific magazine
* @param magCounts min and max count of magazines
* @param magTemplate magazine to generate bullet count for
* @returns bullet count number
*/
getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number;
/**
* Get a randomized count of magazines
* @param magCounts min and max value returned value can be between
* @returns numerical value of magazine count
*/
getRandomizedMagazineCount(magCounts: MinMax): number;
/**
* Is this magazine cylinder related (revolvers and grenade launchers)
* @param magazineParentName the name of the magazines parent
* @returns true if it is cylinder related
*/
magazineIsCylinderRelated(magazineParentName: string): boolean;
/**
* Create a magazine using the parameters given
* @param magazineTpl Tpl of the magazine to create
* @param ammoTpl Ammo to add to magazine
* @param magTemplate template object of magazine
* @returns Item array
*/
createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[];
/**
* Add a specific number of cartridges to a bots inventory (defaults to vest and pockets)
* @param ammoTpl Ammo tpl to add to vest/pockets
* @param cartridgeCount number of cartridges to add to vest/pockets
* @param inventory bot inventory to add cartridges to
* @param equipmentSlotsToAddTo what equipment slots should bullets be added into
*/
addAmmoIntoEquipmentSlots(ammoTpl: string, cartridgeCount: number, inventory: Inventory, equipmentSlotsToAddTo?: EquipmentSlots[]): void;
/**
* Get a weapons default magazine template id
* @param weaponTemplate weapon to get default magazine for
* @returns tpl of magazine
*/
getWeaponsDefaultMagazineTpl(weaponTemplate: ITemplateItem): string;
/**
* TODO - move into BotGeneratorHelper, this is not the class for it
* Adds an item with all its children into specified equipmentSlots, wherever it fits.
* @param equipmentSlots
* @param parentId
* @param parentTpl
* @param itemWithChildren
* @param inventory
* @returns a `boolean` indicating item was added
*/
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): boolean;
/**
* is the provided item allowed inside a container
* @param slot location item wants to be placed in
* @param itemTpl item being placed
* @returns true if allowed
*/
protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean;
}

View File

@ -1,20 +1,24 @@
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile";
import { MessageType } from "../models/enums/MessageType"; import { MessageType } from "../models/enums/MessageType";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { ItemHelper } from "./ItemHelper"; import { ItemHelper } from "./ItemHelper";
import { NotificationSendHelper } from "./NotificationSendHelper"; import { NotificationSendHelper } from "./NotificationSendHelper";
import { NotifierHelper } from "./NotifierHelper"; import { NotifierHelper } from "./NotifierHelper";
export declare class DialogueHelper { export declare class DialogueHelper {
protected logger: ILogger;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected notifierHelper: NotifierHelper; protected notifierHelper: NotifierHelper;
protected notificationSendHelper: NotificationSendHelper; protected notificationSendHelper: NotificationSendHelper;
protected localisationService: LocalisationService;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper);
createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent;
/** /**
* Add a templated message to the dialogue. * Add a templated message to the dialogue.
@ -23,7 +27,7 @@ export declare class DialogueHelper {
* @param sessionID * @param sessionID
* @param rewards * @param rewards
*/ */
addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: Item[]): void;
/** /**
* Get the preview contents of the last message in a dialogue. * Get the preview contents of the last message in a dialogue.
* @param dialogue * @param dialogue
@ -34,7 +38,8 @@ export declare class DialogueHelper {
* Get the item contents for a particular message. * Get the item contents for a particular message.
* @param messageID * @param messageID
* @param sessionID * @param sessionID
* @param itemId Item being moved to inventory
* @returns * @returns
*/ */
getMessageItemContents(messageID: string, sessionID: string): Item[]; getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[];
} }

View File

@ -9,10 +9,10 @@ export declare class DurabilityLimitsHelper {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(randomUtil: RandomUtil, botHelper: BotHelper, configServer: ConfigServer); constructor(randomUtil: RandomUtil, botHelper: BotHelper, configServer: ConfigServer);
getRandomisedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number;
getRandomisedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number;
getRandomisedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number;
getRandomisedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number;
protected generateMaxWeaponDurability(botRole: string): number; protected generateMaxWeaponDurability(botRole: string): number;
protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number;
protected getLowestMaxWeaponFromConfig(botRole: string): number; protected getLowestMaxWeaponFromConfig(botRole: string): number;
@ -23,4 +23,6 @@ export declare class DurabilityLimitsHelper {
protected getMaxWeaponDeltaFromConfig(botRole: string): number; protected getMaxWeaponDeltaFromConfig(botRole: string): number;
protected getMinArmorDeltaFromConfig(botRole: string): number; protected getMinArmorDeltaFromConfig(botRole: string): number;
protected getMaxArmorDeltaFromConfig(botRole: string): number; protected getMaxArmorDeltaFromConfig(botRole: string): number;
protected getMinArmorLimitPercentFromConfig(botRole: string): number;
protected getMinWeaponLimitPercentFromConfig(botRole: string): number;
} }

View File

@ -1,9 +1,9 @@
import { ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
export declare class GameEventHelper { export declare class GameEventHelper {
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
constructor(databaseServer: DatabaseServer); protected configServer: ConfigServer;
get events(): Record<string, string>; protected seasonalEventConfig: ISeasonalEventConfig;
get christmasEventItems(): string[]; constructor(databaseServer: DatabaseServer, configServer: ConfigServer);
itemIsChristmasRelated(itemId: string): boolean;
christmasEventEnabled(): boolean;
} }

View File

@ -1,3 +1,4 @@
import { DatabaseServer } from "../servers/DatabaseServer";
declare class LookupItem { declare class LookupItem {
byId: Record<number, string>; byId: Record<number, string>;
byParent: Record<string, string[]>; byParent: Record<string, string[]>;
@ -9,25 +10,44 @@ export declare class LookupCollection {
constructor(); constructor();
} }
export declare class HandbookHelper { export declare class HandbookHelper {
protected lookup: LookupCollection; protected databaseServer: DatabaseServer;
hydrateLookup(lookup: LookupCollection): void; protected lookupCacheGenerated: boolean;
getTemplatePrice(x: string): number; protected handbookPriceCache: LookupCollection;
constructor(databaseServer: DatabaseServer);
hydrateLookup(): void;
/**
* Get price from internal cache, if cache empty look up price directly in handbook (expensive)
* If no values found, return 1
* @param tpl item tpl to look up price for
* @returns price in roubles
*/
getTemplatePrice(tpl: string): number;
/**
* all items in template with the given parent category
* @param x
* @returns string array
*/
templatesWithParent(x: string): string[]; templatesWithParent(x: string): string[];
isCategory(x: string): boolean; /**
* Does category exist in handbook cache
* @param category
* @returns true if exists in cache
*/
isCategory(category: string): boolean;
childrenCategories(x: string): string[]; childrenCategories(x: string): string[];
/** /**
* Gets Currency to Ruble conversion Value * Convert non-roubles into roubles
* @param {number} value * @param nonRoubleCurrencyCount Currency count to convert
* @param {string} currencyFrom * @param currencyTypeFrom What current currency is
* @returns number * @returns Count in roubles
*/
inRUB(value: number, currencyFrom: string): number;
/**
* Gets Ruble to Currency conversion Value
* @param {number} value
* @param {string} currencyTo
* @returns number
*/ */
fromRUB(value: number, currencyTo: string): number; inRUB(nonRoubleCurrencyCount: number, currencyTypeFrom: string): number;
/**
* Convert roubles into another currency
* @param roubleCurrencyCount roubles to convert
* @param currencyTypeTo Currency to convert roubles into
* @returns currency count in desired type
*/
fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number;
} }
export {}; export {};

View File

@ -1,6 +1,6 @@
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { Effects, IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IHealthConfig } from "../models/spt/config/IHealthConfig"; import { IHealthConfig } from "../models/spt/config/IHealthConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
@ -16,7 +16,7 @@ export declare class HealthHelper {
protected healthConfig: IHealthConfig; protected healthConfig: IHealthConfig;
constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer);
/** /**
* Resets the profiles vitality/healh and vitality/effects properties to their defaults * Resets the profiles vitality/health and vitality/effects properties to their defaults
* @param sessionID Session Id * @param sessionID Session Id
* @returns updated profile * @returns updated profile
*/ */
@ -24,28 +24,34 @@ export declare class HealthHelper {
/** /**
* Update player profile with changes from request object * Update player profile with changes from request object
* @param pmcData Player profile * @param pmcData Player profile
* @param info Request object * @param request Heal request
* @param sessionID Session id * @param sessionID Session id
* @param addEffects Should effects be added or removed (default - add) * @param addEffects Should effects be added or removed (default - add)
*/ */
saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
/**
* Adjust hydration/energy/temperate and body part hp values in player profile to values in profile.vitality
* @param pmcData Profile to update
* @param sessionId Session id
*/
protected saveHealth(pmcData: IPmcData, sessionID: string): void; protected saveHealth(pmcData: IPmcData, sessionID: string): void;
/** /**
* Save effects to profile * Save effects to profile
* Works by removing all effects and adding them back from profile * Works by removing all effects and adding them back from profile
* Remoces empty 'Effects' objects if found * Removes empty 'Effects' objects if found
* @param pmcData Player profile * @param pmcData Player profile
* @param sessionID Session id * @param sessionId Session id
* @param bodyPartsWithEffects dict of body parts with effects that should be added to profile
* @param addEffects Should effects be added back to profile * @param addEffects Should effects be added back to profile
* @returns
*/ */
protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; protected saveEffects(pmcData: IPmcData, sessionId: string, bodyPartsWithEffects: Effects, deleteExistingEffects?: boolean): void;
/** /**
* Add effect to body part in profile * Add effect to body part in profile
* @param pmcData Player profile * @param pmcData Player profile
* @param effectBodyPart body part to edit * @param effectBodyPart body part to edit
* @param effectType Effect to add to body part * @param effectType Effect to add to body part
* @param duration How long the effect has left in seconds (-1 by default, no duration).
*/ */
protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string, duration?: number): void;
protected isEmpty(map: any): boolean; protected isEmpty(map: any): boolean;
} }

View File

@ -1,20 +1,21 @@
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Common, HideoutArea, Production, Productive } from "../models/eft/common/tables/IBotBase"; import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "../models/eft/common/tables/IBotBase";
import { Upd } from "../models/eft/common/tables/IItem"; import { Upd } from "../models/eft/common/tables/IItem";
import { StageBonus } from "../models/eft/hideout/IHideoutArea"; import { StageBonus } from "../models/eft/hideout/IHideoutArea";
import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData"; import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData";
import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData"; import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { LocalisationService } from "../services/LocalisationService";
import { PlayerService } from "../services/PlayerService"; import { PlayerService } from "../services/PlayerService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
import { InventoryHelper } from "./InventoryHelper"; import { InventoryHelper } from "./InventoryHelper";
import { ProfileHelper } from "./ProfileHelper"; import { ProfileHelper } from "./ProfileHelper";
@ -22,23 +23,25 @@ export declare class HideoutHelper {
protected logger: ILogger; protected logger: ILogger;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected itemEventRouter: ItemEventRouter; protected eventOutputHolder: EventOutputHolder;
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected inventoryHelper: InventoryHelper; protected inventoryHelper: InventoryHelper;
protected playerService: PlayerService; protected playerService: PlayerService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
static bitcoinFarm: string; static bitcoinFarm: string;
static waterCollector: string; static waterCollector: string;
static bitcoin: string; static bitcoin: string;
static expeditionaryFuelTank: string; static expeditionaryFuelTank: string;
static maxSkillPoint: number;
private static generatorOffMultipler;
protected hideoutConfig: IHideoutConfig; protected hideoutConfig: IHideoutConfig;
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, configServer: ConfigServer);
registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* This convinience function intialies new Production Object * This convenience function initializes new Production Object
* with all the constants. * with all the constants.
*/ */
initProduction(recipeId: string, productionTime: number): Production; initProduction(recipeId: string, productionTime: number): Production;
@ -79,6 +82,26 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}): void; }): void;
/**
* Update a productions progress value based on the amount of time that has passed
* @param pmcData Player profile
* @param prodId Production id being crafted
* @param recipe Recipe data being crafted
* @param hideoutProperties
*/
protected updateProductionProgress(pmcData: IPmcData, prodId: string, recipe: IHideoutProduction, hideoutProperties: {
btcFarmCGs?: number;
isGeneratorOn: boolean;
waterCollectorHasFilter?: boolean;
}): void;
/**
* Check if a productions progress value matches its corresponding recipes production time value
* @param pmcData Player profile
* @param prodId Production id
* @param recipe Recipe being crafted
* @returns progress matches productionTime from recipe
*/
protected doesProgressMatchProductionTime(pmcData: IPmcData, prodId: string): boolean;
/** /**
* Update progress timer for scav case * Update progress timer for scav case
* @param pmcData Profile to update * @param pmcData Profile to update
@ -103,7 +126,7 @@ export declare class HideoutHelper {
* Adjust water filter objects resourceValue or delete when they reach 0 resource * Adjust water filter objects resourceValue or delete when they reach 0 resource
* @param waterFilterArea water filter area to update * @param waterFilterArea water filter area to update
* @param production production object * @param production production object
* @param isGeneratorOn is generatory enabled * @param isGeneratorOn is generator enabled
* @param pmcData Player profile * @param pmcData Player profile
* @returns Updated HideoutArea object * @returns Updated HideoutArea object
*/ */
@ -111,11 +134,53 @@ export declare class HideoutHelper {
protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd; protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd;
protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): void; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): void;
protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production;
/**
* Get a count of how many BTC can be gathered by the profile
* @param pmcData Profile to look up
* @returns coin slot count
*/
protected getBTCSlots(pmcData: IPmcData): number; protected getBTCSlots(pmcData: IPmcData): number;
protected getManagementSkillsSlots(): number; protected getManagementSkillsSlots(): number;
protected hasManagementSkillSlots(pmcData: IPmcData): boolean; protected hasManagementSkillSlots(pmcData: IPmcData): boolean;
protected getHideoutManagementSkill(pmcData: IPmcData): Common; protected getHideoutManagementSkill(pmcData: IPmcData): Common;
protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number;
/**
* Get the crafting skill details from player profile
* @param pmcData Player profile
* @returns crafting skill, null if not found
*/
protected getCraftingSkill(pmcData: IPmcData): Common;
/**
* Adjust craft time based on crafting skill level found in player profile
* @param pmcData Player profile
* @param productionTime Time to complete hideout craft in seconds
* @returns Adjusted craft time in seconds
*/
protected getCraftingSkillProductionTimeReduction(pmcData: IPmcData, productionTime: number): number;
isProduction(productive: Productive): productive is Production; isProduction(productive: Productive): productive is Production;
getBTC(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; /**
* Gather crafted BTC from hideout area and add to inventory
* Reset production start timestamp if hideout area at full coin capacity
* @param pmcData Player profile
* @param request Take production request
* @param sessionId Session id
* @returns IItemEventRouterResponse
*/
getBTC(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionId: string): IItemEventRouterResponse;
/**
* Upgrade hideout wall from starting level to interactable level if enough time has passed
* @param pmcProfile Profile to upgrade wall in
*/
unlockHideoutWallInProfile(pmcProfile: IPmcData): void;
/**
* Hideout improvement is flagged as complete
* @param improvement hideout improvement object
* @returns true if complete
*/
protected hideoutImprovementIsComplete(improvement: IHideoutImprovement): boolean;
/**
* Iterate over hideout improvements not completed and check if they need to be adjusted
* @param pmcProfile Profile to adjust
*/
setHideoutImprovementsToCompleted(pmcProfile: IPmcData): void;
} }

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